Improved Weighted Additive Spanners
IImproved Weighted Additive Spanners
Michael Elkin , Yuval Gitlitz , and Ofer Neiman Department of Computer Science, Ben-Gurion University of the Negev, Beer-Sheva, Israel.Email: { elkinm,neimano } @cs.bgu.ac.il , [email protected] August 25, 2020
Abstract
Graph spanners and emulators are sparse structures that approximately preserve distancesof the original graph. While there has been an extensive amount of work on additive spanners,so far little attention was given to weighted graphs. Only very recently [EGN19, ABS + O ( n / )(resp., O ( n / )) to the weighted setting, where the additive error is +2 W (resp., +4 W ). Thismeans that for every pair u, v , the additive stretch is at most +2 W u,v , where W u,v is the maximaledge weight on the shortest u − v path (weights are normalized so that the minimum edge weightis 1). In addition, [ABS +
20] showed a randomized algorithm yielding a +8 W max spanner of size O ( n / ), here W max is the maximum edge weight in the entire graph.In this work we improve the latter result by devising a simple deterministic algorithm for a+(6 + ε ) W spanner for weighted graphs with size O ( n / ) (for any constant ε > O ( n / ) for unweighted graphs. We also show a simplerandomized algorithm for a +4 W emulator of size ˜ O ( n / ). Let G = ( V, E, w ) be a weighted undirected graph on n vertices. Denote by d G ( u, v ) the distancebetween u, v ∈ V in the graph G . A graph H = ( V, E (cid:48) , w ) is an ( α, β ) -spanner of G if it is asubgraph of G and for every u, v ∈ V , d H ( u, v ) ≤ α · d G ( u, v ) + β. For an emulator H , we drop the subgraph requirement (that is, we allow H to have edges that arenot present in G , while still maintaining d H ( u, v ) ≥ d G ( u, v ) for all u, v ∈ V ).Spanners were introduced in the 80’s by [PS89], and have been extensively studied ever since.One of the key objectives in this field is to understand the tradeoff between the stretch of aspanner and its size (number of edges). For purely multiplicative spanners (with β = 0), an answerwas quickly given: for any integer k ≥
1, [ADD +
93] showed that a greedy algorithm provides a(2 k − , O ( n /k ). This bound is tight assuming Erd˝os’ girth conjecture.In this paper we focus on purely additive spanners, where α = 1, which we denote by + β spanners. Almost all of the previous work on purely additive spanners was done for unweightedgraphs. The first purely additive spanner was a +2 spanner of size O ( n . ) [ACIM99, EP04], which1 a r X i v : . [ c s . D S ] A ug as followed by a +6 spanner of size O ( n / ) [BKMP05, Knu14], and a +4 spanner of size O ( n / )[Che13, Bod20]. A result of [AB17] showed that any purely additive spanner with O ( n / − δ ) edges,for constant δ >
0, must have a polynomial stretch β .In [EP04] the notion of near-additive spanners for unweighted graphs was introduced, where α = 1 + ε for some small ε >
0. They showed (1 + ε, β )-spanners of size O ( β · n /k ) with β = O ( log kε ) log k . Many following works [Elk01, EZ06, TZ06, Pet09, ABP17, EN19] improvedseveral aspects of these spanners, but up to the β factor in the size, this is still the state-of-the-art. Providing some evidence to its tightness, [ABP17] showed that such spanners must have β = Ω( ε · log k ) log k .Since many applications of spanners stem from weighted graphs (see [ABS +
20] and the refer-ences therein), it is only natural to study additive spanners in that setting. Assume the weights arenormalized so that the minimum edge weight is 1. We distinguish between two types of additivespanners; in the first one the additive stretch is + c · W max , where W max is the weight of heaviestedge in the graph, and c is usually some constant. A more desirable type of additive stretch isdenoted by + c · W , which means that for every u, v ∈ V , d H ( u, v ) ≤ d G ( u, v ) + c · W u,v , where W u,v is the heaviest edge in the shortest path between u, v in G . This estimation is not onlystronger, but also handles nicely the multiplicative perspective of the spanner: a + c · W spanner isalso a ( c +1 ,
0) spanner (while a + W max approximation can have unbounded multiplicative stretch).The first adaptation of (near)-additive spanners to the weighted setting was given in [EGN19],where we showed near-additive spanners and emulators with essentially the same stretch and sizeas the state-of-the-art results for unweighted graphs, while β is multiplied by W (the maximal edgeweight on the corresponding path). In addition, a construction of an additive +2 W spanner of size˜ O ( n / ) can be inferred from [EGN19]. Ahmad et al. [ABS +
20] recently gave a comprehensivestudy of weighted additive spanners. Among other results, they showed a +2 W max spanner of size O ( n . ), a +4 W spanner of size O ( n / ), and a +8 W max spanner of size O ( n / ). While the formertwo results match the state-of-the-art unweighted bounds, the third leaves room for improvement.Indeed, [ABS +
20] pose as an open problem whether a +6 W max spanner of size O ( n / ) can beachieved. Our results.
In this work we improve the bounds of [ABS +
20] both quantitatively and qualita-tively. For any constant ε >
0, we show a simple deterministic construction of a +(6 + ε ) W spannerof size O ( n / ). Thus, the additive stretch of our spanner is arbitrarily close to 6 W , while havingthe superior dependence on the largest edge weight on the shortest u − v path, rather than theglobal maximum weight. Furthermore, our algorithm is a simple greedy algorithm, in contrast tothe more involved 2-stages randomized algorithm of [ABS + W emulator of size˜ O ( n / ). This corresponds to the +4 emulator of size O ( n / ) for unweighted graphs [ACIM99,EP04]. The notation ˜ O ( · ) hides polylogarithmic factors. In their paper the spanner is claimed to be +4 W max but a tighter analysis shows it is actually a +4 W . For arbitrary ε >
0, the size of our spanner is O ( n / /ε ). verview of our construction and analysis. We adapt the algorithm of [Knu14], who showeda simple +6 spanner for unweighted graphs, to the weighted setting. Both [Knu14] and the path-buying construction of [BKMP05] iteratively add paths to the spanner H , and argue that for eachnew edge in a path that is added to H , there is some progress for many pairs of vertices. Specifically,assume that for some u, v ∈ V we have for a constant c that d H ( u, v ) ≤ d G ( u, v ) + c , (1)where H is the current spanner we maintain. For unweighted graphs, if we make progress andimprove the distance in H between u, v , it will be by at least 1. Thus, once we obtain (1), thedistance between u, v can be improved at most c more times. This nice attribute does not applyto weighted graphs, since there the distance between u, v can be improved only by a tiny amount.In our algorithm, we first add the n / lightest edges incident on every vertex, and then greedilyadd shortest paths between vertices whose stretch is too large, ordered by their W . To overcome theissue of tiny improvements, our notion of progress depends on the weights. That is, when addingpaths to the spanner, we will show that many pairs improve their distance by at least Ω( ε · W ).Note that W is in fact a function (the maximum edge weight in the current path), so some care isrequired to ensure sufficient progress is made for many other pairs (that can have either a smalleror a larger W ). Now, if the current distance in H between u, v ∈ V is d H ( u, v ) ≤ d G ( u, v ) + c · W, then the distance between u, v can be improved at most O ( cε ) more times. This number trans-lates directly to the size of the spanner, and also affects the stretch. Let G = ( V, E, w ) be a weighted undirected graph, with nonnegative weights w : E → R + thatare normalized so that the minimal edge weight is 1, and fix a parameter ε >
0. Denote by P u,v the shortest path between vertices u, v ∈ V , breaking ties consistently (say by id’s), so that everysub-path of a shortest path is also a shortest path. Let W u,v denote the weight of the heaviestedge in P u,v . For a positive integer t , a t -light initialization of G is a subgraph H = ( V, E (cid:48) , w ) thatcontains, for each u ∈ V , the lightest t edges incident on u (or all of them, if deg( u ) ≤ t ), breakingties arbitrarily. For u ∈ V , we say that v is a t -light neighbor of u if the edge { u, v } is contained ina t -light initialization of G .The following lemma was shown in [ABS +
20, Theorem 5].
Lemma 1 ([ABS + . Let G = ( V, E, w ) be an undirected weighted graph, and H a t -light initial-ization of G . If P u,v is some shortest path in G that is missing (cid:96) edges in H , then there is a set ofvertices S ⊆ V such that:1. | S | = Ω( t(cid:96) ) .2. Each vertex of S has a t -light neighbor in P u,v , with edge weight at most W u,v . (The fact that light edges are connecting S to P u,v did not appear explicitly in [ABS + A +(6 + ε ) W spanner Construction.
Our algorithm for a +(6 + ε ) W spanner works as follows. Initially, H is set as a n / -light initialization of G . Next, sort all the pairs u, v ∈ V : first according to W u,v , and then by d G ( u, v ) (from small to large), breaking ties arbitrarily. Then, go over all pairs in this order; whenconsidering u, v , we add P u,v to H if d H ( u, v ) > d G ( u, v ) + (6 + ε ) W u,v . (2) Analysis.
Our main technical lemma below asserts that by adding a shortest path to H , we getfor many pairs of the path’s neighbors: 1) a good initial guarantee, and also 2) sufficiently improvetheir distance in H .Figure 1: An illustration for Lemma 2. The dotted line is P u,v , and the edges { a, u } , { b, x } , { c, v } are all light. It is possible that u = x or v = x . Lemma 2.
Let u, v ∈ V be two vertices for which the path P u,v was added to H , and take any x ∈ P u,v . Let a, b, c ∈ V be different n / -light neighbors of u, x, v , respectively, with edge weightsat most W u,v . Denote by H the spanner just before P u,v was added and by H the spanner rightafter the path was added. Then both of the following holds.1. d H ( a, b ) ≤ d G ( a, b ) + 4 W u,v and d H ( b, c ) ≤ d G ( b, c ) + 4 W u,v .2. d H ( a, b ) ≤ d H ( a, b ) − ε W u,v or d H ( b, c ) ≤ d H ( b, c ) − ε W u,v .Proof. Fix P u,v and a, b, c as defined in the Lemma, see also Figure 1. We begin by proving the firstitem, using the triangle inequality and the fact that the three edges { a, u } , { b, x } , { c, v } all appearin H (since they are n / -light), and have weight at most W u,v . d H ( a, b ) ≤ d H ( a, u ) + d H ( u, x ) + d H ( x, b )= w ( a, u ) + d G ( u, x ) + w ( x, b ) (3) ≤ w ( a, u ) + d G ( u, a ) + d G ( a, b ) + d G ( b, x ) + w ( x, b ) ≤ d G ( a, b ) + 4 W u,v . The bound on d H ( b, c ) follows in a symmetric manner, which concludes the proof of the first item.Seeking contradiction, assume that the second item does not hold. This suggests that d H ( a, b ) < d H ( a, b ) + ε W u,v (3) ≤ d G ( u, x ) + (2 + ε W u,v , d H ( b, c ) < d H ( b, c ) + ε W u,v ≤ d G ( x, v ) + (2 + ε W u,v . So we have that d H ( u, v ) ≤ d H ( u, a ) + d H ( a, b ) + d H ( b, c ) + d H ( c, v ) ≤ w ( u, a ) + d G ( u, x ) + (2 + ε W u,v + d G ( x, v ) + (2 + ε W u,v + w ( c, v ) ≤ d G ( u, v ) + (6 + ε ) W u,v , which is a contradiction to (2), since we assumed that the path P u,v was added to the spanner. Theorem 1.
For every undirected weighted graph G = ( V, E, w ) and ε > , there exists a deter-ministic polynomial time algorithm that produces a +(6 + ε ) W spanner of size O ( ε · n / ) .Proof. Our construction algorithm adds a shortest path between pairs whose stretch is larger than+(6 + ε ) W , so we trivially get a +(6 + ε ) W spanner (the running time can be easily checked to bepolynomial in n ). Thus, we only need to bound the number of edges. Starting with the n / -lightinitialization introduces at most n / edges to the spanner, so it remains to bound the number ofedges added by adding the shortest paths.Let u, v ∈ V be two vertices for which the path P u,v was added to the spanner. Consider thetime in which this path was added, let H be the spanner just before the addition of P u,v , and H after the addition. We say that a pair of vertices a, b ∈ V is set-off at this time, if it is the firsttime that d H ( a, b ) ≤ d G ( a, b ) + 4 W u,v , and it is improved if d H ( a, b ) ≤ d H ( a, b ) − ε W u,v . Themain observation is that once a pair is set-off, it can be improved at most O ( ε ) times. To see this,note that after the set-off we have d H ( a, b ) − d G ( a, b ) ≤ W u,v , and recall that we ordered the pairsby their maximal weight W u,v , so any future improvement will be at least by ε W u,v . Since at theend we must have d H ( a, b ) ≥ d G ( a, b ), there can be at most O ( ε ) improvements.We will show that if (cid:96) edges of P u,v are missing in H , then at least Ω( (cid:96) · n / ) pairs are eitherset-off or improved. Fix any x ∈ P u,v , and let a, b, c ∈ V be different n / -neighbors of u, x, v ,respectively, connected by edges of weight at most W u,v . Apply Lemma 2 on u, v, x and a, b, c . Weget that both pairs ( a, b ) and ( b, c ) are set-off (if they haven’t before), and at least one of them isimproved.The final goal is to show that there are Ω( (cid:96) · n / ) such set-off/improving pairs. We first claimthat the first and last edges of P u,v are missing in H . Seeking contradiction, assume that the firstedge { u, u } ∈ E ( H ), then the pair u , v has W u ,v ≤ W u,v and d G ( u , v ) < d G ( u, v ) (using thatthe sub-path of P u,v from u to v is the shortest path between u , v ), and its stretch must be largerthan +(6 + ε ) W u,v (otherwise u, v will have stretch at most +(6 + ε ) W u,v as well), so we shouldhave considered the pair u , v before u, v , and added P u ,v to H . That would produce a shortestpath between u, v , which yields a contradiction to (2). A symmetric argument shows that the lastedge is missing too.Now, since H contains a n / -light initialization, but u (resp., v ) has a missing edge, it followsthat u (resp., v ) has at least n / neighbors that are all lighter than the missing first (resp., last)edge of P u,v , and thus of weight at most W u,v . So there are at least n / choices for a and for c . By Lemma 1 there are at least Ω( (cid:96) · n / ) choices for b . We conclude that there are at leastΩ( (cid:96) · n / · n / ) = Ω( (cid:96) · n / ) pairs that are set-off/improved.5et t be the number of edges added by all paths. Since every pair can be set-off only once, andimproved O ( ε ) times, we get the following inequalityΩ( t · n / ) ≤ O ( n ε ) , thus t = O ( n / ε ). +4 W emulator Construction
Our algorithm for a +4 W emulator works as follows. Start by letting H =( V, E (cid:48) , d G ) be a (2 n / ln n )-light initialization of G . Let S ⊆ V be a random set, created bysampling each vertex independently with probability n / . We finish by adding S × S to E (cid:48) (withweights corresponding to distances in G ). Analysis
We first note that, with high probability (w.h.p.), for every u ∈ V we either add all ofits neighbors to H as part of the initialization, or u has a light neighbor in S . This is proved inthe following standard lemma. Lemma 3.
W.h.p., for every vertex u having at least n / ln n neighbors in G , there exists y ∈ S s.t. y is a (2 n / ln n ) -light neighbor of u .Proof. Let U be the set of vertices with degree at least 2 n / ln n in G . Fix u ∈ U , and denote by X u the event that there exists y ∈ S which is a (2 n / ln n )-light neighbor of u . Every vertex issampled to S independently with probability n / , hencePr[ ¯ X u ] = (cid:18) − n / (cid:19) n / ln n ≤ (1 /e ) n = (1 /n ) . Let X be the event that for every u ∈ U , the event X u occur. By the union bound,Pr[ ¯ X ] ≤ (cid:88) u ∈ U Pr[ ¯ X u ] ≤ | U | /n ≤ /n. Theorem 2.
For every undirected weighted graph G = ( V, E, w ) , there exists a randomize algorithmthat produces w.h.p. a +4 W emulator of size O ( n / log n ) .Proof. We begin with the stretch analysis. Let u, v ∈ V . If all the edges of P u,v exists in H , then d H ( u, v ) = d G ( u, v ) and we are done.Otherwise, let u = x , x , . . . x k = v be the vertices of P u,v sorted by their distance from u . Let x i , x j be the first and last vertices for which { x i , x i +1 } , { x j − , x j } / ∈ E (cid:48) .We claim that each of x i , x j have at least 2 n / ln n neighbors in G , because { x i , x i +1 } , { x j − , x j } were not included in H as part of the light initialization. By Lemma 3, there exists a, b ∈ S whichare (2 n / ln n )-light neighbors of x i , x j respectively. In addition, x i +1 , x j − are not (2 n / ln n )-light By increasing the leading constant from 2 to c , we can reduce the failure probability to at most O ( n − c ). x i , x j , respectively, thus w ( x i , a ) ≤ w ( x i , x i +1 ) ≤ W u,v and w ( x j , b ) ≤ w ( x j − , x j ) ≤ W u,v .The sub-paths P u,x i , P x j ,v exist in H , and also all the edges { x i , a } , { a, b } , { b, x j } ∈ E (cid:48) . We canuse them for bounding d H ( u, v ) (see figure 2). d H ( u, v ) ≤ d H ( u, x i ) + d H ( x i , a ) + d H ( a, b ) + d H ( b, x j ) + d H ( x j , v )= d G ( u, x i ) + d G ( x i , a ) + d G ( a, b ) + d G ( b, x j ) + d G ( x j , v ) ≤ d G ( u, x i ) + d G ( x i , a ) + d G ( x i , a ) + d G ( x i , x j ) + d G ( b, x j ) + d G ( b, x j ) + d G ( x j , v ) ≤ d G ( u, v ) + 4 W u,v . Bounding the size is straightforward. The n / log n -light initialization introduces at most O ( n / log n ) edges, while | S | is a Bernoulli random variable with parameters ( n, n / ). Therefore, E [ | S | ] = n · n / = n / and by Chernoff bound | S | ≤ n / , w.h.p.. Thus | S × S | = O ( n / · n / ) = O ( n / ) w.h.p..Hence the total size of the emulator is O ( n / log n ) w.h.p..Figure 2: Straight lines are edges available in H . Curved lines are shortest paths available in H References [AB17] Amir Abboud and Greg Bodwin. The 4/3 additive spanner exponent is tight.
J. ACM ,64(4):28:1–28:20, 2017.[ABP17] Amir Abboud, Greg Bodwin, and Seth Pettie. A hierarchy of lower bounds for sublinearadditive spanners. In
Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposiumon Discrete Algorithms , SODA 17, page 568576, USA, 2017. Society for Industrial andApplied Mathematics.[ABS +
20] Abu Reyan Ahmed, Greg Bodwin, Faryad Darabi Sahneh, Stephen G. Kobourov, andRichard Spence. Weighted additive spanners.
CoRR , abs/2002.07152, 2020.[ACIM99] Donald Aingworth, Chandra Chekuri, Piotr Indyk, and Rajeev Motwani. Fast estima-tion of diameter and shortest paths (without matrix multiplication).
SIAM J. Comput. ,28(4):1167–1181, 1999. 7ADD +
93] Ingo Alth¨ofer, Gautam Das, David P. Dobkin, Deborah Joseph, and Jos´e Soares. Onsparse spanners of weighted graphs.
Discret. Comput. Geom. , 9:81–100, 1993.[BKMP05] Surender Baswana, Telikepalli Kavitha, Kurt Mehlhorn, and Seth Pettie. New con-structions of (alpha, beta)-spanners and purely additive spanners. In
Proceedings ofthe Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2005,Vancouver, British Columbia, Canada, January 23-25, 2005 , pages 672–681. SIAM,2005.[Bod20] Greg Bodwin. Some general structure for extremal sparsification problems.
CoRR ,abs/2001.07741, 2020.[Che13] Shiri Chechik. New additive spanners. In Sanjeev Khanna, editor,
Proceedings of theTwenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2013,New Orleans, Louisiana, USA, January 6-8, 2013 , pages 498–512. SIAM, 2013.[EGN19] Michael Elkin, Yuval Gitlitz, and Ofer Neiman. Almost shortest paths with near-additive error in weighted graphs.
CoRR , abs/1907.11422, 2019.[Elk01] M. Elkin. Computing almost shortest paths. In
Proc. 20th ACM Symp. on Principlesof Distributed Computing , pages 53–62, 2001.[EN19] Michael Elkin and Ofer Neiman. Hopsets with constant hopbound, and applications toapproximate shortest paths.
SIAM J. Comput. , 48(4):1436–1480, 2019.[EP04] Michael Elkin and David Peleg. (1+epsilon, beta)-spanner constructions for generalgraphs.
SIAM J. Comput. , 33(3):608–631, 2004.[EZ06] M. Elkin and J. Zhang. Efficient algorithms for constructing (1 + ε, β )-spanners in thedistributed and streaming models.
Distributed Computing , 18:375–385, 2006.[Knu14] Mathias Bæk Tejs Knudsen. Additive spanners: A simple construction. In R. Ravi andInge Li Gørtz, editors,
Algorithm Theory - SWAT 2014 - 14th Scandinavian Symposiumand Workshops, Copenhagen, Denmark, July 2-4, 2014. Proceedings , volume 8503 of
Lecture Notes in Computer Science , pages 277–281. Springer, 2014.[Pet09] Seth Pettie. Low distortion spanners.
ACM Transactions on Algorithms , 6(1), 2009.[PS89] D. Peleg and A. Sch¨affer. Graph spanners.
J. Graph Theory , 13:99–116, 1989.[TZ06] M. Thorup and U. Zwick. Spanners and emulators with sublinear distance errors. In