optimal distributed all pairs shortest paths

87
Optimal Distributed All Pairs Shortest Paths ETH Zurich – Distributed Computing Group Stephan Holze ETH Zürich Roger Wattenhofer ETH Zürich

Upload: maren

Post on 22-Feb-2016

42 views

Category:

Documents


0 download

DESCRIPTION

Optimal Distributed All Pairs Shortest Paths . Stephan Holzer ETH Zürich Roger Wattenhofer ETH Zürich. ETH Zurich – Distributed Computing Group . TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Optimal Distributed  All Pairs Shortest Paths

1

Optimal Distributed All Pairs Shortest Paths

ETH Zurich – Distributed Computing Group

Stephan HolzerETH Zürich

Roger WattenhoferETH Zürich

Page 2: Optimal Distributed  All Pairs Shortest Paths

Distributed network Graph G of n nodes

2

4

51

3

Page 3: Optimal Distributed  All Pairs Shortest Paths

Distributed network Graph G of n nodes

2

4

51

3

Unique IDs

Page 4: Optimal Distributed  All Pairs Shortest Paths

Distributed network Graph G of n nodes

2

4

51

31 Local infor-

mation only

Unique IDs

Page 5: Optimal Distributed  All Pairs Shortest Paths

Distributed network Graph G of n nodes

2

4

51

32

13

Local infor-mation only

Unique IDs

Page 6: Optimal Distributed  All Pairs Shortest Paths

Distributed network Graph G of n nodes

2

4

51

32

13

Local infor-mation only

?

Unique IDs

Page 7: Optimal Distributed  All Pairs Shortest Paths

Distributed network Graph G of n nodes

2

4

51

3log n

log

nlog n log n

log n

log n

2

13

Local infor-mation only

?

Unique IDs

Limitedbandwidth

Page 8: Optimal Distributed  All Pairs Shortest Paths

Distributed network Graph G of n nodes

2

4

51

3log n

log

nlog n log n

log n

log n

2

13

Local infor-mation only

?Time complexity:

number of communication rounds

Synchronized

Internal computations

negligible

Unique IDs

Limitedbandwidth

Page 9: Optimal Distributed  All Pairs Shortest Paths

Distributed algorithms:a simple example

Page 10: Optimal Distributed  All Pairs Shortest Paths

Count the nodes!

Page 11: Optimal Distributed  All Pairs Shortest Paths

Count the nodes!

1. Compute BFS-Tree

Page 12: Optimal Distributed  All Pairs Shortest Paths

Count the nodes!

1

1

0

21

2

12

2

2

Runtime: ?

1. Compute BFS-Tree

2. Count nodes in subtrees

Page 13: Optimal Distributed  All Pairs Shortest Paths

Count the nodes!

Runtime: ?Diameter

1. Compute BFS-Tree

2. Count nodes in subtrees

1

1

0

21

2

12

2

2

Page 14: Optimal Distributed  All Pairs Shortest Paths

Diameter of a network

• Distance between two nodes = Number of hops of shortest path

Page 15: Optimal Distributed  All Pairs Shortest Paths

Diameter of a network

• Distance between two nodes = Number of hops of shortest path

Page 16: Optimal Distributed  All Pairs Shortest Paths

Diameter of a network

• Distance between two nodes = Number of hops of shortest path• Diameter of network = Maximum distance, between any two nodes

Page 17: Optimal Distributed  All Pairs Shortest Paths

Diameter of a network

• Distance between two nodes = Number of hops of shortest path• Diameter of network = Maximum distance, between any two nodes

Diameter of this network?

Page 18: Optimal Distributed  All Pairs Shortest Paths

• Spanning Tree – Broadcasting, Aggregation, etc• Minimum Spanning Tree – Efficient broadcasting,

etc. • Shortest path – Routing, etc.• Steiner tree – Multicasting, etc. • Many other graph problems.

• Diameter appears frequently in distributed computing

