How to Grow Your Balls (Distance Oracles Beyond the Thorup – Zwick Bound)

26
How to Grow Your Balls (Distance Oracles Beyond the Thorup– Zwick Bound) Mihai Pătrașcu Liam Roditty FOCS’10

description

How to Grow Your Balls (Distance Oracles Beyond the Thorup – Zwick Bound). Mihai P ătra ș cu Liam Roditty FOCS’10. Distance Oracles. Distance oracle = replacement of APSP matrix - PowerPoint PPT Presentation

Transcript of How to Grow Your Balls (Distance Oracles Beyond the Thorup – Zwick Bound)

Page 1: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

How to Grow Your Balls(Distance Oracles Beyond the Thorup–Zwick Bound)

Mihai Pătrașcu Liam Roditty

FOCS’10

Page 2: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Distance Oracles

Distance oracle = replacement of APSP matrix[Thorup, Zwick STOC’01] For k=1,2,3,…:

Preprocess undirected, weighted graph G to answer:query(s,t): return đ with dG(s,t) ≤ đ ≤ (2k-1) · dG(s,t)

Space O(n1+1/k) with O(1) query time

Approximation Space1 n2

3 n1.5

5 n4/3

2k-1 n1+1/k

Page 3: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Two Sides of Distance Oracles

Compression question: Encode dense graphs with O(n1+1/k) bits,

such that (2k-1)-apx distances can be retrieved[Matoušek’96] ( ) finite metric space on ∀ n points

ℓ↦ ∞ with dimension O(k·n1+1/k lg n) with distortion 2k-1

Spanners: ( ) unweighted graph G∀ ( ) H G with O(∃ ⊆ n1+1/k) edges: dG ≤ dH ≤ (2k-1) dG

Data structures question: A data structure of size O(n1+1/k)

can answer (2k-1)-apx distance queries in constant time

~

~

Page 4: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Two Sides of Distance Oracles

Compression question: Encode dense graphs with O(n1+1/k) bits,

such that (2k-1)-apx distances can be retrieved[Matoušek’96] ( ) finite metric space on ∀ n points

ℓ↦ ∞ with dimension O(k·n1+1/k lg n) with distortion 2k-1

Spanners: ( ) unweighted graph G∀ ( ) H G with O(∃ ⊆ n1+1/k) edges: dG ≤ dH ≤ (2k-1) dG

Data structures question: A data structure of size O(n1+1/k)

can answer (2k-1)-apx distance queries in constant time

~

~

Optimal space, assuming:

Girth conjecture: [Erdős] et al.( ) graphs with ∃ Ω(n1+1/k) edges and girth 2k+2

Page 5: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Two Sides of Distance Oracles

Compression question: Encode dense graphs with O(n1+1/k) bits,

such that (2k-1)-apx distances can be retrieved[Matoušek’96] ( ) finite metric space on ∀ n points

ℓ↦ ∞ with dimension O(k·n1+1/k lg n) with distortion 2k-1

Spanners: ( ) unweighted graph G∀ ( ) H G with O(∃ ⊆ n1+1/k) edges: dG ≤ dH ≤ (2k-1) dG

Data structures question: A data structure of size O(n1+1/k)

can answer (2k-1)-apx distance queries in constant time

~

~

[Sommer, Verbin, Yu FOCS’09]Assume m=O(n) – sparse graphs.If c-apx distance queries take O(1) time

the space⇒ is ≥ n1+Ω(1/c)

Beat [Thorup, Zwick] for graphs with ≪ n1+1/k edges?

~

Page 6: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Two Sides of Distance Oracles

Compression question: Encode dense graphs with O(n1+1/k) bits,

such that (2k-1)-apx distances can be retrieved[Matoušek’96] ( ) finite metric space on ∀ n points

ℓ↦ ∞ with dimension O(k·n1+1/k lg n) with distortion 2k-1

Spanners: ( ) unweighted graph G∀ ( ) H G with O(∃ ⊆ n1+1/k) edges: dG ≤ dH ≤ (2k-1) dG

