1 / 26

all-pairs shortest paths in undirected graphs

approximate. Dynamic. all-pairs shortest paths in undirected graphs. Liam Roditty Uri Zwick Tel Aviv University. A graph. Dynamic Graph Problems. Initialize. Insert. Delete. Query. n - number of vertices m - number of edges. Shortest Paths Problems.

joanna
Download Presentation

all-pairs shortest paths in undirected graphs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. A graph Dynamic Graph Problems Initialize Insert Delete Query n - number of verticesm - number of edges

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

  4. Approximate Distance Oracles (TZ’01) n by ndistancematrix APSPalgorithm Compact datastructure mn1/ktimen1+1/k space O(1) querytime stretch 2k-1 Stretch-Space tradeoff is essentially optimal!

  5. Dynamic Shortest Paths Algorithms

  6. Decremental Approximate Distance Oracles Compact datastructure mn1/ktimen1+1/kspace O(1)querytimestretch2k-1 Static mntimem+n1+1/kspace Decremental dmn1/ktimem+n1+1/kspace Decremental(up to distance d)

  7. Three ingredients Even-Shiloach ’81A decremental algorithm for maintaining a single-source shortest path tree of depth d with a total running time of O(dm). 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  . Thorup-Zwick ’01Static approximate distance oracles.

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

  9. k Random Sampling n Select each elementindependently with probability The probability that agiven set of k elementsis nothit is

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

  11. Maintaining the closest centers To computepi(v)for everyv: • Add a new source vertex si. • Connect it to all vertices of Si. • Maintain a SSSP tree from si.

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

  13. Answering a distance query pi(u) v u Suppose: Return: ≤ ≤

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

  15. Reporting long distances in O(1) time pr(u) pr(v) v u Suppose: Let: Return: Maintain a table of all Srto Sr distances. Size of table is O(n).

  16. Reporting short distances in O(1) time Suppose: Develop a decremental version of the static approximate distance oracles of TZ. Taked=n1/2k=2 dmn1/ktimem+n1+1/kspacestretch 2k-1 For distancesup to d The 3-approximation can be refined into a (1+)-approximation in O(1) time.

  17. Approximate Distance Oracles [TZ’01]A hierarchy of centers A0V ; Ak  ;Ai sample(Ai-1,n-1/k) ;

  18. A0=A1=A2= Clusters w

  19. Bunches(inverse clusters)

  20. A0=A1=A2= Bunches p2(v) v p1(v)

  21. Approximate Distance Oracles [TZ’01]The data structure • For every vertex vV: • The centers p1(v), p2(v),…, pk-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. Lemma: E[|B(v)|] ≤ kn1/k Proof:|B(v)Ai| is stochastically dominated by a geometric random variable with parameter p=n-1/k.

  23. Query answering algorithm Algorithm distk(u,v) wu , i0 while wB(v) { i i+1 (u,v) (v,u) w pi(u) } return (w,u)+ (w,v)

  24. Query answering algorithm w3=p3(v)A3 w2=p2(u)A2 w1=p1(v)A1 v u

  25. Analysis wi=pi(u)Ai wi-1=pi-1(v)Ai-1 i (i+1) i (i-1) v u 

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

More Related