Almost Shortest Paths with Near-Additive Error in Weighted Graphs
Michael Elkin, Yuval Gitlitz, Ofer Neiman

TL;DR
This paper introduces new algorithms for almost shortest paths in weighted graphs that achieve near-additive error bounds with improved efficiency in both centralized and parallel models, depending on local maximum edge weights.
Contribution
It presents a novel centralized and parallel algorithm for ASP with near-additive error depending on local max edge weight, extending prior work with improved bounds and new constructions.
Findings
Centralized algorithm runs in $O((m+ ns)n^ ho)$ time.
PRAM algorithm has polylogarithmic depth and similar work complexity.
Provides additive approximations for all pairs shortest paths with error depending on local maximum edge weight.
Abstract
Let be a weighted undirected graph with vertices and edges, and fix a set of sources . We study the problem of computing {\em almost shortest paths} (ASP) for all pairs in in both classical centralized and parallel (PRAM) models of computation. Consider the regime of multiplicative approximation of , for an arbitrarily small constant . In this regime existing centralized algorithms require time, where is the matrix multiplication exponent. Existing PRAM algorithms with polylogarithmic depth (aka time) require work . Our centralized algorithm has running time , and its PRAM counterpart has polylogarithmic depth and work , for an arbitrarily small constant . For a pair $(s,v) \inβ¦
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Almost Shortest Paths with Near-Additive Error in Weighted Graphs
Michael Elkin
Department of Computer Science, Ben-Gurion University of the Negev, Beer-Sheva, Israel. Email: {elkinm,neimano}@cs.bgu.ac.il, [email protected]
Yuval Gitlitz
Department of Computer Science, Ben-Gurion University of the Negev, Beer-Sheva, Israel. Email: {elkinm,neimano}@cs.bgu.ac.il, [email protected]
Ofer Neiman
Department of Computer Science, Ben-Gurion University of the Negev, Beer-Sheva, Israel. Email: {elkinm,neimano}@cs.bgu.ac.il, [email protected]
Abstract
Let be a weighted undirected graph with vertices and edges, and fix a set of sources . We study the problem of computing almost shortest paths (ASP) for all pairs in in both classical centralized and parallel (PRAM) models of computation. Consider the regime of multiplicative approximation of , for an arbitrarily small constant (henceforth -ASP for ). In this regime existing centralized algorithms require time, where is the matrix multiplication exponent. Existing PRAM algorithms with polylogarithmic depth (aka time) require work .
In a bold attempt to achieve centralized time close to the lower bound of , Cohen [Coh00] devised an algorithm which, in addition to the multiplicative stretch of , allows also additive error of , where is the maximum edge weight in (assuming that the minimum edge weight is 1), and is polylogarithmic in . It also depends on the (possibly) arbitrarily small parameter that determines the running time of the algorithm.
The tradeoff of [Coh00] was improved in [Elk01], whose algorithm has similar approximation guarantee and running time, but its is . However, the latter algorithm produces distance estimates rather than actual approximate shortest paths. Also, the additive terms in [Coh00, Elk01] depend linearly on a possibly quite large global maximum edge weight .
In the current paper we significantly improve this state of affairs. Our centralized algorithm has running time , and its PRAM counterpart has polylogarithmic depth and work , for an arbitrarily small constant . For a pair , it provides a path of length that satisfies , where is the weight of the heaviest edge on some shortest path. Hence our additive term depends linearly on a local maximum edge weight, as opposed to the global maximum edge weight in [Coh00, Elk01]. Finally, our , i.e., it is significantly smaller than in [Coh00, Elk01].
We also extend a centralized algorithm of Dor et al. [DHZ00]. For a parameter , this algorithm provides for unweighted graphs a purely additive approximation of for all pairs shortest paths (APASP) in time . Within the same running time, our algorithm for weighted graphs provides a purely additive error of , for every vertex pair , with defined as above.
On the way to these results we devise a suite of novel constructions of spanners, emulators and hopsets.
1 Introduction
We study the problem of computing almost shortest paths from a set of designated vertices, called sources, to all other vertices in an -vertex -edge weighted undirected graph , with non-negative edge weights. We aim at approximation guarantee of the form , meaning that for every pair , our algorithm will return a path of length (called distance estimate) that satisfies
[TABLE]
where is the weight of the heaviest edge on some shortest path in (If there are multiple shortest paths, pick the one with minimal ).
Here is an arbitrarily small positive constant, and is typically a large constant that depends on , and on the running time of the algorithm.111In the introduction we will mostly suppress the dependence on . It can however be found in the technical part of the paper. We call this problem -ASP for .
The problem of computing approximate shortest paths is one of the most central, fundamental and well-researched problems in Graph Algorithms. We study this problem in both the classical centralized and in the parallel (PRAM CRCW) models of computation. Next, we overview the main previous results for this problem in these two settings, and describe our new results. We start with the centralized model, and then turn our attention to the PRAM model.
1.1 Centralized Setting
The classical algorithm of Dijkstra for the exact single-source shortest path (SSSP) problem provides running time of [FT87]. Thorup [Tho97] devised an algorithm with running time for the case when all edge weights are integer. Using this algorithm separately from each of the sources results in running time of at least .
On the opposite end of the spectrum, one can compute -APASP (All Pair Approximate Shortest Paths) using matrix multiplication in time [GM97, AGM97, Zwi02], where is the matrix multiplication exponent [CW90, Wil12, Gal14]. There are also a number of combinatorial (i.e., not exploiting fast matrix multiplication) APASP algorithms. In particular, Cohen and Zwick [CZ01] showed that 3-APASP can be computed in time. (They also provided a few additional algorithms with approximation ratio between 2 and 3 and running time greater than .) Baswana and Kavitha [BK06] improved their approximation guarantee to (with the same running time of ), and with defined as in (1).
Finally, Cohen [Coh00] devised an algorithm that for an arbitrarily small parameter , solves -ASP for in time222The running time of the algorithm of [Coh00], as well as of the algorithm of [Elk01] and of our algorithm, is actually slightly better than . Specifically, it is roughly . We use the simpler expression of to simplify presentation. More precise and general bounds can be found in the technical part of the paper., with . Here is the maximum edge weight in the entire graph (assuming the minimum edge weight is 1).
This result was improved by Elkin [Elk01]. The algorithm of Elkin [Elk01] also solves -ASP for in time, with . This algorithm reports distance estimates, rather than actual paths.333There is a variant of the algorithm of [Elk01] which reports actual paths, but requires time . This running time is typically prohibitively large as it depends linearly on .
The running time of [Coh00, Elk01] is close (up to , for an arbitrarily small constant ) to the lower bound of . This is unlike other aforementioned algorithms, whose running time is much larger, i.e., . However, the algorithms of [Coh00, Elk01] suffer from a number of drawbacks. First, their additive term is linear in the maximum edge weight . Second, the coefficient in them is quite large, even for a relatively large values of the parameter . Third, as was mentioned above, the algorithm of [Elk01] returns distance estimates, as opposed to actual paths that implement these estimates, and in the algorithm of [Coh00] the coefficient of the additive term is super-constant (specifically, polylogarithmic in ).
In the current paper we address these issues, and devise an algorithm for -ASP for with running time , for an arbitrarily small parameter , with . This algorithm does report paths, rather than just distance estimates. Note also that the additive term grows linearly with the local maximum edge weight, i.e., with the weight of heaviest edge on each particular source-destination shortest path, as opposed to the global maximum edge weight . Finally, its coefficient is significantly smaller than , though it is admittedly still quite large444We are able to further decrease to , at the expense of increasing the multiplicative stretch from to .. (The coefficient of [Coh00] depends polylogarithmically on , while the coefficient in [Elk01] and here are independent of .)
We also extend an algorithm of Dor et al. [DHZ00] to weighted graphs. Specifically, the algorithm of [DHZ00] works for unweighted undirected graphs. For any parameter , it provides an additive -APASP in time. Our extension applies to weighted undirected graphs. It computes additive -approximation for all pairs shortest paths within the same time , i.e., for any vertex pair , it produces a path of length at most , where is as in (1).
Note that the linear dependence of additive error on is unavoidable, as an algorithm with stretch can be translated into an algorithm with the same running time and with a purely multiplicative stretch of .
1.2 Parallel Setting
In the PRAM model, multiple processors are connected to a single memory block, and the operations are performed in parallel by these processors. We will mostly be concerned with the Concurrent Read Concurrent Write (CRCW) PRAM model, that allows multiple processors to access any memory cell at any given round. The running time is measured by the number of rounds, and the work by the number of processors multiplied by the number of rounds.
Early algorithms for these problems [UY91, KS93, SS99, Spe97] require parallel time. Algorithms of [GM97, AGM97, Zwi02], that were discussed in Section 1.1, can also be applied in PRAM. They provide -APASP in polylogarithmic time and work. The algorithm of Cohen [Coh00], for a parameter , solves -ASP for in polylogarithmic time and work .
This tradeoff was then improved in [EN19b, EN19c], where the running time is , and the work is the same as in [Coh00]. Further spectacular progress was recently achieved by [Li20, ASZ20], who devised -SSSP algorithms with time and work . Nevertheless, for -ASP problem from the set of sources, one needs to run these algorithms in parallel from all the sources. As a result, their work complexity becomes .
To summarize, all existing solutions for the problem with polylogarithmic time have work complexity . We devise the first algorithm with polylogarithmic time and work complexity , for an arbitrarily small constant . In other words, our work complexity is within , for an arbitrarily small constant , close to the lower bound of . On the other hand, unlike algorithms of [Zwi02, Coh00, EN19b, EN19c, Li20, ASZ20], whose approximation guarantee is a purely multiplicative , for an arbitrarily small , our approximation guarantee is , with , and as in (1).
Moreover, our result can, in fact, be viewed as a PRAM distance oracle. Specifically, following the preprocessing that requires time and work , our algorithm stores a compact data structure of size . Given a query vertex , this data structure provides distance estimates for all , which satisfies (1) in constant time and using work , where . Note that the distance oracle has size arbitrarily close to linear in , its preprocessing time is polylogarithmic and preprocessing work is arbitrarily close to linear in , and the query time is constant and the query work is arbitrarily close to linear in . (Note that as the query provides distance estimates for vertex pairs , its query work complexity must be .)
1.3 Hopsets, Spanners and Emulators
From the technical viewpoint, these results are achieved via a combination of our new constructions of emulators, spanners and hopsets. For parameters , we say that a graph is an -hopset for a (weighted) graph , if by adding to the graph, every pair has an -approximate shortest path consisting of at most hops; Formally,
[TABLE]
where is the shortest path in containing at most edges. The parameter is called the stretch, and is the hopbound.
We say that is an -emulator if for every ,
[TABLE]
and is a spanner if it is an emulator and a subgraph of .
Hopsets and near-additive spanners are fundamental combinatorial constructs, and play a major role in efficient approximation of shortest paths in various computational models. These objects have been extensively investigated in recent years [EP04, Elk04, TZ06, EZ06, Pet09, Pet10, BKMP10, EN19a, KS97, Coh00, Ber09, Nan14, HKN14, MPVX15, HKN16, FL16, EN19b, ABP17, EN19c, HP19]. The main interest is to understand the triple tradeoff between the size of the hopset (respectively, spanner), to the stretch , and to the hopbound (resp., additive stretch) . For algorithmic applications, it is also crucial to bound the construction time of the hopset/spanner/emulator.
We show near-additive spanners for weighted graphs, where the additive stretch for the pair may depend also on the largest edge weight on the corresponding shortest path from to , . For a parameter , we devise an algorithm that constructs a -spanner of size with . We also show how to analyze the construction so that it yields smaller additive stretch, while increasing the multiplicative one. Specifically, we get a -spanner of same size as above, for every constant , and with . Our emulators have a somewhat improved . All of our results admit near-linear time algorithms, i.e., their running time is , for an arbitrarily small constant .
1.4 Technical Overview
We adapt the constructions of [TZ06, Pet09, EN19a, EN19c, HP19] of hopsets, spanners and emulators so that they are suitable for weighted graphs, and provide an improved additive stretch (or hopbound) . The basic idea in all these constructions is to generate a random hierarchy of vertex sets , where for each , each element in is included in with probability (one should think of ). We also refer to vertices at as vertices at level . For each , the pivot is the closest vertex in to . Then the set of edges is created by connecting, for every , every vertex to its bunch: all other vertices in that are closer to it than . One difference in our construction is that we also connect each vertex to all its (at most ) pivots. The main technical innovation in this work is the new analysis of this construction, yielding various hopsets, emulators and spanners that apply for weighted graphs, and admit improved parameters. (Previous constructions of spanners and emulators [EP04, TZ06, Pet09, EN19a, HP19] applied only for unweighted graphs.)
The previous analysis of the stretch for some pair goes roughly as follows. Divide the path into intervals, and try to connect these intervals using low stretch paths in (and for hopsets, also some of the graph edges, but with few hops). Each interval can either have a low stretch path; or fail, in which case that interval admits a nearby pivot (of some level ). Then, consider two failed intervals (the leftmost and rightmost ones), and try to find an path via the pivots of these intervals.
We note that this partitioning of the path to equal size intervals (used in previous works), cannot work directly for weighted graphs, since it may not be possible to divide the path to intervals of equal (or even near-equal) size. We provide a subtle adaptation of this technique so that it can handle weights. In particular, we distinguish between short and long distances: The sufficiently long distances may suffer a partition to un-equal intervals, as the induced error is dominated by the multiplicative stretch of . For the short distances, we stop this partitioning when it becomes too βexpensiveβ, and resort to an argument similar to the one in [TZ01], which has large multiplicative stretch (of roughly ). However, at the point where we stop, that stretch can be accounted for by the additive stretch .
An additional ingredient in our new analysis of as an emulator/spanner for weighted graphs, given a pair , is to iteratively find a vertex on the shortest path (sufficiently far from ) that admits in a path with low multiplicative stretch from . When there is no such , we show that we can reach with small additive stretch. This technique can be used to obtain the improved dependence of on the parameter .
Recall that emulators are insufficient for reporting paths. In particular, the approach of [Coh00, Elk01] was based on emulators, rather than on spanners, and it is not clear if these algorithms can be adapted to build spanners (for weighted graphs). On the other hand, with our approach we can convert our constructions of emulators into constructions of spanners. Specifically, to build a spanner, we must use graph edges. So in order to connect vertices to the vertices in their bunch , we need to add paths of possibly many edges in the graph (rather than a single edge, as for emulators/hopsets). To do this we connect every vertex to all vertices in its half-bunch (see Section 4 for its definition), as opposed to connecting it to all vertices in its full bunch. (The latter is the case in the construction of emulators.) This turns out to be sufficient to ensure that the union of all these paths does not contain too many edges. For this analysis we employ ideas of counting pairwise path intersections, developed in the context of distance preservers [CE05] and near-additive spanners and distance oracles for unweighted graphs [Pet09, EP15]. We simplify this approach, and extend it to weighted graphs.
1.5 Organization
In Section 2 we describe the construction of our emulators and hopsets. In Section 3 we analyze this construction, showing it provides emulators for weighted graphs. In Section 4 we describe the construction of our spanners for weighted graphs (proofs are deferred to Appendix D) and use them for our centralized algorithms for the ASP problem. In Section 5 we provide efficient implementations of our constructions, and use them in Section 6 for solving ASP in PRAM, and for PRAM distance oracles.
Our hopsets and emulators with improved appear in Appendices A and B. In Appendix LABEL:sec:dhz we devise an algorithm for pure additive APASP for weighted graphs.
1.5.1 Bibliographical note
Related results about -spanners for unweighted graphs and -hopsets with were achieved independently of us and simultaneously by [BP20]. In another submission [EN22] , an -ASP algorithm for with , for some . was devised. The running time of this algorithm in the centralized setting is , where is the rectangular matrix multiplication exponent. ( is the time required to multiply an matrix by an one.) In PRAM setting that algorithm runs in polylogarithmic time and work. For graphs and sets of sources of size such that , the algorithms that we devise in the current submission are more efficient than in [EN22].
Following our work, [ABS*+*20] devised algorithms for purely additive spanners (e.g., spanners with multiplicative stretch exactly 1) for weighted graphs. In their results, the additive term depends on the global maximal edge weight , and the size of their spanners is always (the latter is unavoidable for purely additive spanners, due to a lower bound of [AB17]).
2 Construction
We use a similar construction to that of [TZ06, EN19c, HP19]. One difference is that every vertex connects to pivots in all levels. (Recall that the main difference is in the analysis.) Let be a weighted graph with vertices, and fix an integer parameter . Let . Let be sets of vertices such that , , and for , is created by sampling independently every element from with probability . For every , the expected size of is:
[TABLE]
For every , define the pivot to be the closest vertex in to , breaking ties by lexicographic order. For every define the bunch (see FigureΒ 1)
[TABLE]
That is, the bunch contains all the vertices which are in and closer to than , and at most pivots. We then define , where the weight of the edge is set as the weight of the shortest path between in .
Lemma 1**.**
The size of is
[TABLE]
The proof of Lemma 1 is similar to previous works, we include it for completeness in appendix C.
3 Near-Additive Emulators for Weighted Graph
In this section we will show that as defined in Section 2 is a -emulator for weighted graphs. Note that the construction there does not depend on , and indeed, will be an emulator for all values of simultaneously (with depending on ).
Let be a weighted graph with non-negative weights , recall that for we have (where is a shortest path from to in ). Let and be given parameters (think of ). We begin by proving two lemmas, handling long and short distances, respectively. The first lemma asserts that pairs which are sufficiently far apart admit either a low stretch path, or a nearby pivot of a higher level.
Lemma 2**.**
Fix . Let and let such that . Then at least one of the following holds:
** 2. 2.
**
(For , the first item must hold since doesnβt exist).
Proof.
Denote . The proof is by induction on . For the base case , if then and the first item holds. Otherwise, if then , so the second item holds. The last case is that and , then by (2) we have , thus the second item holds. Assume the lemma holds for and prove for . Let be a pair of vertices such that
Divide the shortest path between and into segments of length at least and at most . It can be done as follows: define and walk on the shortest path from to . Define as the first vertex which or define if . Increase by 1 and repeat. Note that each segment has length at most . Finally, we join the last two segments. The length of the last segment is at most . The length of any segment except the last is also at most .
Apply the induction hypothesis for every segment with parameter . If for all the segments the first item holds, then first item holds for and , since
[TABLE]
Otherwise, for at least one segment the second item holds. Let (resp., ) be the leftmost (resp., rightmost) segment for which the second item holds. We have that the second item holds for the pair , and by symmetry of the first item, the second item also holds for the pair with parameter . Hence
[TABLE]
Consider first the case that . In this case contains the edge , so we have
[TABLE]
By the triangle inequality,
[TABLE]
Thus, the distance between and in ,
[TABLE]
therefore the first item holds.
The other case is that . Then
[TABLE]
We can bound the distance by
[TABLE]
Hence the second item holds. β
The previous lemma is useful for vertices which are very far from each other, since for the first item must hold. For vertices which are close to each other, we will need the following lemma.
Lemma 3**.**
Let and fix . Let
. Then at least one of the following holds:
** 2. 2.
* and *
(For , the first item must hold since doesnβt exist).
Proof.
If the first item holds, since
[TABLE]
If , then , in this case the second item holds, as
[TABLE]
The bound on is symmetric. β
We are now ready to prove the following theorem.
Theorem 1**.**
For any weighted graph on vertices, and any integer , there exists of size at most , which is a -emulator for any , where .
Proof.
Fix . Let , and . If , we can apply Lemma 2 for and . Since does not exist, the first item must hold. Thus,
[TABLE]
Otherwise, take the integer satisfying (note that there must be such an , since ). Apply Lemma 2 for and . If the first item holds, we will get stretch as before.
Otherwise, the second item holds, and we know that (using that ). By symmetry of in the first item of Lemma 2, we have as well. Set and apply Lemma 3 with , noting that . If the first item holds, we found a path in from to of length at most .
If the second item holds, we increase by one and apply Lemma 3 again. We continue this procedure until the first item holds. The fact that the second item holds implies that the bound (the maximal distance of to the level pivots) increases every iteration by a factor of at most 4. Since the first item must hold for , the path we found is of length at most , which is maximized for . Hence the additive stretch is at most , as required. β
Remark 1**.**
We note that the analysis did not use the fact that the path from to is a shortest path. In particular, for every path from to of length , we can obtain a path in of length at most , where is the largest edge weight in .
4 Near-Additive Spanners for Weighted Graphs
In this section we devise our spanners for weighted graphs. We first describe the new construction, that differs from that of Section 2 in several aspects, which are required in order to keep the size of the spanner under control (and independent of ). In particular, since we add paths, rather than edges, between each vertex to other vertices in its bunch, we need to ensure the size of is small enough. To do that, we use half-bunches rather than bunches to define (see (8) below), and show that there are few intersections between the aforementioned paths (see Lemma 6). One last ingredient is altering the sampling probabilities, so that the argument on intersection goes through. This approach refines and improves ideas from [Pet09, EP15].
Construction.
Let be a weighted graph with vertices, and fix an integer parameter . Let . Let be sets of vertices such that , , and for , is created by sampling every element from with probability . For every , the expected size of is:
[TABLE]
For every , define the pivot to be the closest vertex in to , breaking ties by lexicographic order. For every define the half bunch
[TABLE]
Let , where is the shortest path between in (if there is more than one, break ties consistently, by vertex id, say).
Theorem 2**.**
For any weighted graph on vertices, and any integer , there exists of size at most , which is a -spanner for any , with .
Theorem 3**.**
For any weighted graph on vertices, and any integer , there exists of size at most , which is a -spanner for any with .
Full proofs for both theorems are given in appendix D.
5 Efficient Implementation
Since we use very similar constructions to the ones in [EN19c], we can use their efficient implementations (connecting to all pivots, which is the difference between constructions, can be done efficiently in their framework as well). We consider here the standard model of computation, and the PRAM (CRCW) model. Given a parameter , we will want poly-logarithmic parallel time and work / centralized time. This is achieved by adding additional sets , that are sampled with uniform probability , which in turn increases the exponent of by an additive . (In the case of multiplicative stretch , it also increases the base of the exponent in .)
We summarize the efficient implementation results for hopsets and emulators in the following theorem.
Theorem 4**.**
For any weighted graph on vertices, parameters and , there is a randomized algorithm running in time , that w.h.p. computes of size at most , such that for any this is:
A -emulator with . 2. 2.
A -emulator with . 3. 3.
A -hopset with .
Given in advance, the algorithm can also be implemented in the PRAM (CRCW) model, in parallel time and work , while increasing the size of by a factor of .
For spanners, recall that in Section 4 we have a somewhat different construction, and in the analysis we enforce a stricter requirement on the sampling probabilities . To handle this, we start sampling with the uniform probability only when (and not when like before). Now the bound of Claim 7 still holds, as even for these latter sets. The βpriceβ we pay for waiting until is that the work will now be . Rescaling by 3, we get the following.
Theorem 5**.**
For any weighted graph on vertices, parameters and , there is a randomized algorithm running in time , that w.h.p. computes of size at most , such that for any this is:
A -spanner with . 2. 2.
A -spanner with .
Given in advance, the algorithm can also be implemented in the PRAM (CRCW) model, in parallel time and work , while increasing the size of by a factor of .
6 Almost Shortest Paths in Weighted Graphs
Given a weighted graph with vertices and a set of sources, fix parameters , and . Here we show that our hopsets, emulators and spanners can be used for a -approximate shortest paths for pairs in , in various settings.
For the standard centralized setting, we first compute a -spanner of size with , in time as in Theorem 5. Next, for every run Dijkstraβs shortest path algorithm in , which takes time .
The total running time for computing -approximate shortest path for all , is . One may choose and obtain the following.
Theorem 6**.**
For any weighted graph on vertices, a set of sources, and parameters and , there is a randomized algorithm running in time , that computes -approximate shortest paths for all pairs in , where .
We remark that there is a more general tradeoff by choosing as a free parameter. In addition, if one desires improved additive stretch, simply use the -spanner with .
6.1 PRAM Shortest Paths and Distance Oracles
Given a weighted graph with vertices, fix parameters , and . The first step in both settings (computing approximate shortest paths and distance oracles) is the same. We construct a -emulator of size with , in parallel time and work as in TheoremΒ 4. Next, compute a -hopset size for with the same within the same parallel time and work [EN19c].555We remark that even though the emulator and hopset have exactly the same construction, we run the hopset algorithm on and not on , thus we get a different set of edges. We store both and .
Approximate Shortest Paths.
For the sake of simplicity we will choose . Given a set of sources, for each source run rounds of the Bellman-Ford algorithm in the graph starting at . In each round of Bellman-Ford, every vertex sends its neighbors the current distance estimate to that it has, and they update their distance estimate if needed. Since is a sparse graph with edges, with processors one can implement each iteration in PRAM (CRCW) in time (see [EN19c] for more details). As we have only rounds, the total parallel time for all the Bellman-Ford rounds from all vertices in is , and the total work is .
As the error of the emulator is , and the hopset has only multiplicative stretch, the total error is only . We thus have the following result.
Theorem 7**.**
For any weighted graph on vertices, a set of sources, and parameters and , there is a PRAM randomized algorithm running in parallel time and using work, that computes -approximate shortest paths for all pairs in , where .
As above, we can get a more general tradeoff with the parameter , and improve the additive stretch by using the hopsets and emulators from Sections A,B, albeit the multiplicative stretch will increase.
Distance Oracles.
Recall that we store the emulator and a hopset for . Whenever a query arrives, we run rounds of Bellman-Ford algorithm in the graph . As noted above, each round of Bellman-Ford can be implemented in PRAM (CRCW) in time using processors. So the total parallel time for the query is . Rescaling , we get a -approximation. We conclude that the properties of the distance oracle we devise are:
- β’
Has size .
- β’
Given query , can report -approximation to all distances in , with .
- β’
Has query time and work.
- β’
The preprocessing time is and work .
Appendix A A -Hopset
Here we show that the set of Section 2 serves as a -hopset, for all simultaneously, with .
Denote by the length of the shortest path between in that contains at most edges. The following lemma bounds the number of hops and the stretch of the constructed hopset:
Lemma 4**.**
Fix any and any . Then for every , at least one of the following holds:
** 2. 2.
**
Proof.
The proof is by induction on . For the base case , if , then the edge was added to the hopset and the first item holds. If not, it means that . Because every vertex is connected by a direct edge to all its pivots, the second item holds (since the coefficient of the right hand side is between 3 and 12 for ).
Assume the claim holds for , and we will prove it holds for . Partition the shortest path between and into segments each of length at most , and at most edges between consecutive segments. We can use the following: setting , and for each , set as the vertex in the shortest path between and which is farthest from , but still . If , set as the vertex which follows in the shortest path between and . Otherwise set . This partition satisfies our requirement because for every , (otherwise, we could have chosen as ).
Next, apply the induction hypothesis for all the pairs with parameter . If for all the pairs the first item holds, we can show that the first item holds for with parameter . Consider the path from to which uses the guaranteed path in of the first item for all the pairs , and the edges . The number of hops in this path is bounded by . The length of the path is bounded by (using the induction hypothesis on each pair):
[TABLE]
Otherwise, there exist at least one segment for which the first item doesnβt hold. Let be the smallest index so that only the second item holds for the pair . By the induction hypothesis
[TABLE]
Since we added the edges , to the hopset , by the triangle inequality,
[TABLE]
If the edge exists in , its length can be bounded by
[TABLE]
Thus, the distance between and using 3 hops is
[TABLE]
therefore the first item holds.
If , then we know that . We can bound the distance using the triangle inequality:
[TABLE]
Thus the second item holds.
β
We conclude by summarizing the main result of this section.
Theorem 8**.**
For any weighted graph on vertices, and any , there exists of size at most , which is a -hopset for any , with .
Proof.
Let . Apply lemma 4 for with and . Since , the first item must hold:
[TABLE]
β
Remark 2**.**
Note that at its lowest, the hopbound is , achieved with stretch 15.
Appendix B A -Emulator
In this section we show that the same constructed in SectionΒ 2 can also serve as a emulator for weighted graphs, for all values of simultaneously.
Let be a weighted graph and let and be given parameters (think of ). Fix a pair . Define and for any integer , let . We can easily verify that
[TABLE]
Lemma 5**.**
Let and let such that and . Define . Then at least one of the following holds:
. 2. 2.
.
Proof.
The proof is by induction on . For the base case , if , the first item holds. Otherwise , thus the second item holds.
Assume the claim holds for and prove for . By the triangle inequality:
[TABLE]
If , we have
[TABLE]
Thus, the distance between and is
[TABLE]
therefore the first item holds.
If , then we know that
[TABLE]
We can bound the distance as follows.
[TABLE]
Hence the second item holds. β
We are now ready to state the result of this section.
Theorem 9**.**
For any weighted graph on vertices, and any , there exists of size at most , which is a -emulator for any with .
Proof.
Let . Recall that is the shortest path between and in , and fix . Initialize . Let be the farthest vertex from in satisfying . Note the requirement holds since . Apply lemma 5 on and . If the second item holds, we increase by one, update to be the last vertex in satisfying , and apply the lemma again for and (since the second item held for , we have that indeed holds).
Consider now the index such that the first item holds (we must find such an index, since at there is no pivot in level ). If it is the case that then since , it must be that , as otherwise we could have taken a further away (recall that every edge on this path has weight at most ). Therefore and we found a path in from to with stretch at most . Next we update , and repeat the same procedure all over again.
The last remaining case is that we found an index such that the first item holds but . Note that in such a case it must be that . The path in we have from to is of length at most . As and , we have that
[TABLE]
which is our additive stretch .
β
Appendix C Full proof of lemma 1
If we order the vertices in by their distance to , it is easy to see that the number of vertices which are in and closer than is bounded by a random variable sampled from a geometric distribution with parameter . Hence . For , since doesnβt exist, contains all the vertices in . The number of vertices in is a random variable sampled from binomial Distribution with parameters . Hence, the expected number of edges added by bunches of vertices in is
[TABLE]
Hence, the total expected number of edges in is:
[TABLE]
Appendix D Proofs of theorems 2,3
D.1 Size analysis
Recall the construction of described in Section 4. Define the bunch as in (2). The following lemma will be useful to bound the size of the spanner .
Lemma 6**.**
Fix . Let be such that and , and , then all four points are in , or all four are in .
Proof.
Assume w.l.o.g. that is not shorter than . Let be a point in the intersection of the two shortest paths, then
[TABLE]
so . The calculation showing is essentially the same. β
Define the shortest path between two vertices consistently, s.t. each subpath is also a shortest path. Therefore two shortest paths can have at most one common subpath.
Fix , and consider the graph containing all the shortest paths with and . We claim that the number of edges in is at most , where is the number of pairwise intersections between these shortest paths. This is because vertices participating in at most 1 path have degree at most 2, and each intersection increases the degree of one vertex by at most 2 (recall that shortest paths can meet at most once).
Claim 7**.**
.
Proof.
By Lemma 6 each intersecting pair of paths and we have that all four points belong to the same bunch. Thus, each can introduce at most pairwise intersecting paths. Recall that is a random variable distributed geometrically with parameter , so
[TABLE]
Thus the expected number of intersections at level is at most
[TABLE]
It remains to bound path intersections in the last level . Recall that
[TABLE]
Since the random choices for each point are independent, we have by Chernoff bound that , so with very high probability the last set contains points. It means that we have paths connecting these points, and even if they all intersect, they can yield at most intersections. β
It remains to bound the number of edges to pivots. For every , is the closest vertex to in breaking ties by id. Therefore all the vertices in share the same pivot at level . Thus we add at most one edge for each vertex at every level, and edges overall.
We conclude that the size of is at most (we can slightly change the probabilities by introducing a factor of to obtain size , as we did before.
D.2 Proof of theorem 2
We use the corresponding analysis of the emulator from Section 3. The use of half-bunches instead of bunches creates the following version of Lemma 2.
Lemma 8**.**
Fix . Let and let such that . Then at least one of the following holds:
** 2. 2.
**
The main difference in the proof is in (7), which is replaced by
[TABLE]
The new bounds in the Lemma guarantee the calculations still go through. For Lemma 3 which takes care of small distances, we have the following change, with a very similar proof.
Lemma 9**.**
Let and fix . Let
. Then at least one of the following holds:
** 2. 2.
**
In the proof we set . The rest of the calculations follow analogously, one change is that when iteratively applying Lemma 9, the bound increases by a factor of 7 (rather than 4, as in Lemma 3), but as is still true, it does not change anything.
D.3 Proof of theorem 3
The stretch analysis is very similar to that of the emulator from Section B, the main difference is in the use of half-bunches rather than the full ones, but this will increase the distance to pivots by a factor of 2, and affect the additive stretch only. We follow the analysis and notation presented in Section B, but with . We replace Lemma 5 with the following.
Lemma 10**.**
Let and let such that and . Define . Then at least one of the following holds:
. 2. 2.
.
The main difference in the proof is in (15), which is replaced by
[TABLE]
since we use half-bunches. One can then follow the calculations in the proof of Lemma 5, and check that the altered constants used in the 2 cases above suffice.
The proof of Theorem 3 is the same as the proof of Theorem 9, the only differences are taking (which affects the value of ) and using the bounds of Lemma 10 rather than of Lemma 5.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[AB 17] Amir Abboud and Greg Bodwin. The 4/3 additive spanner exponent is tight. J. ACM , 64(4):28:1β28:20, 2017.
- 2[ABP 17] Amir Abboud, Greg Bodwin, and Seth Pettie. A hierarchy of lower bounds for sublinear additive spanners. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, Barcelona, Spain, Hotel Porta Fira, January 16-19 , pages 568β576, 2017.
- 3[ABS + 20] Reyan Ahmed, Greg Bodwin, Faryad Darabi Sahneh, Stephen Kobourov, and Richard Spence. Weighted additive spanners, 2020.
- 4[AGM 97] Noga Alon, Zvi Galil, and Oded Margalit. On the exponent of the all pairs shortest path problem. J. Comput. Syst. Sci. , 54(2):255β262, 1997.
- 5[ASZ 20] Alexandr Andoni, Clifford Stein, and Peilin Zhong. Parallel approximate undirected shortest paths via low hop emulators. In Konstantin Makarychev, Yury Makarychev, Madhur Tulsiani, Gautam Kamath, and Julia Chuzhoy, editors, Proccedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, STOC 2020, Chicago, IL, USA, June 22-26, 2020 , pages 322β335. ACM, 2020.
- 6[Ber 09] Aaron Bernstein. Fully dynamic (2 + epsilon) approximate all-pairs shortest paths with fast query and close to linear update time. In 50th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2009, October 25-27, 2009, Atlanta, Georgia, USA , pages 693β702, 2009.
- 7[BK 06] Surender Baswana and Telikepalli Kavitha. Faster algorithms for approximate distance oracles and all-pairs small stretch paths. In FOCS , pages 591β602, 2006.
- 8[BKMP 10] Surender Baswana, Telikepalli Kavitha, Kurt Mehlhorn, and Seth Pettie. Additive spanners and (alpha, beta)-spanners. ACM Transactions on Algorithms , 7(1):5, 2010.
