6 Decremental Approximate Distance Oracles Compact data structuremn1/k time n1+1/k spaceO(1) query time stretch 2k-1Staticmn time m+n1+1/k spaceDecrementalDecremental (up to distance d)dmn1/k time m+n1+1/k space
7 Thorup-Zwick ’01 Static approximate distance oracles. Three ingredientsEven-Shiloach ’81 A 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 PS .Thorup-Zwick ’01 Static approximate distance oracles.
8 Decremental SSSP [Even-Shiloach ’81] Every edge is only examined once per level!Total complexity is O(dm).
9 Random Sampling n k Select each element independently with probability The probability that a given set of k elements is not hit is
10 Let pi(v) be the vertex of Si closest to v A sequence of SamplesLet Si be a subset obtained by selecting each vertex with probability (c ln n)/(2i)Let pi(v) be the vertex of Si closest to vIf v is contained in a connected component with at least 2i vertices, then:δ(v,pi(v)) ≤ 2i2ipi(v)
11 Maintaining the closest centers To compute pi(v) for every v:Add a new source vertex si.Connect it to all vertices of Si.Maintain a SSSP tree from si.
12 Maintaining distances from centers From each center of Si maintain a SSSP tree of depth 2i+2Complexity:
13 Answering a distance query pi(u)uvSuppose:Return:≤≤
14 Answering a distance query pi(u)uvReturn:where i is smallest such that v is in the tree of pi(u), i.e.,This value of i can be found using binary search.Query time: O(log log n)Stretch:
15 Reporting long distances in O(1) time pr(u)pr(v)uvSuppose:Let:Return:Maintain a table of all Sr to 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.dmn1/k time m+n1+1/k space stretch 2k-1Take d=n1/2 k=2For distances up to dThe 3-approximation can be refined into a (1+)-approximation in O(1) time.
17 Approximate Distance Oracles [TZ’01] A hierarchy of centers A0V ; Ak ; Ai sample(Ai-1,n-1/k) ;
21 Approximate Distance Oracles [TZ’01] The data structure For every vertex vV:The centers p1(v), p2(v),…, pk-1(v)A hash table holding B(v)For every wV, we can check, in constant time, whether wB(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.