Title: Approximate Distance Oracles
1Approximate Distance Oracles
- Mikkel Thorup ATT Research
- Uri Zwick Tel Aviv University
2Finite metric space
Approximate distance oracle
O(n2) time
n by ndistancematrix
Compact datastructure
O(1) query timeExact answers?(n2) space
O(k) query timestretch 2k-1O(kn11/k) space
3APSPalgorithm
n by ndistancematrix
Graph
kmn1/k timekn11/k space
Compact datastructure
4Approximate Distance Oracles
Reference Preproc. time Space Query time Stretch
Awerbuch-Berger-Cowen-Peleg 93 kmn1/k kn11/k kn1/k 64k
Cohen 93 kmn1/k kn11/k kn1/k 2k?
Thorup-Zwick 01 kmn1/k kn11/k k 2k-1
Constant query time!
This tradeoff isessentially optimal !
5Approximate Distance Oracles
Preproc. time Space Query time Stretch
?(n2) 2.99
mn1/2 O(n3/2) 1 3
?(n3/2) 4.99
mn1/3 O(n4/3) 1 5
m log n n log n log n log n
6Stretch/space tradeoff
Let G(V,E) be a graph with Vn and
girth(G)2k2. Any subgraph G(V,E) of G must
have a distinct data structure! If (u,v)?E,
then ?G(u,v)1. Otherwise ?G(u,v) 2k1. As
there are 2E different subgraphs of G, some
subgraphs must have data structures of at least
E bits. Conjecture (Erdös 65) For every k1,
there are infinitely many n-vertex graphs with
?(n11/k) edges that have girth2k2.
7Spanners
Let G be a weighted undirected graph. A subgraph
H of G is a t-spanner of G iff ?u,v?G, ?H(u,v)
? t ?G(u,v) .
Awerbuch 85 Peleg-Schäffer 89
8Trivial example
9Theorem
For every k1, every weighted undirected graph on
n vertices has a (2k-1)-spanner with at most
m2k1(n) n11/k edges.
Tight for k1,2,3,5. Conjectured to be tight for
any k
Maximal number of edges in an n-vertex graph with
girth 2k1
10Proof/Algorithm
Consider the edges in non-decreasing order of
weight. Add each edge to the spanner if it does
not close a cycle of size at most 2k. The
resulting graph is a (2k-1)-spanner and it does
not contain a cycle of size at most 2k. Hence the
number of edges is at most m2k1(n) n11/k.
Althöfer, Das, Dobkin, Joseph, Soares 93
11If cycle?2k, then red edge can be removed.
12A hierarchy of centers
A0?V Ak ?? Ai ?sample(Ai-1,n-1/k)
13Clusters
w
14Bunches (inverse clusters)
15Bunches
p2(v)
v
p1(v)
16The 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).
17Lemma EB(v)kn1/k
Proof B(v)?Ai is stochastically dominated by a
geometric random variable with parameter pn-1/k.
18Query answering algorithm
Algorithm distk(u,v) w?u , i?0 while
w?B(v) i ?i1 (u,v) ?(v,u) w
?pi(u) return ?(w,u) ?(w,v)
19Query answering algorithm
w3p3(v)?A3
w2p2(u)?A2
w1p1(v)?A1
u
v
20Analysis
wipi(u)?Ai
wi-1pi-1(v)?Ai-1
i?
(i1)?
i?
(i-1)?
v
u
?
21Spanners / Tree covers
In each cluster, construct a tree of shortest
paths
The union of all these trees in a (2k-1)-spanner
with kn11/k edges.
w
Constructed in O(kmn1/k) time!
22Tree Cover
Each vertex contained in at most n1/k log n
trees. For every u,v, there is a tree with a path
of stretch at most 2k-1 between them.
23Applications
- Routing
- Distance labels
- Sub-quadratic approximation algorithms for metric
space problems
24Open Problems
- Deterministic construction of(2k-1,n11/k,k)-dist
ance oracles in o(mn) time? - Constructing a (3,n3/2,1)-distance oracle in
n2o(1) time? - Distance oracles withadditive errors?