Approximate distance oracles with improved stretch for sparse graphs

Liam Roditty, Roei Tov

Research output: Contribution to journalArticlepeer-review


Thorup and Zwick [1] introduced the notion of approximate distance oracles, a data structure that produces for an n-vertex, m-edge weighted undirected graph G=(V,E), distance estimations in constant query time. They presented a distance oracle of size O(kn1+1/k) that given a pair of vertices u,v∈V at distance d(u,v) produces in O(k) time an estimation that is bounded by (2k−1)d(u,v), i.e., a (2k−1)-multiplicative approximation (stretch). Thorup and Zwick [1] presented also a lower bound based on the girth conjecture of Erdős. For sparse unweighted graphs (i.e., m=O˜(n)) the lower bound does not apply. Pǎtraşcu and Roditty [2] used the sparsity of the graph and obtained a distance oracle that uses O˜(n5/3) space, has O(1) query time and a stretch of 2. Pǎtraşcu et al. [3] presented infinitely many distance oracles with fractional stretch factors that for graphs with m=O˜(n) converge exactly to the integral stretch factors and the corresponding space bound of Thorup and Zwick. It is not known, however, whether graph sparsity can help to get a stretch which is better than (2k−1) using only O˜(kn1+1/k) space. In this paper we answer this open question and prove a separation between sparse and dense graphs by showing that using sparsity it is possible to obtain better stretch/space tradeoffs than those of Thorup and Zwick. We show that for every k≥2 there is a distance oracle of size O˜(km1+1/k) that produces in O(k) time an estimation d(u,v) that satisfies d(u,v)≤d(u,v)≤(2k−1)d(u,v)−4, for k>2, and d(u,v)≤d(u,v)≤3d(u,v)−2, for k=2. Another contribution of this paper is a refined stretch analysis of Thorup and Zwick distance oracles that allows us to obtain a better understanding of this important data structure. We present simple conditions for every w∈V that characterize the exact scenarios in which every query that involves w produces an estimation of stretch strictly better than 2k−1, even in the case of dense graphs. We complement this contribution with an experiment on real world graphs. The main finding in the experiment is that different real world graphs are likely to satisfy the required conditions and hence the stretch of Thorup and Zwick distance oracles is much better than its worst case bound in these real world graphs.

Original languageEnglish
Pages (from-to)89-101
Number of pages13
JournalTheoretical Computer Science
StatePublished - 17 Jan 2023

Bibliographical note

Publisher Copyright:
© 2022 Elsevier B.V.


  • Approximate distance oracles
  • Approximate shortest paths
  • Graph algorithms


Dive into the research topics of 'Approximate distance oracles with improved stretch for sparse graphs'. Together they form a unique fingerprint.

Cite this