Approximate Distance Oracles

26
Approximate Distance Approximate Distance Oracles Oracles Mikkel Thorup and Uri Zwick Presented By Shiri Chechik

description

Approximate Distance Oracles. Mikkel Thorup and Uri Zwick Presented By Shiri Chechik. Approximate Distance Oracles. Consider a graph G=(V,E) . - PowerPoint PPT Presentation

Transcript of Approximate Distance Oracles

Page 1: Approximate Distance Oracles

Approximate Distance Approximate Distance OraclesOracles

Mikkel Thorup and Uri Zwick Presented ByShiri Chechik

Page 2: Approximate Distance Oracles

Approximate Distance Approximate Distance OraclesOraclesConsider 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:

dG(u,v) d’ k· dG(u,v) .

Page 3: Approximate Distance Oracles

Stretch

Query

timeSpace

Preproc.

timeReference

64k kn1/k

kn1+1/k kmn1/k

Awerbuch-Berger-Cowen-

Peleg ‘93

2k+ kn1/k Cohen ‘93

2k-1 k Thorup-Zwick ‘01

Constant query time!This tradeoff is

essentially optimal !

Approximate Distance Approximate Distance OraclesOracles

Slide from Uri Zwick

Page 4: Approximate Distance Oracles

SpannersSpanners - Formal - Formal DefinitionDefinition

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:

dH(u,v) k·dG(u,v) .

Page 5: Approximate Distance Oracles

SpannersSpanners - Example - Example

v

Page 6: Approximate Distance Oracles

SpannersSpanners - Equivalent - Equivalent DefinitionDefinition

A subgraph H is a k-spanner of G if for every edge (u,v) in E:

dH(u,v) k· w(u,v) .

x

y

Page 7: Approximate Distance Oracles

Spanners for General Spanners for General graphsgraphsTheoremOne can efficiently find a (2k-1)-spanner with at most n1+1/k edges.

Page 8: Approximate Distance Oracles

Spanners for General Spanners for General graphsgraphsGirth Conjecture (Erdös and

others):There are n-vertex graphs with Ω(n1+1/k) edges that have girth > 2k.

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

Page 9: Approximate Distance Oracles

Distance Oracles Distance Oracles -- Construction Construction Preprocessing PhasePreprocessing Phase

First build a hierarchy of centers, A0,…, Ak

A0 V, Ak

Ai sample(Ai-1, n-1/k)

Page 10: Approximate Distance Oracles

A0 =

A1 =

A2 =

Ak =

Distance Oracles Distance Oracles -- Construction Construction Preprocessing PhasePreprocessing Phase

Page 11: Approximate Distance Oracles

A hierarchy of centersA hierarchy of centers

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

Slide from Uri Zwick

Page 12: Approximate Distance Oracles

Notationspi(v) is the closest node to v in Ai

For each w Ai\Ai+1

◦C(w) {v| δ(v,w) < δ(v,pi+1(v))}

Distance Oracles Distance Oracles -- Construction Construction Preprocessing PhasePreprocessing Phase

Page 13: Approximate Distance Oracles

ClustersClustersA0=A1=A2=

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

w

Slide from Uri Zwick

Page 14: Approximate Distance Oracles

Bunches (inverse Bunches (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

Slide from Uri Zwick

Page 15: Approximate Distance Oracles

Distance OraclesDistance Oracles - - ExampleExample

V

P1(V)

Page 16: Approximate Distance Oracles

A0 = {v1, v2, v3, v4} A1 = {v2, v3} A2 = {v3} A3 = {}

C(v1)= {v1, v4}, C(v4)= {v4} C(v2)= {v2, v1} C(v3)= {v1, v2, v3, v4}

Distance OraclesDistance Oracles - - ExampleExample

1 2

11.5

V2

V1

V3

V4

Page 17: Approximate Distance Oracles

Data structuresFor every v V

◦p1(v),…,pk-1(v) and the distance from v to pi(v).

◦C(v) (hash table) and the distance from v to every u in C(v).

Distance Oracles Distance Oracles -- Construction Construction Preprocessing PhasePreprocessing Phase

Page 18: Approximate Distance Oracles

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

|B(v)Ai| is stochastically dominated by a geometric random variable with parameter p=n-1/k.

Distance OraclesDistance Oracles

Slide from Uri Zwick

Page 19: Approximate Distance Oracles

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 OraclesDistance Oracles

Page 20: Approximate Distance Oracles

Distance Oracles Distance Oracles -- Construction Construction Query PhaseQuery Phase

Page 21: Approximate Distance Oracles

u v

P1(v)

P2(u)P3(v)

<2>

<3

Distance Oracles Distance Oracles -- Construction Construction Query PhaseQuery Phase

Page 22: Approximate Distance Oracles

Distance OraclesDistance Oracles - - ExampleExample

1 2

11.5

V2

V1

V3

V4

Page 23: Approximate Distance Oracles

Consider a node v C(w), every node on a shortest path from v to w also belongs to C(w).

Distance Oracles Distance Oracles -- Properties Properties Thorup and Zwick (2005)Thorup and Zwick (2005)

v w

x Ai+1

y

Page 24: Approximate Distance Oracles

v belongs to C(pi(v)) for every

0≤ i ≤k-1.

Distance Oracles Distance Oracles -- Properties Properties Thorup and Zwick (2005)Thorup and Zwick (2005)

Page 25: Approximate Distance Oracles

From each cluster, construct a tree T(w) containing shortest path.

Distance OraclesDistance Oracles

wu

v

Page 26: Approximate Distance Oracles

The union of all these trees is a (2k-1)-spanner with O(kn1+1/k) edges.

Distance OraclesDistance Oracles