approximate distance oracles

24
1 Approximate Approximate Distance Oracles Distance Oracles Mikkel Thorup Mikkel Thorup AT&T Research AT&T Research Uri Zwick Uri Zwick Tel Aviv Tel Aviv University University

Upload: ronnie

Post on 15-Jan-2016

77 views

Category:

Documents


4 download

DESCRIPTION

Approximate Distance Oracles. Mikkel Thorup AT&T Research Uri Zwick Tel Aviv University. Approximate distance oracle. Finite metric space. O(n 2 ) time. n by n distance matrix. Compact data structure. O(1) query time Exact answers (n 2 ) space. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Approximate  Distance Oracles

1

Approximate Approximate Distance OraclesDistance Oracles

Mikkel Thorup Mikkel Thorup AT&T ResearchAT&T Research

Uri Zwick Uri Zwick Tel Aviv UniversityTel Aviv University

Page 2: Approximate  Distance Oracles

2

Finite metric space

n by ndistancematrix

O(1) query time

Exact answers(n2) space

Approximate distance oracle

Compact datastructure

O(k) query time

stretch 2k-1O(kn1+1/k)

space

O(n2) time

Page 3: Approximate  Distance Oracles

3

Graph

n by ndistancematrix

Compact datastructure

APSPalgorith

m

kmn1/k timekn1+1/k space

Page 4: Approximate  Distance Oracles

4

Approximate Distance Oracles

StretchQuer

y time

SpacePreproc

. time

Reference

64kkn1/k

kn1+1/kkmn1/k

Awerbuch-Berger-

Cowen-Peleg ‘93

2k+kn1/kCohen ‘93

2k-1kThorup-Zwick ‘01

Constant query time!

This tradeoff isessentially optimal !

Page 5: Approximate  Distance Oracles

5

Approximate Distance Oracles

StretchQuery time

SpacePreproc.

time

2.99Ω(n2)

31O(n3/2)mn1/2

4.99Ω(n3/2)

51O(n4/3)mn1/3

…………

log nlog nn log nm log n

Page 6: Approximate  Distance Oracles

6

Stretch/space tradeoffLet G=(V,E) be a graph with |V|=n and girth(G)≥2k+2.

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) ≥2k+1.

As there are 2|E| different subgraphs of G, some subgraphs must have data structures of at least |E| bits.

Conjecture: (Erdös ’65) For every k≥1, there are infinitely many n-vertex graphs with Ω(n1+1/k) edges that have girth≥2k+2.

Page 7: Approximate  Distance Oracles

7

Spanners

Let G be a weighted undirected graph.

A subgraph H of G is a t-spanner of G

iff u,vG,

H(u,v) t G(u,v) .

Awerbuch ’85Peleg-Schäffer ‘89

Page 8: Approximate  Distance Oracles

8

Trivial example

Page 9: Approximate  Distance Oracles

9

Theorem

For every k≥1, every weighted

undirected graph on n vertices

has a (2k-1)-spanner with at

most m2k+1(n) ≤ n1+1/k edges.

Maximal number of edges in an n-vertex graph with girth ≥

2k+1

Tight for k=1,2,3,5.

Conjectured to be

tight for any k

Page 10: Approximate  Distance Oracles

10

Proof/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

m2k+1(n) ≤ n1+1/k.[Althöfer, Das, Dobkin, Joseph, Soares ‘93]

Page 11: Approximate  Distance Oracles

11

If |cycle|2k, then red edge can be removed.

Page 12: Approximate  Distance Oracles

12

A hierarchy of A hierarchy of centerscenters

A0V ; Ak ; Ai sample(Ai-1,n-1/k) ;

Page 13: Approximate  Distance Oracles

13

ClustersClusters A0=A1=A2=

1 1( ) | ( , ) ( , ) ,i i iC w v V w v A v w A A

w

Page 14: Approximate  Distance Oracles

14

BunchesBunches (inverse (inverse clusters)clusters)

1

1

1

1

( ) | ( , ) ( , ) ,

( ) | ( , ) (

( ) (

,

)

)i i

i

ii

i i

C w v V w v A v

if w

w

B v w A A w v A

B

A A

v v C w

v

Page 15: Approximate  Distance Oracles

15

BunchesBunches

1 1( ) | ( , ) ( , )i i ii

B v w A A w v A v

A0=A1=A2=

v

p1(v)

p2(v)

Page 16: Approximate  Distance Oracles

16

The data structureFor 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).

Page 17: Approximate  Distance Oracles

17

Lemma: E[|B(v)|]≤kn1/k

Proof: |B(v)Ai| is

stochastically dominated by a

geometric random variable

with parameter p=n-1/k.

Page 18: Approximate  Distance Oracles

18

Query answering algorithm Algorithm

distk(u,v)

wu , i0

while wB(v)

i i+1

(u,v) (v,u)

w pi(u)

return (w,u)+

(w,v)

Page 19: Approximate  Distance Oracles

19

Query answering algorithm

u v

w1=p1(v)A

1

w2=p2(u)A

2

w3=p3(v)A3

Page 20: Approximate  Distance Oracles

20

u v

wi-1=pi-1(v)Ai-1

wi=pi(u)Ai

Analysis

(i-1)ii

(i+1)

Page 21: Approximate  Distance Oracles

21

Spanners / Tree coversSpanners / Tree covers

w

In each cluster,

construct a tree of

shortest pathsThe union of all these trees

in a (2k-1)-spanner with kn1+1/k edges.

Constructed in O(kmn1/k) time!

Page 22: Approximate  Distance Oracles

22

Tree 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.

Page 23: Approximate  Distance Oracles

23

ApplicationsApplications

• Routing• Distance labels• Sub-quadratic approximation

algorithms for metric space problems

Page 24: Approximate  Distance Oracles

24

Open ProblemsOpen Problems

1. Deterministic construction of(2k-1,n1+1/k,k)-distance oracles in o(mn) time?

2. Constructing a (3,n3/2,1)-distance oracle in n2+o(1) time?

3. Distance oracles withadditive errors?