Fundamental problems

Page 19: Optimal Distributed  All Pairs Shortest Paths

• Spanning Tree – Broadcasting, Aggregation, etc• Minimum Spanning Tree – Efficient broadcasting,

etc. • Shortest path – Routing, etc.• Steiner tree – Multicasting, etc. • Many other graph problems.

• Diameter appears frequently in distributed computing

• E.g. local vs. global

Fundamental problems

Page 20: Optimal Distributed  All Pairs Shortest Paths

• Spanning Tree – Broadcasting, Aggregation, etc• Minimum Spanning Tree – Efficient broadcasting,

etc. • Shortest path – Routing, etc.• Steiner tree – Multicasting, etc. • Many other graph problems.

• Diameter appears frequently in distributed computing

• E.g. local vs. global

Fundamental problems 1. Formal definition?

Complexity of computing D? .

Known bounds: O(nD) Ω (D)[before 2012]

≈O(n2) ≈(1)

Page 21: Optimal Distributed  All Pairs Shortest Paths

• Spanning Tree – Broadcasting, Aggregation, etc• Minimum Spanning Tree – Efficient broadcasting,

etc. • Shortest path – Routing, etc.• Steiner tree – Multicasting, etc. • Many other graph problems.

• Diameter appears frequently in distributed computing

• E.g. local vs. global

Fundamental problems 1. Formal definition?

Complexity of computing D? .

Known bounds: O(nD) Ω (D)

New bounds: Ω (n)

[before 2012]≈O(n2) ≈(1)

[FHW 2012]

Even if D = 5

[2012]

Page 22: Optimal Distributed  All Pairs Shortest Paths

• Spanning Tree – Broadcasting, Aggregation, etc• Minimum Spanning Tree – Efficient broadcasting,

etc. • Shortest path – Routing, etc.• Steiner tree – Multicasting, etc. • Many other graph problems.

• Diameter appears frequently in distributed computing

• E.g. local vs. global

Fundamental problems

Complexity of computing D? .

Known bounds: O(nD) Ω (D)

New bounds: O(n) Ω (n)

[before 2012]≈O(n2) ≈(1)

[FHW 2012]

Even if D = 5

[here]3

1. Formal definition?

Page 23: Optimal Distributed  All Pairs Shortest Paths

• Spanning Tree – Broadcasting, Aggregation, etc• Minimum Spanning Tree – Efficient broadcasting,

etc. • Shortest path – Routing, etc.• Steiner tree – Multicasting, etc. • Many other graph problems.

• Diameter appears frequently in distributed computing

• E.g. local vs. global

Fundamental problems

Complexity of computing D? .

Known bounds: O(nD) Ω (D)

New bounds: O(n) Ω (n)

[before 2012]≈O(n2) ≈(1)

[FHW 2012]

Even if D = 5

[here]3

Independently: [Peleg, Roditty, Tal 2012]

1. Formal definition?

Use APSP to Compute Diameter

Page 24: Optimal Distributed  All Pairs Shortest Paths

Extentions

Page 25: Optimal Distributed  All Pairs Shortest Paths

ExtentionsRouting tables

Social networks

Fighting spam

Page 26: Optimal Distributed  All Pairs Shortest Paths

Extentions

Combination with: [Peleg, Roditty, Tal 2012]

Page 27: Optimal Distributed  All Pairs Shortest Paths

Extentions

Combined with [Peleg, Roditty, Tal 2012]

Page 28: Optimal Distributed  All Pairs Shortest Paths

APSP in O(n)

Page 29: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest Paths

0

APSP in O(n)

Page 30: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest Paths

0

APSP in O(n)

Knows its distance to all other nodes

Page 31: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest Paths

0

APSP in O(n)

Page 32: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node {

compute distances to all other nodes;}

0

APSP in O(n)

Page 33: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node {

compute distances to all other nodes;}

1

1

0

1

1

APSP in O(n)

