Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distance sensitivity oracles in weighted directed graphs Raphael Yuster University of Haifa Joint work with Oren Weimann Weizmann inst.

Similar presentations


Presentation on theme: "Distance sensitivity oracles in weighted directed graphs Raphael Yuster University of Haifa Joint work with Oren Weimann Weizmann inst."— Presentation transcript:

1 Distance sensitivity oracles in weighted directed graphs Raphael Yuster University of Haifa Joint work with Oren Weimann Weizmann inst.

2 2 Distance Sensitivity Oracles A data structure that reports shortest paths when edges of a (possibly directed, possibly weighted) graph G = (V, E) fail. A query (u,v  V, F  E) to the oracle returns the length of the shortest u-to-v path in the graph G’ = (V, E-F). When measuring distance oracles we are mostly concerned with the tradeoff between: Construction time / space vs.Query time Related variant: Replacement paths. Here we are given u,v and a shortest path p between them in advance, and need to compute all “replacement paths’’ resulting from single edge failures on p.

3 3 Previous research NameVariant Construction Query timespace Demetrescu et al. [SICOMP – 2008] |F|=1O(n4)O(n4)n 2 log nO(1) Bernstein & Carger [STOC – 2009] |F|=1O(n3)O(n3)n 2 log nO(1) Duan & Pettie [SODA – 2009] |F|=2polynomialn 2 log 3 nlog n Y. & Weimann [FOCS – 2010] |F|=k|F|=ksub-cubicn2n2 sub- quadratic Roditty & Zwick [ICALP – 2005] replacement, unweighted n 2.5 Y. & Weimann [FOCS – 2010] replacement n 2.58 Vassilevska [SODA-2011] replacement n 2.38

4 4 For any 0<α<1, w.h.p. a distance sensitivity oracle for k edge failures is constructed in O(n 2 ) space, O(n 1+ω-α ) < O(n 3.38-α ) time, and a query (u,v,F) is answered in O(n 2-(1-α)/k ) time. We assume that the edges have integer weights. Here ω < 2.38 is the “matrix multiplication exponent”. For simplicity, we will outline the proof of the case k=1: Main result For any 0 < α < 1, w.h.p. a distance sensitivity oracle for avoiding a single edge failure is constructed in O(n 2 ) space, O(n 3.38-α ) time, and a query (u,v,e) is answered in O(n 1+α ) time.

5 5 For each possible query (u,v,e), let p(u,v,e) denote an (unknown) shortest path from u to v in G-e. We construct a set of random subgraphs R={G 1,…,G r } and prove that R has the following properties: For every edge e, the subset R e  R of subgraphs missing e is not too small and not too large. Every small-enough interval of any p(u,v,e) survives in at least one subgraph from R e. Choose at random a small-enough subset of vertices B. Every small-enough interval of any p(u,v,e) is hit by B. We compute the “all pairs” B*B distance matrix in every G i. Call it D i. Rough outline

6 6 The preprocessing consists of R={G 1,…,G r } and of {D 1,…,D r } as well as a “reduced length function”. Given a query Q = (u,v,e): We identify the set of subgraphs R e. For every G i  R e we extend D i from an all-pairs distance matrix of B to an all pairs matrix of B  {u,v}. We construct a weighted complete graph G Q : Its vertex set is B  {u,v}. The weight of (x,y) is the length of the shortest x to y path in all the G i  R e. The answer to Q is the distance from u to v in G Q. It can be efficiently computed using reduced lengths. Rough outline – cont.

7 7 The set of random subgraphs R={G 1,…,G r } is generated as follows: r = 42n 1-α log n. An edge is not taken to G i with probability n α-1 (independently for each edge and for each G i ). The random subgraphs Lemma 1 The probability that 21 log n < |R e | < 70 log n for all e  E is 1-o(1).

8 8 Recall: p(u,v,e) denotes a shortest path from u to v in G-e. A short interval is a subpath with n 1-α vertices of p(u,v,e). Observe: there are only O(n 4 ) possible short intervals. We say that a short interval of p(u,v,e) survives if all its edges appear in some random subgraph of R e. The random subgraphs Lemma 2 The probability that all short intervals survive is 1-o(1). Proof: Consider short interval I of p(u,v,e) and some G i  R e. Survival probability: Non-survival in all G i  R e : By Lemma 1:

9 9 Let B be a random subset of 5n α log n vertices. Hitting sets for shortest paths Lemma 3 With probability 1-o(1) every short interval is “hit” by B. We need to compute, for each G i  R, the distance between any pair of vertices of B (in fact, we care only about relevant pairs: distances realized by paths using at most n 1-α vertices). 1 2 34 5 6 0 9 8 7 B={1,3,5,8} n 1-α =3 02∞∞ ∞02∞ ∞∞02 21∞0 13581358 1 3 5 8

10 10 The following is a corollary of a result of [Y. & Zwick, FOCS’05] : Lemma 4 Let G be a directed graph with integer edge weights, and let B be a subset of vertices of size O(n α ). A square matrix D indexed by B where D[x,y] is the distance from x to y whenever (x,y) is a relevant pair can be computed in matrix multiplication time O(n ω ) < O(n 2.38 ).

11 11 Summary of preprocessing stage Corollary 5 Distance matrices D i for all G i  R can be computed in O(|R|n ω )=O(n ω+1-α ). O(n ω+1-α ) is also the time of the preprocessing stage. Space: The matrices D i together require |B| 2 |R|= O(n 1+α ) space, the random subgraphs require (whp) O(|R|n 1+α ) space (just store the edges that don’t appear in it). Total: O(n 2 ) space. “reduced length function”: a trick to handle negative weights reducing to the nonnegative edge-weight case. Can also be done in matrix multiplication time.

12 12 Query stage Upon query Q=(u,v,e): Check each random subgraph whether belongs to R e. This takes only O(log n) time per subgraph. F or each G i  R e, (and recall that |R e | < 70 log n whp) extend D i from a {B}*{B} distance matrix to a {B [ u}* {B [ v} matrix (just add one row and one column recording the shortest path from u to vertices of B and from B to vertices of v). This can be done in O(n|B|)= O(n 1+α ) time. Construct a weighted complete graph G Q : Its vertex set is B  {u,v}. The weight of (x,y) is the smallest of the entries D i [x,y] ranging over all G i  R e. G Q is constructed in O(|B| 2 |R e |)= O(n 2α ) time.

13 13 Finalizing the query Lemma 6 The distance from u to v in G-e is their distance in G Q. This distance is found in O(n 2α ) time by Dijkstra’s algorithm. Proof: Consider p(u,v,e) (a shortest u-v path in G-e). uv = member of B survives 1 11 1 1 11 1 1 1 1 11 1 (assume unit lengths) Between any two consecutive vertices of B on p(u,v,e) there is at most a short interval, so each interval survives in some G i  R e. Therefore, in G Q we have uv 2 32 43

14 14 Thanks!


Download ppt "Distance sensitivity oracles in weighted directed graphs Raphael Yuster University of Haifa Joint work with Oren Weimann Weizmann inst."

Similar presentations


Ads by Google