New Approximate Distance Oracles and Their Applications
Abstract
Let be an undirected graph with vertices and edges, and let . A distance oracle is a data structure designed to answer approximate distance queries, with the goal of achieving low stretch, efficient space usage, and fast query time. While much of the prior work focused on distance oracles with constant query time, this paper presents a comprehensive study of distance oracles with non-constant query time. We explore the tradeoffs between space, stretch, and query time of distance oracles in various regimes. Specifically, we consider both weighted and unweighted graphs in the regimes of stretch and stretch . In addition, we demonstrate several applications of our new distance oracles to the -Pairs Shortest Paths (-PSP) problem and the All Nodes Shortest Cycles () problem. Our main contributions are:
-
Weighted graphs: We present a new three-way trade-off between stretch, space, and query time, offering a natural extension of the classical Thorup–Zwick distance oracle [STOC’01 and JACM’05] to regimes with larger query time. Specifically, for any and integer , we construct a -stretch distance oracle with space and query time. This construction provides an asymptotic improvement over the classical -stretch and -space tradeoff of Thorup and Zwick in sparse graphs, at the cost of increased query time. We also improve upon a result of Dalirrooyfard et al. [FOCS’22], who presented a -stretch distance oracle with space and query time. In our oracle we reduce the stretch from to while preserving the same space and query time.
-
Unweighted graphs: We present a -approximation111. distance oracle with space and query time. This improves upon a -approximation distance oracle of Dalirrooyfard et al. [FOCS’22] while maintaining the same space and query time. We also present a distance oracle that given returns an estimate , using space and query time. To the best of our knowledge, this is the first distance oracle that simultaneously achieves a multiplicative stretch , and a space complexity , for some .
-
Applications for -PSP and : We present an -time algorithm for the -PSP problem, that for every input pair , where , returns an estimate such that . By allowing a small additive error, this result circumvents the conditional running time lower bound of , established by Dalirrooyfard et al. [FOCS’22] for achieving -stretch. Additionally, we present an -time algorithm for the problem that computes, for every , an estimate such that , where denotes the length of the shortest cycle containing . This improves upon the -time algorithm of Dalirrooyfard et al. [FOCS’22], while achieving the same approximation guarantee.
We obtain our results by developing several new techniques, among them are the borderline vertices technique and the middle vertex technique, which may be of independent interest.
Keywords and phrases:
Distance oracles, Fine-grained algorithms, Graph algorithms, Data structuresFunding:
Liam Roditty: Supported in part by BSF grants 2016365 and 2020356.Copyright and License:
2012 ACM Subject Classification:
Mathematics of computing Graph algorithmsEditors:
Ho-Lin Chen, Wing-Kai Hon, and Meng-Tsung TsaiSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Let be an undirected graph with vertices and edges with non-negative real edge weights, and let be the average degree. The distance between and is the length of the shortest path222We omit when it is clear from the context. between and in . An estimation of is an -stretch if .
In their seminal work, Thorup and Zwick [36] presented a data structure for distance approximations called a distance oracle. A distance oracle is a data structure with space (otherwise we can trivially store the distance matrix), that supports distance queries between vertices. For any integer , they [36] showed that in expected time, it is possible to preprocess a weighted undirected graph and create a distance oracle of size . For every the query of the distance oracle returns a -stretch for in time. Different aspects of distance oracles, such as construction time, query time, and stretch, have been studied since their introduction, more than two decades ago. For more details see for example [10, 29, 38, 18, 19, 23, 25, 26, 21, 4, 3, 12, 13, 15].
Thorup and Zwick [36] employed Erdős’ girth conjecture333The girth of a graph is the length of its shortest cycle. to establish a lower bound on the space/stretch tradeoff for distance oracles. The conjecture asserts the existence of graphs with edges and girth . Under this assumption, they proved that any distance oracle with stretch must use bits on some input, for all . However, these lower bounds apply to graphs with edges.
This motivates studying the -stretch/-space tradeoff in sparser graphs, where . 444We remark that a distance oracle in such graphs must use space, because of similar arguments to the lower bound of [36]. This approach has been applied in two different stretch regimes. Distance oracles with stretch (see, for example, [7, 6, 9, 33, 5, 25]) and distance oracles with stretch (see, for example, [6, 8, 21, 28, 31]).
1.1 Distance oracles with stretch
Our main result for stretch establishes a three-way tradeoff among the key parameters of distance oracles: stretch, space, and query time. This new tradeoff improves upon previously known results for specific values of stretch, space, and query time. We prove the following:
Theorem 1.
Let and let be an integer. There is an space distance oracle that given two query vertices computes in -time a distance estimation that satisfies . The distance oracle is constructed in expected time.
An interesting tradeoff that follows from Theorem 1 is a better space/stretch tradeoff than the classical Thorup and Zwick [36] -stretch / space tradeoff, at a cost of a larger query time. Specifically, by setting , we get a -stretch distance oracle that uses space, at the price of query time. By setting in Theorem 1, we improve upon a recent result of Dalirrooyfard, Jin, V. Williams, and Wein [22]. They presented a -stretch distance oracle that uses space and query time.555We remark that even more recently, Chechik, Hoch, and Lifshitz [20] presented a -stretch -PSP algorithm, however, they did not present a new distance oracle. We improve the stretch from to while using the same space and query time.
To obtain Theorem 1, we develop a new technique called the borderline vertices technique. Given , the borderline vertices and are two vertices on the shortest path between and that satisfy special properties that allow us to better exploit the structure of the Thorup and Zwick distance oracle. Using the borderline vertices technique, we also manage to achieve the following distance oracle, which improves upon the construction time of Theorem 1 at the cost of increasing the stretch.
Theorem 2.
Let and let be an integer. There is an space distance oracle that given two query vertices computes in -time a distance estimation that satisfies . The distance oracle is constructed in expected time.
Agarwal, Godfrey, and Har-Peled [9] considered also small stretches, and presented a -stretch distance oracle that uses space and has query time, that is constructed in time, and a -stretch distance oracle that uses space and has query time, and is constructed in time. These results suggest that the following general stretch/space/query time tradeoff may exist for every .
Problem 1.
For which values of it is possible to construct a -stretch distance oracle that uses space and has query time.
Agarwal, Godfrey, and Har-Peled [9] solved Problem 1 for . By setting in Theorem 2 and Theorem 1, respectively, we obtain a -stretch distance oracle that uses space and has query time, and a -stretch distance oracle that uses space and has query time. Thus, we solve Problem 1 for .
In addition, using the borderline vertices technique we obtain -stretch distance oracle that uses space, has query time, and is constructed in time. For this improves the construction time of [9] for a -stretch distance oracle from to . Our results for weighted graphs are summarized in Table 2.
Next, we turn our focus to unweighted graphs. An estimation of is an -approximation if . -approximations were extensively studied in the context of distance oracles, graph spanners, and emulators. (For more details see for example [24, 37, 11, 17, 16, 30, 1, 2, 9, 7, 13]).
From the girth conjecture, it follows that in unweighted graphs, for every -distance oracle that uses space, it must hold that . However, this inequality must hold only for adjacent vertices. For non-adjacent vertex pairs, we prove the following simple lower bound.
Theorem 3.
Assuming the Erdős girth conjecture, any distance oracle that uses space must have an input graph and two vertices such that and .
A spanner is a subgraph that approximates distances without supporting distance queries. Baswana, Kavitha, Mehlhorn, and Pettie [11] and Parter [30] presented a -spanner for every such that , and matched the lower bound of Theorem 3 for spanners. An interesting question is whether this lower bound can be matched by distance oracles with efficient distance queries as well. Thus, we formulate the following problem.
Problem 2.
For which values of it is possible to construct a distance oracle with space that uses query time, such that , for every that satisfy .
Agarwal, Godfrey, and Har-Peled [9] presented for unweighted graphs a -approximation distance oracle that uses space, has query time, and is constructed in time. They also presented a -approximation distance oracle that uses space, has query time, that is constructed in time.
By analyzing more carefully the -approximation distance oracle of [9] it is possible to show that it is actually a -approximation666 is defined as , where is distance oracle, and therefore solves Problem 2 for .777In their work, the additive error comes from the fact that if then . However, this can be improved by showing that if then . In the following two theorems, we show that it is possible to solve Problem 2 for and as well.
Theorem 4.
There is a space distance oracle that given two query vertices computes in -time a distance estimation that satisfies . The distance oracle is constructed in expected time.
Theorem 5.
There is a space distance oracle that given two query vertices computes in -time a distance estimation that satisfies . The distance oracle is constructed in expected time.
In Theorem 4 we improve the distance oracle of [9] from more than a decade ago. In particular we improve the construction time from to , and the approximation from to . Dalirrooyfard, Jin, V. Williams, and Wein [22] presented a -stretch distance oracle that uses space and query time. By setting in the -stretch distance oracle of [22] they obtain a -stretch distance oracle. In Theorem 5 we improve the approximation from to while maintaining the same space and query time.
To obtain our new distance oracles for unweighted graphs, presented in Theorem 4 and Theorem 5, we develop a new technique for using the middle vertex in the path, called the middle vertex technique. Let , the middle vertex is a vertex on the shortest path between and that satisfies and . As with the borderline vertices technique for sparse weighted graphs, the middle vertex technique enables us to better exploit the structure of the distance oracles of Thorup and Zwick in dense unweighted graphs.
By combining the middle vertex technique with the borderline vertices technique, we manage to achieve two more distance oracles for dense unweighted graphs. The first distance oracle improves the approximation of the distance oracle of Theorem 5 from to at the cost of increasing the query time to .
Theorem 6.
There is a space distance oracle that given two query vertices computes in -time a distance estimation that satisfies . The distance oracle is constructed in expected time.
The second distance oracle improves the -approximation of [22] to -approximation, while using the same space and query time.
Theorem 7.
Let . There is an space distance oracle that given two query vertices computes in -time a distance estimation that satisfies . The distance oracle is constructed in expected time.
Our results for unweighted graphs are summarized in Table 1.
1.2 Distance oracles with stretch
For distance oracles with stretch in weighted graphs, we present the following new three-way tradeoff between: stretch, space, and query time. We prove:
Theorem 8.
Let be a real constant. There is a -space distance oracle that given two query vertices computes in -time a distance estimation that satisfies . The distance oracle is constructed in time.
Using this tradeoff, we obtain the first distance oracle with stretch , sublinear query time, and space, for . In particular, by setting and , we obtain a -stretch distance oracle with -space and -query time. For comparison, Agarwal [6] presented a distance oracle with stretch , using space and query time. Setting and in the construction of [6] yields a -stretch oracle with -space and -query time. (See Table 2.)
For unweighted graphs, we present two new tradeoffs. The first improves upon the tradeoff of the distance oracle of Bilò, Chechik, Choudhary, Cohen, Friedrich, and Schirneck [13], while preserving the same space and query time. Specifically, they presented a distance oracle for unweighted graphs that uses space, has query time, and returns an estimate . In the following theorem, we slightly improve the stretch bound to , while using the same space and query time.
Theorem 9.
Let be an integer and let be a real constant. There is a -space distance oracle that given two query vertices computes in -time a distance estimation that satisfies . The distance oracle is constructed in time.
Next, by adapting methods of Theorem 8 to unweighted graphs, we obtain another tradeoff that uses less space than the tradeoff of Theorem 9 at the cost of a larger query time. We prove:
Theorem 10.
Let . Let be a real constant. There is a -space distance oracle that given two query vertices computes in -time a distance estimation that satisfies . The distance oracle is constructed in time.
In particular, using Theorem 10 we obtain the first distance oracle with -space, for , that achieves a multiplicative error strictly better than . Specifically, by setting and , we get a distance oracle with space and query time. These results are summarized in Table 1.
1.3 Applications for -PSP and
Recently, Dalirrooyfard, Jin, V. Williams, and Wein [22] (followed by Chechik, Hoch and Lifshitz [20]) studied two fundamental problems in graphs, the -pairs shortest paths (-PSP) problem and the all-nodes shortest cycles () problem. The -PSP problem is defined as follows. Given a set of vertex pairs , for , compute the distance . The problem is defined as follows. Compute the length of the shortest simple cycle that contains , for every .
A straightforward approach for solving the -PSP problem is to first construct a distance oracle and then query it for every pair in the input set. The total runtime of this approach is the sum of the construction time and times the query time of the distance oracle. While this method naturally yields an -PSP algorithm, a distance oracle must satisfy additional requirements that an -PSP algorithm does not. In particular, a distance oracle must use limited space and support queries between any of the pairs of vertices.
Using our new distance oracles, we obtain improved time/stretch tradeoffs for both the -PSP problem and the -problem, improving some of the results of [22, 20].
In [22], a lower bound based on the combinatorial clique hypothesis for the -PSP problem is presented. They showed that time is required to achieve stretch. As mentioned in [22] using the -distance oracle of [6] it is possible to solve -PSP with -stretch in time, which almost matches the lower bound of [22]. In this paper, we show that it is possible to significantly improve the running time of [6] and to bypass the lower bound of [22] at the cost of a small additive error (of up to ). We obtain an time algorithm that returns , as presented in the following theorem.
Theorem 11.
Let . Given an unweighted graph and vertex pairs for , there is an algorithm for that computes an estimation such that in time.
In [22] they presented an time -PSP algorithm that returns -stretch. In the following theorem we improve the stretch from to while using the same running time.
Theorem 12.
Let . Given a weighted graph and vertex pairs for , there is an algorithm for that computes an estimation such that in time.
For the problem, [22] presented an running time algorithm that for every returns estimate such that , where is the length of the shortest simple cycle that contains . In the following theorem, we improve the running time from of [22] to .
Theorem 13.
Given an undirected unweighted graph , let be a positive integer. There is a randomized algorithm for that computes for every an estimation such that in -time.
In addition, we present the first, to the best of our knowledge, stretch algorithm for the problem in weighted graphs. Specifically, we present an time algorithm for weighted graphs that for every returns an estimate such that , as presented in the following theorem.
Theorem 14.
Given an undirected weighted graph , let be a positive integer. There is a randomized algorithm for that computes for every an estimation such that in -time.
Our results for the problem are summarized in Table 4.
The rest of this paper is organized as follows. In the next section, we present some necessary preliminaries. In Section 3 we present a technical overview of our main techniques and some of our new distance oracles. In the full version [27] of the paper, we present the full proofs of our techniques, distance oracles, applications, and lower bound.
2 Preliminaries
In this section, we present several definitions and existing tools that we use to develop our new techniques and ideas which we then apply in order to obtain new distance oracles. Let be an undirected graph with vertices and edges. Throughout the paper, we consider both unweighted graphs and weighted graphs with non-negative real edge weights.
Let . The distance between and is the length of a shortest path between and . Let be the shortest path between and . Let be the vertices that are neighbors of and let be the degree of . Let . Let be the vertices that are neighbors of some vertex , i.e, . The distance between and is the distance between and the closest vertex to from , that is, . Let (ties are broken in favor of the vertex with a smaller identifier).
Next, we define bunches and clusters as in [36]. Let and let . Let be the bunch of with respect to and . Let be the cluster of with respect to .
The starting point in many algorithms and data structures for distance approximation, and in particular in Thorup and Zwick[36]’s distance oracles, is a hierarchy of vertex sets , where , and for , and . For every , let and let . Using this hierarchy, Thorup and Zwick defined bunches for every vertex as follows: For every , the bunch is defined as . They also defined a cluster for every vertex as follows: . Throughout the paper when we save , for every and (or , for every ), we mean that we can check whether (or ) in constant time and if (or ) we can retrieve in constant time as well.
The simplest instance of this hierarchy is when and the hierarchy is composed of the sets , where , , and . Throughout this paper, in such a case, we will omit subscripts and will refer to simply as . Moreover, since in this case and , for every , we use to denote and to denote and since we have only and , where is , we use to denote and to denote .
Thorup and Zwick [36] construct the sets , by adding to , where , every vertex of , independently at random with probability . Constructing the sets in such a way allows Thorup and Zwick [36] to prove the following:
Lemma 15 ([36]).
Given an integer parameter , we can compute in time sets , such that for every with high probability, and for every the size of is , with high probability (w.h.p). The cost of computing , for every , is expected time.
Lemma 16 ([35]).
Given a parameter , we can compute a set of size in expected time such that, , for every vertex , and for every .
Next, we present procedure Intersection. The input to Intersection is two vertices and two sets , such that, and . For every and every , we assume that distance estimations and are known. The output of Intersection is , if and , otherwise. (See Algorithm 1.) In most of our uses of Intersection we have and . When this is not the case, we explicitly describe and its relation to .
The following lemma regarding the running time of Intersection is straightforward.
Lemma 17.
runs in .
Proof.
Assume, without loss of generality (wlog), that . By checking for every vertex in time whether we compute . For each vertex , we compute in time the value . Thus, the total running time is , as required.
The following property of is the main feature of Intersection, and will be used throughout the paper.
Property 17.
Let . If , and there exists such that and then returns .
Let TZQuery be the query of the distance oracle presented by Thorup and Zwick [36]. We let be . Pseudocode for TZQuery exists in Algorithm 2.
The following lemma appears explicitly in [36] regarding the correctness and running time of MTZQuery.
Lemma 18 ([36]).
The running time of MTZQuery is and it holds that
The next lemma follows from [36], and we prove it here for completeness.
Lemma 19.
Let be . For every integer , one of the following holds.
Proof.
Wlog, assume that . We divide the proof into two cases. The case that and the case that . Consider the case that . In this case the value of is saved in the distance oracle. From the triangle inequality it follows that . Therefore, we have that . Since we get that , as required.
Consider now the case that . From the definition of it follows that . Since , we get that , and thus , as required. The following property follows by applying Lemma 19 inductively.
Property 19.
Let be an integer, and let . Then either:
We remark that all our distance oracles return an estimation that is the length of a path in and therefore .
3 Technical overview
In the classic distance oracle of Thorup and Zwick [36], it is possible to bound with , for every . The key to improving the -stretch of the distance oracle lies in tightening the bound on . Previous work (see, for example, [9, 32, 5, 8, 6]) improved the bound on from to by exploiting the following structural property of : if , then .
In this paper, we develop two new techniques that exploit structural properties of to construct a distance oracle with improved stretch guarantees. These techniques enable us to bound not only by , but also by , thereby improving overall stretch. We begin by presenting the borderline vertices technique, which applies to both weighted and unweighted graphs.
3.1 The borderline vertices technique
Let be an augmented cluster.
Roughly speaking, using the borderline vertices technique we show that if then
.
In particular, by setting we get an improvement over the result of [9], showing not only that but also that .
Let be a shortest path between and . The borderline vertex of in is the farthest vertex from in . Similarly, the borderline vertex of in is the farthest vertex from in . Obviously, a distance oracle cannot store for every shortest path , as this would require space. We overcome this limitation by using query time to iterate over all vertices in the augmented cluster , and in particular .
To obtain our improved bound on , we analyze two different cases regarding . The case that and the case that . If , then the query algorithm can return as an estimation , where is . In this case, since (as it is the farthest vertex from in ) we get that , and therefore .
Otherwise, if then . Since we get that , as wanted. (See Figure 1). Using symmetric arguments for , we can also get that .
In unweighted graphs, we can avoid the factor from the query time at the cost of bounding and by rather than . The difference is that we let be defined as the farthest vertex from in (unlike which considers ). Next, we provide an overview of our main three-way tradeoff that uses the borderline vertices technique.
3.2 -stretch distance oracle
Let be an integer, let , such that . The storage of the distance oracle saves: the graph , , for every and for every . Where .
The query works as follows.
First, we set to
. Then, we iterate over every (to iterate over ), and update be . Similarly, for every we update to .
Finally, the algorithm returns .
It is straightforward to see that the space is and that the query takes time. The main technical contribution is in proving that . To prove it, we use the borderline vertices technique. Since that , when the algorithm iterates over , there is an iteration in which . In this iteration we guarantee that . Since is a borderline vertex, we either have that , and the estimation guarantee holds, or that . Similarly, since and we iterate over , there is an iteration in which . In this iteration, either a short path is found (), or we have that .
From the properties of MTZQuery, for every , either a short path is found or . Since and , it follows that
In the query procedure, we have that . Thus:
as required.
3.3 The middle vertex technique
For unweighted graphs, we develop the middle vertex technique that allows us to bound either or by , improving the previous bound from [22]. Roughly speaking, using the middle vertex technique technique we show that if then . The middle vertex technique requires query time, matching the query time of the unweighted borderline technique. However, by using the middle vertex technique we reduce the additive error from to in the bound of .
For the sake of simplicity, let be a vertex hierarchy, where , and let be even. Let be the middle vertex on . That is, ( is an integer since is even). The middle vertex has the following useful property. If then . The problem is that is unknown. However, the case that is equivalent to the case that . We use the query time to compute for every the value of . Therefore, even without knowing , in this case we have that . (See Figure 2(a).)
If then and . If , we exploit, again, the query time to compute for every the value . Therefore, even without knowing the query algorithm returns . (See Figure 2(b).) If then without loss of generality and therefore . (See Figure 2(c).)
Our distance oracles for unweighted graphs use the middle vertex technique. When combined with the unweighted borderline vertices technique, this enables the construction of two additional oracles.
3.4 Distance oracles with stretch
Let be a set of size , let , let and let . Let be an integer. Let , where . Let be a distance function induced by (for the exact definition of . Let (resp. ). For every , let (resp. ) be the farthest vertex in from (resp. ). (See Figure 3 for an illustration.) Let . By the definition of we have that . We prove the following two properties:
Next, we overview the distance oracle that uses these properties. The distance oracles stores the graph and , for every , at the cost of space. In the query of the distance oracle, we compute and . To address the case that we compute for every in time the value . In such a case, from the first property we have , for some .
To address the case that we compute for every . Let be the vertex with minimal value. Using the bound , we can show that and get that .
Next, we reduce the space from to by saving , for every instead of saving , for every .
This information prevents us from using paths of the form . We can still use paths of the form . However, since we do not know the vertices and we need to consider all vertex pairs in . This increases the query time from to . To avoid query time, we show that it suffices to consider only vertex pairs in , where in -time, and still get the same approximation without iterating over all vertex pairs in .
We define the set . Let be the vertex pair with minimal value. We prove that . While iterating over the pairs of , we encounter , and get that . Thus, with space and query time we get an estimation . By setting and we get two new distance oracles, one with space and query, and estimation , and another with space and query, and estimation .
We also consider weighted graphs with non-negative real edge weights. Agarwal, Godfrey and Har-Peled [7] defined to be . We revise the definition of to be . This new definition allows us to extend the previous results to weighted graphs. The distance oracles obtained using this approach are presented in the full version[27].
We remark that the usage of the sets and in the query algorithm is similar to the usage of the graph in the work of [14]. However, in our analysis of the unweighted case, we achieve a slightly better distance approximation. In addition, we introduce a new approach to obtain a distance estimation using two vertices from that are close to rather than a single vertex from , as in [14].
References
- [1] Amir Abboud and Greg Bodwin. The 4/3 additive spanner exponent is tight. J. ACM, 64(4):28:1–28:20, 2017. doi:10.1145/3088511.
- [2] Amir Abboud, Greg Bodwin, and Seth Pettie. A hierarchy of lower bounds for sublinear additive spanners. SIAM J. Comput., 47(6):2203–2236, 2018. doi:10.1137/16M1105815.
- [3] Amir Abboud, Karl Bringmann, and Nick Fischer. Stronger 3-sum lower bounds for approximate distance oracles via additive combinatorics. In Barna Saha and Rocco A. Servedio, editors, Proceedings of the 55th Annual ACM Symposium on Theory of Computing, STOC 2023, Orlando, FL, USA, June 20-23, 2023, pages 391–404. ACM, 2023. doi:10.1145/3564246.3585240.
- [4] Amir Abboud, Karl Bringmann, Seri Khoury, and Or Zamir. Hardness of approximation in p via short cycle removal: cycle detection, distance oracles, and beyond. In Stefano Leonardi and Anupam Gupta, editors, STOC ’22: 54th Annual ACM SIGACT Symposium on Theory of Computing, Rome, Italy, June 20 - 24, 2022, pages 1487–1500. ACM, 2022. doi:10.1145/3519935.3520066.
- [5] Ittai Abraham and Cyril Gavoille. On approximate distance labels and routing schemes with affine stretch. In David Peleg, editor, Distributed Computing - 25th International Symposium, DISC 2011, Rome, Italy, September 20-22, 2011. Proceedings, volume 6950 of Lecture Notes in Computer Science, pages 404–415. Springer, 2011. doi:10.1007/978-3-642-24100-0_39.
- [6] Rachit Agarwal. The space-stretch-time tradeoff in distance oracles. In Andreas S. Schulz and Dorothea Wagner, editors, Algorithms - ESA 2014 - 22th Annual European Symposium, Wroclaw, Poland, September 8-10, 2014. Proceedings, volume 8737 of Lecture Notes in Computer Science, pages 49–60. Springer, 2014. doi:10.1007/978-3-662-44777-2_5.
- [7] Rachit Agarwal, Brighten Godfrey, and Sariel Har-Peled. Faster approximate distance queries and compact routing in sparse graphs. CoRR, abs/1201.2703, 2012. arXiv:1201.2703.
- [8] Rachit Agarwal and Philip Brighten Godfrey. Distance oracles for stretch less than 2. In Sanjeev Khanna, editor, Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2013, New Orleans, Louisiana, USA, January 6-8, 2013, pages 526–538. SIAM, 2013. doi:10.1137/1.9781611973105.38.
- [9] Rachit Agarwal, Philip Brighten Godfrey, and Sariel Har-Peled. Approximate distance queries and compact routing in sparse graphs. In INFOCOM 2011. 30th IEEE International Conference on Computer Communications, Joint Conference of the IEEE Computer and Communications Societies, 10-15 April 2011, Shanghai, China, pages 1754–1762. IEEE, 2011. doi:10.1109/INFCOM.2011.5934973.
- [10] Surender Baswana and Telikepalli Kavitha. Faster algorithms for all-pairs approximate shortest paths in undirected graphs. SIAM J. Comput., 39(7):2865–2896, 2010. doi:10.1137/080737174.
- [11] Surender Baswana, Telikepalli Kavitha, Kurt Mehlhorn, and Seth Pettie. Additive spanners and (alpha, beta)-spanners. ACM Trans. Algorithms, 7(1):5:1–5:26, 2010. doi:10.1145/1868237.1868242.
- [12] Davide Bilò, Shiri Chechik, Keerti Choudhary, Sarel Cohen, Tobias Friedrich, Simon Krogmann, and Martin Schirneck. Approximate distance sensitivity oracles in subquadratic space. In Barna Saha and Rocco A. Servedio, editors, Proceedings of the 55th Annual ACM Symposium on Theory of Computing, STOC 2023, Orlando, FL, USA, June 20-23, 2023, pages 1396–1409. ACM, 2023. doi:10.1145/3564246.3585251.
- [13] Davide Bilò, Shiri Chechik, Keerti Choudhary, Sarel Cohen, Tobias Friedrich, and Martin Schirneck. Improved approximate distance oracles: Bypassing the thorup-zwick bound in dense graphs. CoRR, abs/2307.11677, 2023. doi:10.48550/arXiv.2307.11677.
- [14] Davide Bilò, Shiri Chechik, Keerti Choudhary, Sarel Cohen, Tobias Friedrich, and Martin Schirneck. Improved approximate distance oracles: Bypassing the thorup-zwick bound in dense graphs. arXiv preprint arXiv:2307.11677, 2023. doi:10.48550/arXiv.2307.11677.
- [15] Davide Bilò, Shiri Chechik, Keerti Choudhary, Sarel Cohen, Tobias Friedrich, and Martin Schirneck. Improved distance (sensitivity) oracles with subquadratic space. In 2024 IEEE 65th Annual Symposium on Foundations of Computer Science (FOCS), pages 1550–1558. IEEE, 2024. doi:10.1109/FOCS61266.2024.00097.
- [16] Greg Bodwin and Virginia Vassilevska Williams. Better distance preservers and additive spanners. ACM Trans. Algorithms, 17(4), October 2021. doi:10.1145/3490147.
- [17] Shiri Chechik. New additive spanners. In Sanjeev Khanna, editor, Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2013, New Orleans, Louisiana, USA, January 6-8, 2013, pages 498–512. SIAM, 2013. doi:10.1137/1.9781611973105.36.
- [18] Shiri Chechik. Approximate distance oracles with constant query time. In David B. Shmoys, editor, Symposium on Theory of Computing, STOC 2014, New York, NY, USA, May 31 - June 03, 2014, pages 654–663. ACM, 2014. doi:10.1145/2591796.2591801.
- [19] Shiri Chechik. Approximate distance oracles with improved bounds. In Rocco A. Servedio and Ronitt Rubinfeld, editors, Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015, pages 1–10. ACM, 2015. doi:10.1145/2746539.2746562.
- [20] Shiri Chechik, Itay Hoch, and Gur Lifshitz. New approximation algorithms and reductions for n-pairs shortest paths and all-nodes shortest cycles. In Yossi Azar and Debmalya Panigrahi, editors, Proceedings of the 2025 Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2025, New Orleans, LA, USA, January 12-15, 2025, pages 5207–5238. SIAM, 2025. doi:10.1137/1.9781611978322.177.
- [21] Shiri Chechik and Tianyi Zhang. Path-reporting distance oracles with logarithmic stretch and linear size. In Karl Bringmann, Martin Grohe, Gabriele Puppis, and Ola Svensson, editors, 51st International Colloquium on Automata, Languages, and Programming, ICALP 2024, July 8-12, 2024, Tallinn, Estonia, volume 297 of LIPIcs, pages 42:1–42:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.ICALP.2024.42.
- [22] Mina Dalirrooyfard, Ce Jin, Virginia Vassilevska Williams, and Nicole Wein. Approximation algorithms and hardness for n-pairs shortest paths and all-nodes shortest cycles. In 63rd IEEE Annual Symposium on Foundations of Computer Science, FOCS 2022, Denver, CO, USA, October 31 - November 3, 2022, pages 290–300. IEEE, 2022. doi:10.1109/FOCS54457.2022.00034.
- [23] Michael Elkin, Ofer Neiman, and Christian Wulff-Nilsen. Space-efficient path-reporting approximate distance oracles. Theor. Comput. Sci., 651:1–10, 2016. doi:10.1016/J.TCS.2016.07.038.
- [24] Michael Elkin and David Peleg. (1+epsilon, beta)-spanner constructions for general graphs. SIAM J. Comput., 33(3):608–631, 2004. doi:10.1137/S0097539701393384.
- [25] Michael Elkin and Seth Pettie. A linear-size logarithmic stretch path-reporting distance oracle for general graphs. ACM Trans. Algorithms, 12(4):50:1–50:31, 2016. doi:10.1145/2888397.
- [26] Michael Elkin and Idan Shabat. Path-reporting distance oracles with logarithmic stretch and size o(n log log n). In 64th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2023, Santa Cruz, CA, USA, November 6-9, 2023, pages 2278–2311. IEEE, 2023. doi:10.1109/FOCS57990.2023.00141.
- [27] Avi Kadria and Liam Roditty. New approximate distance oracles and their applications. arXiv preprint arXiv:2509.00890, 2025.
- [28] Tsvi Kopelowitz, Ariel Korin, and Liam Roditty. On the space usage of approximate distance oracles with sub-2 stretch. In Karl Bringmann, Martin Grohe, Gabriele Puppis, and Ola Svensson, editors, 51st International Colloquium on Automata, Languages, and Programming, ICALP 2024, July 8-12, 2024, Tallinn, Estonia, volume 297 of LIPIcs, pages 101:1–101:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.ICALP.2024.101.
- [29] Manor Mendel and Assaf Naor. Ramsey partitions and proximity data structures. In 47th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2006), 21-24 October 2006, Berkeley, California, USA, Proceedings, pages 109–118. IEEE Computer Society, 2006. doi:10.1109/FOCS.2006.65.
- [30] Merav Parter. Bypassing erdős’ girth conjecture: Hybrid stretch and sourcewise spanners. In Javier Esparza, Pierre Fraigniaud, Thore Husfeldt, and Elias Koutsoupias, editors, Automata, Languages, and Programming - 41st International Colloquium, ICALP 2014, Copenhagen, Denmark, July 8-11, 2014, Proceedings, Part II, volume 8573 of Lecture Notes in Computer Science, pages 608–619. Springer, 2014. doi:10.1007/978-3-662-43951-7_49.
- [31] Ely Porat and Liam Roditty. Preprocess, set, query! Algorithmica, 67(4):516–528, 2013. doi:10.1007/S00453-013-9825-9.
- [32] Mihai Pǎtraşcu and Liam Roditty. Distance oracles beyond the thorup-zwick bound. SIAM J. Comput., 43(1):300–311, 2014. doi:10.1137/11084128X.
- [33] Mihai Pǎtraşcu, Liam Roditty, and Mikkel Thorup. A new infinity of distance oracles for sparse graphs. In 53rd Annual IEEE Symposium on Foundations of Computer Science, FOCS 2012, New Brunswick, NJ, USA, October 20-23, 2012, pages 738–747. IEEE Computer Society, 2012. doi:10.1109/FOCS.2012.44.
- [34] Liam Roditty, Mikkel Thorup, and Uri Zwick. Deterministic constructions of approximate distance oracles and spanners. In Luís Caires, Giuseppe F. Italiano, Luís Monteiro, Catuscia Palamidessi, and Moti Yung, editors, Automata, Languages and Programming, 32nd International Colloquium, ICALP 2005, Lisbon, Portugal, July 11-15, 2005, Proceedings, volume 3580 of Lecture Notes in Computer Science, pages 261–272. Springer, 2005. doi:10.1007/11523468_22.
- [35] Mikkel Thorup and Uri Zwick. Compact routing schemes. In Arnold L. Rosenberg, editor, Proceedings of the Thirteenth Annual ACM Symposium on Parallel Algorithms and Architectures, SPAA 2001, Heraklion, Crete Island, Greece, July 4-6, 2001, pages 1–10. ACM, 2001. doi:10.1145/378580.378581.
- [36] Mikkel Thorup and Uri Zwick. Approximate distance oracles. J. ACM, 52(1):1–24, 2005. doi:10.1145/1044731.1044732.
- [37] Mikkel Thorup and Uri Zwick. Spanners and emulators with sublinear distance errors. In Proceedings of the Seventeenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2006, Miami, Florida, USA, January 22-26, 2006, pages 802–809. ACM Press, 2006. URL: http://dl.acm.org/citation.cfm?id=1109557.1109645.
- [38] Christian Wulff-Nilsen. Approximate distance oracles with improved preprocessing time. In Yuval Rabani, editor, Proceedings of the Twenty-Third Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2012, Kyoto, Japan, January 17-19, 2012, pages 202–208. SIAM, 2012. doi:10.1137/1.9781611973099.18.
Appendix A Tables of our distance oracles
A.1 Weighted graphs with stretch
A.2 -PSP and results
| Time | Approximation | Ref. | Comment |
| [22] | Unweighted, | ||
| Theorem 12 | |||
| [22] | |||
| [6]888This result is obtained by constructing the distance oracle of Agarwal [6] and querying it times. | |||
| Theorem 11 | Unweighted, |
| Time | Approximation | Ref. | Comment |
| [22] | Unweighted, | ||
| Theorem 13 | Unweighted, | ||
| Theorem 14 | Weighted, |