Page 34: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node {

compute distances to all other nodes;}

1

1

0

21

2

12

2

2

APSP in O(n)

Page 35: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node {

compute distances to all other nodes; O(D)}

1

1

0

21

2

12

2

2

APSP in O(n)

Page 36: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node {

compute distances to all other nodes; O(D)}

0

APSP in O(n)

Page 37: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node {

compute distances to all other nodes; O(D)}

1

10

1

1

APSP in O(n)

Page 38: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node {

compute distances to all other nodes; O(D)}

2

2

22

1

10

1

1

APSP in O(n)

Page 39: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node {

compute distances to all other nodes; O(D)}

2

22

1

10

1

12

3

APSP in O(n)

Page 40: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node { O(n)

compute distances to all other nodes; O(D)}

2

22

1

10

1

12

3

APSP in O(n)

Page 41: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node { O(n)

compute distances to all other nodes; O(D)} O(nD)

2

22

1

10

1

12

3

APSP in O(n)

Page 42: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node { O(n)

compute distances to all other nodes; O(D)} O(nD)

Limited parallelism:Only some nodes active.

2

22

1

10

1

12

3

APSP in O(n)

Page 43: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest PathsFor each node { O(n)

compute distances to all other nodes; O(D)} O(nD)

Limited parallelism:Only some nodes active.

Wanted: All nodes active all the time!

2

22

1

10

1

12

3

APSP in O(n)

Page 44: Optimal Distributed  All Pairs Shortest Paths

Compute All Pairs Shortest Paths

APSP in O(n)

Page 45: Optimal Distributed  All Pairs Shortest Paths

r

1. Pick a root-node rCompute All Pairs Shortest Paths

APSP in O(n)

Page 46: Optimal Distributed  All Pairs Shortest Paths

r

1. Pick a root-node r2. T := BFS-Tree(r)

Compute All Pairs Shortest Paths

APSP in O(n)

Page 47: Optimal Distributed  All Pairs Shortest Paths

r

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;

Compute All Pairs Shortest Paths

APSP in O(n)

Page 48: Optimal Distributed  All Pairs Shortest Paths

r

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot;start shortest paths(v);

}

Compute All Pairs Shortest Paths

APSP in O(n)

Page 49: Optimal Distributed  All Pairs Shortest Paths

r

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot;start shortest paths(v);

}

Compute All Pairs Shortest Paths

APSP in O(n)

v

u

w

Page 50: Optimal Distributed  All Pairs Shortest Paths

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot;start shortest paths(v);

}

Compute All Pairs Shortest Paths

v

u Starts at t

w

APSP in O(n)

Page 51: Optimal Distributed  All Pairs Shortest Paths

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot;start shortest paths(v);

}

Compute All Pairs Shortest Paths

Starts at t

v

u

w

APSP in O(n)

Page 52: Optimal Distributed  All Pairs Shortest Paths

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot;start shortest paths(v);

}

Compute All Pairs Shortest Paths

Starts at t

w

v

u

APSP in O(n)

Arrives at

Page 53: Optimal Distributed  All Pairs Shortest Paths

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot;start shortest paths(v);

}

Compute All Pairs Shortest Paths

Starts at t

w

v

u

APSP in O(n)

Arrives at

Page 54: Optimal Distributed  All Pairs Shortest Paths

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot;start shortest paths(v);

}

Compute All Pairs Shortest Paths

Starts at t

w

v

u

APSP in O(n)

Arrives at

Page 55: Optimal Distributed  All Pairs Shortest Paths

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot; start shortest paths(v);

}

Compute All Pairs Shortest Paths

Starts at t

Arrives at Arrives at

w

v

u

APSP in O(n)

Page 56: Optimal Distributed  All Pairs Shortest Paths

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot;start shortest paths(v);

}

Compute All Pairs Shortest Paths

Starts at t

Arrives at Arrives at

w

v

u

