Download presentation
Presentation is loading. Please wait.
Published byAlberta Wells Modified over 8 years ago
1
Approximate Distance Oracles Mikkel Thorup and Uri Zwick Presented By Shiri Chechik
2
Approximate Distance Oracles Consider a graph G=(V,E). An approximate distance oracle with a stretch k for the graph G is a data-structure that can answer an approximate distance query for any two vertices with a stretch of at most k. For every u,v in V the data structure returns in “short time” an approximate distance d’ such that: d G (u,v) d’ k· d G (u,v).
3
Reference Preproc. time Space Query time Stretch Awerbuch- Berger- Cowen-Peleg ‘93 kmn 1/k kn 1+1/k kn 1/k 64k Cohen ‘93kn 1/k 2k+ Thorup- Zwick ‘01 k 2k-1 Constant query time! This tradeoff is essentially optimal ! Approximate Distance Oracles Slide from Uri Zwick
4
Spanners - Formal Definition Consider a graph G=(V,E) with positive edge weights. A subgraph H is a k-spanner of G if for every u,v in V: d H (u,v) k·d G (u,v).
5
Spanners - Example v
6
Spanners - Equivalent Definition A subgraph H is a k-spanner of G if for every edge (u,v) in E: d H (u,v) k· w(u,v). x y
7
Spanners for General graphs Theorem One can efficiently find a (2k-1)-spanner with at most n 1+1/k edges.
8
Spanners for General graphs Girth Conjecture (Erdös and others): There are n-vertex graphs with Ω(n 1+1/k ) edges that have girth > 2k. Known for k=1,2,3,5.
9
Spanners - Equivalent Definition A subgraph H is a k-spanner of G if for every edge (u,v) in E: x y
10
Greedy Algorithm
11
Greedy Algorithm - Properties H is a k-spanner of G (trivial). The girth of H is greater than k+1. ◦ Assume c is a cycle of size at most k+1 ◦ Let e=(u,v) be the last edge added to cycle c. ◦ Let w(e) be the weight of edge e. ◦ All other edges of cycle c are of weight less than w(e). ◦ We found a path between u and v of length less than k ∙ w(e). ◦ e was not supposed to be added to H.
12
Greedy Algorithm - Example
13
Lemma Let G=(V,E) be a graph with girth 2k+1. This is also conjectured to be the lower bound of the number of edges in a (2k-1)-spanner (Erdös ’65).
14
Theorem One can efficiently find a (2k-1)- spanner with edges.
15
Distance Oracles - Construction Preprocessing Phase First build a hierarchy of centers, A 0,…, A k A 0 V, A k A i sample(A i-1, n -1/k )
16
A 0 = A 1 = A 2 = A k = Distance Oracles - Construction Preprocessing Phase
17
A hierarchy of centers A 0 V ; A k ; A i sample(A i-1,n -1/k ) ; Slide from Uri Zwick
18
Notations p i (v) is the closest node to v in A i For each w A i \A i+1 ◦ C(w) {v| δ(v,w) < δ(v,p i+1 (v))} Distance Oracles - Construction Preprocessing Phase
19
Clusters Clusters A0=A1=A2=A0=A1=A2= w Slide from Uri Zwick
20
Bunches (inverse clusters) Slide from Uri Zwick
21
Distance Oracles - Example V P 1 (V)
22
A 0 = {v 1, v 2, v 3, v 4 } A 1 = {v 2, v 3 } A 2 = {v 3 } A 3 = {} C(v 1 )= {v 1, v 4 }, C(v 4 )= {v 4 } C(v 2 )= {v 2, v 1 } C(v 3 )= {v 1, v 2, v 3, v 4 } Distance Oracles - Example 1 2 1 1.5 V2V2 V1V1 V3V3 V4V4
23
Data structures For every v V ◦ p 1 (v),…,p k-1 (v) and the distance from v to p i (v). ◦ C(v) (hash table) and the distance from v to every u in C(v). Distance Oracles - Construction Preprocessing Phase
24
Lemma: E[|B(v)|]≤kn 1/k |B(v) Ai| is stochastically dominated by a geometric random variable with parameter p=n -1/k. Distance Oracles Slide from Uri Zwick
25
Lemma For every two nodes u and v, there exists a node w such that ◦ u,v C(w) ◦ The distance from u to w and from v to w is at most k·d(u,v) Distance Oracles
26
Distance Oracles - Construction Query Phase
27
u v P 1 (v) P 2 (u) P 3 (v) << 2>2> <3 Distance Oracles - Construction Query Phase
28
What is δ(v 4, v 1 )? Is v 1 C( v 4 )? w = p 1 (v 1 ) = v 2 Is v 4 C( v 2 )? w = p 2 (v 4 ) = v 3 Is v 1 C( v 3 )? – Yes C(v 1 )= {v 1, v 4 }, C(v 4 )= {v 4 } C(v 2 )= {v 2, v 1 } C(v 3 )= {v 1, v 2, v 3, v 4 } Distance Oracles - Example 1 2 1 1.5 V2V2 V1V1 V3V3 V4V4
29
Consider a node v C(w), every node on a shortest path from v to w also belongs to C(w). Distance Oracles - Properties Thorup and Zwick (2005) vw x A i+1 y
30
v belongs to C(p i (v)) for every 0≤ i ≤k-1. Distance Oracles - Properties Thorup and Zwick (2005)
31
Short Summary For every two nodes u and v, there exists a node w such that ◦ u,v C(w) ◦ The distance from u to w and from v to w is at most k· Distance Oracles - Construction Thorup and Zwick (2005)
32
From each cluster, construct a tree T(w) containing shortest path. Distance Oracles w u v
33
The union of all these trees is a (2k-1)-spanner with O(kn 1+1/k ) edges. Distance Oracles
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.