Data structures question: A data structure of size O(n1+1/k)

can answer (2k-1)-apx distance queries in constant time

~

~

Many other spanners:[BKMP’05] dH ≤ dG+6 with O(n4/3) edges

[EP’01] dH ≤ (1+ε) dG + O(1) with O(n1+δ) edges …

Use additive approximation in distance oracles?

Page 7: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

New Upper Bounds

Unweighted graphs:Preprocess any graph G distance oracle of size ⇒ O(n5/3) that finds distance ≤ 2dG + 1

Weighted graphs:Preprocess G with m=n2/α edges distance oracle of size ⇒ O(n2 / α1/3) with approximation 2

Can report path in O(1) / edge.

Page 8: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

The AlgorithmA = { } = sample n2/3 vertices

Page 9: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

The AlgorithmA = { } = sample n2/3 verticesB = { } = sample n1/3 vertices

Page 10: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

The AlgorithmA = { } = sample n2/3 verticesB = { } = sample n1/3 vertices

C = ∪u B ∈ Ball(u → A)

E[|C|]=n2/3

Data structure:• distances C ↔ V

Page 11: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

The AlgorithmA = { } = sample n2/3 verticesB = { } = sample n1/3 vertices

C = ∪u B ∈ Ball(u → A)

E[|C|]=n2/3

Data structure:• distances C ↔ V

Query(s,t):

st

Page 12: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

The AlgorithmA = { } = sample n2/3 verticesB = { } = sample n1/3 vertices

C = ∪u B ∈ Ball(u → A)

E[|C|]=n2/3

Data structure:• distances C ↔ V

Query(s,t):• Rs, Rt = distance to NN in C

• If Ball(s, Rs) ∩ Ball(t, Rt) = ∅ min { R⇒ s, Rt } ≤ ½ d(s,t)

Page 13: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

The AlgorithmA = { } = sample n2/3 verticesB = { } = sample n1/3 vertices

C = ∪u B ∈ Ball(u → A)

E[|C|]=n2/3

Data structure:• distances C ↔ V

Query(s,t):• Rs, Rt = distance to NN in C

• If Ball(s, Rs) ∩ Ball(t, Rt) = ∅ min { R⇒ s, Rt } ≤ ½ d(s,t)✔

Page 14: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

The AlgorithmA = { } = sample n2/3 verticesB = { } = sample n1/3 vertices

C = ∪u B ∈ Ball(u → A)

E[|C|]=n2/3

Data structure:• distances C ↔ V• pairs when Ball(s)∩Ball(t)

Query(s,t):• Rs, Rt = distance to NN in C

• If Ball(s, Rs) ∩ Ball(t, Rt) = ∅ min { R⇒ s, Rt } ≤ ½ d(s,t)✔

• If Ball(s, Rs) ∩ Ball(t, Rt) ≠ ∅

Page 15: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

The AlgorithmA = { } = sample n2/3 verticesB = { } = sample n1/3 vertices

C = ∪u B ∈ Ball(u → A)

E[|C|]=n2/3

Data structure:• distances C ↔ V• pairs when Ball(s)∩Ball(t)

Query(s,t):• Rs, Rt = distance to NN in C

• If Ball(s, Rs) ∩ Ball(t, Rt) = ∅ min { R⇒ s, Rt } ≤ ½ d(s,t)✔

• If Ball(s, Rs) ∩ Ball(t, Rt) ≠ ∅

