Download presentation

Presentation is loading. Please wait.

Published byKalyn Senter Modified about 1 year ago

1
1 all-pairs shortest paths in undirected graphs Liam Roditty Uri Zwick Tel Aviv University approximate Dynamic

2
2 A graph Dynamic Graph Problems Initialize Insert Delete Query n - number of vertices m - number of edges

3
3 Shortest Paths Problems Single-Source Shortest Paths (SSSP) All-Pairs Shortest Paths (APSP) “Distance Oracles”

4
4 Compact data structure APSP algorithm mn 1/k time n 1+1/k space Approximate Distance Oracles (TZ’01) O(1) query time stretch 2k-1 Stretch-Space tradeoff is essentially optimal! n by n distance matrix

5
5 Dynamic Shortest Paths Algorithms Problem Total update time Amortized * update time Query time Authors Decremental SSSP O(mn)O(n)O(1) Even-Shiloach ’81 Problem Amortized update time Query time Authors Fully-dynamic APSP O * (n 2 )O(1) Demetrescu-Italiano ’03 (Thorup ’04) Decremental (1+ )-approximate APSP O * (mn)O * (n)O(1) This talk Fully-dynamic (1+ )- approximate APSP O * (m 1/2 n)O(m 1/2 ) This talk

6
6 Compact data structure mn 1/k time n 1+1/k space Decremental Approximate Distance Oracles O(1) query time stretch 2k-1 Static mn time m+n 1+1/k space Decremental dmn 1/k time m+n 1+1/k space Decremental (up to distance d)

7
7 Three ingredients Random Sampling Let P be a set of vertices of size k. Let S be a random subset of vertices of size (cn ln n)/k. Then with high probability P S . Even-Shiloach ’81 A decremental algorithm for maintaining a single- source shortest path tree of depth d with a total running time of O(dm). Thorup-Zwick ’01 Static approximate distance oracles.

8
8 Decremental SSSP [Even-Shiloach ’81] Every edge is only examined once per level! Total complexity is O(dm).

9
9 Random Sampling Select each element independently with probability n k The probability that a given set of k elements is not hit is

10
10 A sequence of Samples Let S i be a subset obtained by selecting each vertex with probability (c ln n)/( 2 i ) If v is contained in a connected component with at least 2 i vertices, then: 2i2i p i (v) Let p i (v) be the vertex of S i closest to v δ(v,p i (v)) ≤ 2 i

11
11 Maintaining the closest centers To compute p i (v) for every v: 1.Add a new source vertex s i. 2.Connect it to all vertices of S i. 3.Maintain a SSSP tree from s i.

12
12 Maintaining distances from centers From each center of S i maintain a SSSP tree of depth 2 i+2 Complexity: 2 i+2

13
13 Answering a distance query Suppose: Return: ≤ ≤ u v p i (u)

14
14 Answering a distance query Return: u v p i (u) where i is smallest such that v is in the tree of p i (u), i.e., This value of i can be found using binary search. Query time: O(log log n) Stretch: 1+

15
15 Reporting long distances in O(1) time u v p r (u) p r (v) Suppose: Let: Return: Maintain a table of all S r to S r distances. Size of table is O(n).

16
16 Reporting short distances in O(1) time Suppose: Develop a decremental version of the static approximate distance oracles of TZ. The 3-approximation can be refined into a (1+ )-approximation in O(1) time. dmn 1/k time m+n 1+1/k space stretch 2k-1 For distances up to d Take d=n 1/2 k=2

17
17 Approximate Distance Oracles [TZ ’ 01] A hierarchy of centers A 0 V ; A k ; A i sample(A i-1,n -1/k ) ;

18
18 Clusters A0=A1=A2=A0=A1=A2= w

19
19 Bunches (inverse clusters)

20
20 Bunches A0=A1=A2=A0=A1=A2= v p 1 (v) p 2 (v)

21
21 Approximate Distance Oracles [TZ’01] The data structure For every vertex v V: The centers p 1 (v), p 2 (v),…, p k-1 (v) A hash table holding B(v) For every w V, we can check, in constant time, whether w B(v), and if so, what is (v,w).

22
22 Lemma: E[|B(v)|] ≤ kn 1/k Proof: |B(v) A i | is stochastically dominated by a geometric random variable with parameter p=n -1/k.

23
23 Query answering algorithm Algorithm dist k (u,v) w u, i 0 while w B(v) { i i+1 (u,v) (v,u) w p i (u) } return (w,u)+ (w,v)

24
24 Query answering algorithm u v w 1 =p 1 (v) A 1 w 2 =p 2 (u) A 2 w 3 =p 3 (v) A 3

25
25 u v w i-1 =p i-1 (v) A i-1 w i =p i (u) A i Analysis (i-1) ii ii (i+1)

26
26 Open problems Faster dynamic SSSP algorithm? Exact dynamic APSP algorithm? Weighted graphs? Directed graphs?

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google