APSP in O(n)

Page 57: Optimal Distributed  All Pairs Shortest Paths

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot;start shortest paths(v);

}

Compute All Pairs Shortest Paths

Starts at t

Arrives at Arrives at +1

w

v

u

APSP in O(n)

Page 58: Optimal Distributed  All Pairs Shortest Paths

Starts at t

Arrives at Arrives at +1

w

v

u

APSP in O(n)

v never active for u and wat the same time!

True for any trippel.No congestion!

Runtime: O(n +D) = O(n)

1. Pick a root-node r;2. T := BFS-Tree(r);3. Pebble P traverses T

in preorder;4. If P visits node v first time{

wait 1 timeslot;start shortest paths(v);

}

Compute All Pairs Shortest Paths

Page 59: Optimal Distributed  All Pairs Shortest Paths

APSP-Application:Compute Diameter in O(n)

Page 60: Optimal Distributed  All Pairs Shortest Paths

APSP-Application:Compute Diameter in O(n)

Optimal?

Page 61: Optimal Distributed  All Pairs Shortest Paths

Diameter Lower Bound!

Page 62: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 63: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 64: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 65: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 66: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 67: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 68: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 69: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 70: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 71: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

information

Page 72: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

information

n log n bandwidth

≈(n)

Page 73: Optimal Distributed  All Pairs Shortest Paths

Extentions

Page 74: Optimal Distributed  All Pairs Shortest Paths

Extentions

Page 75: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 76: Optimal Distributed  All Pairs Shortest Paths

Diameter of Network? Diameter Lower Bound!

Page 77: Optimal Distributed  All Pairs Shortest Paths

S-Shortest Path in O(|S| + D)(x,1+ε)-Approximating Diameter

Page 78: Optimal Distributed  All Pairs Shortest Paths

S-Shortest Path in O(|S| + D)

Shortest paths between S x V

(x,1+ε)-Approximating Diameter

Page 79: Optimal Distributed  All Pairs Shortest Paths

S-Shortest Path in O(|S| + D)(x,1+ε)-Approximating Diameter

Page 80: Optimal Distributed  All Pairs Shortest Paths

S-Shortest Path in O(|S| + D)

S:= Minimum O(D/ε)-Domingating Set

(x,1+ε)-Approximating Diameter

[Kutten, Peleg 1998]

Page 81: Optimal Distributed  All Pairs Shortest Paths

S-Shortest Path in O(|S| + D)

S:= Minimum O(D/ε)-Domingating Set

Runtime: O(n/D + D)

(x,1+ε)-Approximating Diameter

[Kutten, Peleg 1998]

Page 82: Optimal Distributed  All Pairs Shortest Paths

S-Shortest Path in O(|S| + D)

S:= Minimum O(D/ε)-Domingating Set

Runtime: O(n/D + D) Maximal Error: D/ε vs. D

(x,1+ε)-Approximating Diameter

[Kutten, Peleg 1998]

Page 83: Optimal Distributed  All Pairs Shortest Paths

S-Shortest Path in O(|S| + D)

S:= Minimum O(D/ε)-Domingating Set

Runtime: O(n/D + D) Maximal Error: D/ε vs. D

(x,1+ε)-Approximating Diameter

[Kutten, Peleg 1998]

Page 84: Optimal Distributed  All Pairs Shortest Paths

Extentions

[Peleg, Roditty, Tal 2012]:(x, 3/2)-approximate diameter O(

Page 85: Optimal Distributed  All Pairs Shortest Paths

Extentions

[Peleg, Roditty, Tal 2012]:(x, 3/2)-approximate diameter O(

Page 86: Optimal Distributed  All Pairs Shortest Paths

Summary

Diameter Ө(n)APSP O(n)

r

v

u

w

APSP Ω(n)

S-Shortest Paths O(|S| + D)

Page 87: Optimal Distributed  All Pairs Shortest Paths

Thanks!