Key observation:E[#pairs] = O(n5/3)

Page 16: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

The AlgorithmA = { } = sample n2/3 verticesB = { } = sample n1/3 vertices

C = ∪u B ∈ Ball(u → A)

E[|C|]=n2/3

Data structure:• distances C ↔ V• pairs when Ball(s)∩Ball(t)

Query(s,t):• Rs, Rt = distance to NN in C

• If Ball(s, Rs) ∩ Ball(t, Rt) = ∅ min { R⇒ s, Rt } ≤ ½ d(s,t)

• If Ball(s, Rs) ∩ Ball(t, Rt) ≠ ∅ ✔

This is a lie.

Page 17: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Geometric balls ≠ Balls in graphs

Weighted graphs:Ball(s,r)={edges adjacent to vertices at distance ≤ r}To bound ball, sample edges sparsity matters!⇒

s t

Page 18: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Geometric balls ≠ Balls in graphs

Weighted graphs:Ball(s,r)={edges adjacent to vertices at distance ≤ r}To bound ball, sample edges sparsity matters!⇒

Unweighted graphs:d(s,u) = d(t,v) = ½ d(⌈ s,t) ⌉Just accept additive 1…

s t

u v

Page 19: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Upper Bounds

Unweighted graphs:Preprocess any graph G distance oracle of size ⇒ O(n5/3) that finds distance ≤ 2dG + 1

Weighted graphs:Preprocess G with m=n2/α edges distance oracle of size ⇒ O(n2 / α1/3) with approximation 2

Can we get rid of “+1”for not-too-dense graphs?

Milder dependence on m?E.g. O(m + n5/3)

Better bounds?

Page 20: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Set-Intersection Hardness

Conjecture: Let X = lgO(1)n. If query time = O(1), space = Ω(n2)

Even in sparse graphs, approximation < 2 requires Ω(n2) space

Preprocess S1, …, Sn [⊆ X]query(i,j): is Si ∩ Sj =

?∅ ~

~

S1

Sn

1

X

Page 21: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Set-Intersection Hardness

Conjecture: Let X = lgO(1)n. If query time = O(1), space = Ω(n2)

Even in sparse graphs, approximation < 2 requires Ω(n2) space

Apx. (2-ε)dG + O(1) in unweighted graphs requires Ω(n2) space

Preprocess S1, …, Sn [⊆ X]query(i,j): is Si ∩ Sj =

?∅ ~

~

~

Page 22: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Set-Intersection Hardness

Conjecture: Let X = lgO(1)n. If query time = O(1), space = Ω(n2)

Even in sparse graphs, approximation < 2 requires Ω(n2) space

Apx. (2-ε)dG + O(1) in unweighted graphs requires Ω(n2) space

Preprocess S1, …, Sn [⊆ X]query(i,j): is Si ∩ Sj =

?∅ ~

~

~

Page 23: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

New Lower Bounds

Conjecture: Let X = lgO(1)n. If query time = O(1), space = Ω(n2)

In unweighted graphs with m=n2/α edges, constant-time 2-approximation needs space Ω(n2 / √α)

Constant-time approximation 2dG+O(1) needs space Ω(n1.5)

Preprocess S1, …, Sn [⊆ X]query(i,j): is Si ∩ Sj =

?∅ ~

~

~

Actually, randomized conjecture…

Page 24: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Lower Bound

In graphs with O(n) edges, 2-apx needs space Ω(n1.5)~~

(a,b)

[√n] ×[√n]

[√n] × X2 [√n] × X2

(c,d)

[√n] ×[√n]

(a,x,y)

(c,x,y)

Sab × Ta

Tc× Sab

(Sab ∩ Tc ≠ ∅) ∧ (Ta ∩ Scd ≠ ∅) ⇒ distance = 3

3-apx distance ≤ 5⇒

Page 25: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

Lower Bound

In graphs with O(n) edges, 2-apx needs space Ω(n1.5)~~

(a,b)

[√n] ×[√n]

[√n] × X2 [√n] × X2

(c,d)

[√n] ×[√n]

(a,x,y)

(c,x,y)

Sab × Ta

Tc× Sab

(Sab ∩ Tc ≠ ∅) ∧ (Ta ∩ Scd ≠ ∅) ⇒ distance = 3

3-apx distance ≤ 5⇒

⇒ either Ta ∩ Scd ≠ ∅ or Sab ∩ Tc ≠ ∅

(a,b’)

Page 26: How to Grow Your Balls (Distance Oracles Beyond the  Thorup – Zwick  Bound)

The EndRecent progress:• space Ω(n5/3) for 2-apx• many result for apx > 2

My flight is at 4:36. Questions @ 857-253-1282