Distributed Algorithms Tutorial Roger Wattenhofer ETH Zurich - - PowerPoint PPT Presentation

distributed algorithms
SMART_READER_LITE
LIVE PREVIEW

Distributed Algorithms Tutorial Roger Wattenhofer ETH Zurich - - PowerPoint PPT Presentation

Distributed Algorithms Tutorial Roger Wattenhofer ETH Zurich Distributed Computing www.disco.ethz.ch Distributed Algorithms Message Shared Passing Memory Example: Maximal Independent Set (MIS) Given a network with n nodes, nodes


slide-1
SLIDE 1

ETH Zurich – Distributed Computing – www.disco.ethz.ch

Roger Wattenhofer

Distributed Algorithms

Tutorial

slide-2
SLIDE 2

Distributed Algorithms Message Passing Shared Memory

slide-3
SLIDE 3
slide-4
SLIDE 4

Example: Maximal Independent Set (MIS)

  • Given a network with n nodes, nodes have unique IDs.
  • Find a Maximal Independent Set (MIS)

– a non-extendable set of pair-wise non-adjacent nodes 69 17 11 10 7

slide-5
SLIDE 5

Example: Maximal Independent Set (MIS)

  • Given a network with n nodes, nodes have unique IDs.
  • Find a Maximal Independent Set (MIS)

– a non-extendable set of pair-wise non-adjacent nodes 69 17 11 10 7

slide-6
SLIDE 6

Example: Maximal Independent Set (MIS)

  • Given a network with n nodes, nodes have unique IDs.
  • Find a Maximal Independent Set (MIS)

– a non-extendable set of pair-wise non-adjacent nodes 69 17 11 10 7

slide-7
SLIDE 7

Example: Maximal Independent Set (MIS)

  • Given a network with n nodes, nodes have unique IDs.
  • Find a Maximal Independent Set (MIS)

– a non-extendable set of pair-wise non-adjacent nodes

 

11 10 7

slide-8
SLIDE 8

Example: Maximal Independent Set (MIS)

  • Given a network with n nodes, nodes have unique IDs.
  • Find a Maximal Independent Set (MIS)

– a non-extendable set of pair-wise non-adjacent nodes 69 17 11 10 7

slide-9
SLIDE 9

Example: Maximal Independent Set (MIS)

  • Given a network with n nodes, nodes have unique IDs.
  • Find a Maximal Independent Set (MIS)

– a non-extendable set of pair-wise non-adjacent nodes

  • Traditional (sequential) computation:

The simple greedy algorithm finds MIS (in linear time)

69 17 11 10 7

slide-10
SLIDE 10

What about a Distributed Algorithm?

  • Nodes are agents with unique ID’s that can communicate with neighbors

by sending messages. In each synchronous round, every node can send a (different) message to each neighbor.

69 17 11 10 7

slide-11
SLIDE 11

What about a Distributed Algorithm?

  • Nodes are agents with unique ID’s that can communicate with neighbors

by sending messages. In each synchronous round, every node can send a (different) message to each neighbor.

69 17 11 10 7

slide-12
SLIDE 12

A Simple Distributed Algorithm

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS

69 17 11 10 7

slide-13
SLIDE 13

A Simple Distributed Algorithm

69 17 11 10 7

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS
slide-14
SLIDE 14

A Simple Distributed Algorithm

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS
  • What’s the problem with this distributed algorithm?

69 17 11 10 7

slide-15
SLIDE 15

Example

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS

69 17 11 10 7 4 3 1

slide-16
SLIDE 16

Example

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS

69 17 11 10 7 4 3 1

slide-17
SLIDE 17

Example

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS
  • What if we have minor changes?

69 17 11 10 7 4 3 1 69 17 11 10 7 4 3 1

slide-18
SLIDE 18

Example

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS
  • What if we have minor changes?

69 17 11 10 7 4 3 1 69 17 11 10 7 4 3 1

slide-19
SLIDE 19

Example

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS
  • What if we have minor changes?

69 17 11 10 7 4 3 1 69 17 11 10 7 4 3 1

slide-20
SLIDE 20

Example

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS
  • What if we have minor changes?

69 17 11 10 7 4 3 1 69 17 11 10 7 4 3 1

slide-21
SLIDE 21

Example

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS
  • What if we have minor changes?

69 17 11 10 7 4 3 1 69 17 11 10 7 4 3 1

slide-22
SLIDE 22

Example

  • Wait until all neighbors with higher ID decided
  • If no higher ID neighbor is in MIS  join MIS
  • What if we have minor changes?
  • Proof by animation: In the worst case, the algorithm is slow (linear in the

number of nodes). In addition, we have a terrible „butterfly effect“.

69 17 11 10 7 4 3 1 69 17 11 10 7 4 3 1

slide-23
SLIDE 23

What about a Fast Distributed Algorithm?

  • Can you find a distributed algorithm that is polylogarithmic in the number
  • f nodes n, for any graph?

69 17 11 10 7 69 17 11 10 7 4 3 1

slide-24
SLIDE 24

What about a Fast Distributed Algorithm?

  • Surprisingly, for deterministic distributed algorithms, this is an
  • pen problem!
  • However, randomization helps! In each synchronous round, nodes should

choose a random value. If your value is larger than the value of your neighbors, join MIS!

slide-25
SLIDE 25

What about a Fast Distributed Algorithm?

  • Surprisingly, for deterministic distributed algorithms, this is an
  • pen problem!
  • However, randomization helps! In each synchronous round, nodes should

choose a random value. If your value is larger than the value of your neighbors, join MIS!

69 17 21 10 7

slide-26
SLIDE 26

What about a Fast Distributed Algorithm?

  • Surprisingly, for deterministic distributed algorithms, this is an
  • pen problem!
  • However, randomization helps! In each synchronous round, nodes should

choose a random value. If your value is larger than the value of your neighbors, join MIS!

69 17 21 10 7

slide-27
SLIDE 27

What about a Fast Distributed Algorithm?

  • Surprisingly, for deterministic distributed algorithms, this is an
  • pen problem!
  • However, randomization helps! In each synchronous round, nodes should

choose a random value. If your value is larger than the value of your neighbors, join MIS!

  • How many synchronous rounds does this take in expectation (or whp)?

69 17 21 10 7

slide-28
SLIDE 28

Analysis

  • Event (𝑣 → 𝑤) : node 𝑣 got largest random value

in combined neighborhood 𝑂𝑣 ∪ 𝑂𝑤.

  • We only count edges of 𝑤 as deleted.
  • Similarly event (𝑤 → 𝑣) deletes edges of 𝑣.
  • We only double-counted edges.
  • Using linearity of expectation, in expectation

at least half of the edges are removed in each round.

  • In other words, whp it takes 𝑃(log 𝑜) rounds to compute an MIS.

𝑣 𝑤

slide-29
SLIDE 29

Results: MIS

1 log∗ 𝑜 log 𝑜 𝑜𝜗 𝑜

General Graphs, Randomized [Alon, Babai, and Itai, 1986] [Israeli and Itai, 1986] [Luby, 1986] [Métivier et al., 2009] Naïve Algo Decomposition, Determ. [Awerbuch et al., 1989] [Panconesi et al., 1996]

slide-30
SLIDE 30

Local Algorithms

  • Each node can exchange a message with all neighbors, for t

communication rounds, and must then decide.

  • Or: Given a graph, each node must determine its decision as a function of

the information available within radius t of the node.

  • Or: Change can only affect nodes up to distance t.
  • Or: …

v

slide-31
SLIDE 31

Local Algorithms

Locality

Sublinear Algorithms

slide-32
SLIDE 32

Local Algorithms

Locality is Everywhere!

Self- Stabilization Dynamics Self- Assembling Robots Sublinear Algorithms Applications e.g. Multicore

slide-33
SLIDE 33

Local Algorithms

Locality is Everywhere!

Self- Stabilization Dynamics Self- Assembling Robots Sublinear Algorithms Applications e.g. Multicore

slide-34
SLIDE 34

[Afek, Alon, Barad, et al., 2011]

slide-35
SLIDE 35

What about an Even Faster Distributed Algorithm?

  • Since the 1980s, nobody was able to improve this simple algorithm.
  • What about lower bounds?
  • There is an interesting lower bound, essentially using a Ramsey theory

argument, that proves that an MIS needs at least Ω(log*n) time.

– log* is the so-called iterated logarithm – how often you need to take the logarithm until you end up with a value smaller than 1. – This lower bound already works on simple networks such as the linked list

slide-36
SLIDE 36
  • Build graph 𝐻𝑢, where nodes are possible views of nodes for distributed

algorithms of time 𝑢. Connect views that could be neighbors in ring.

  • Here is for instance of 𝐻1:
  • Chromatic number of 𝐻𝑢 is exactly minimum possible colors in time 𝑢.

Coloring Lower Bound on Oriented Ring

2 3 6 1 2 3 4 2 3 3 6 7 3 6 9

slide-37
SLIDE 37
  • Build graph 𝐻𝑢, where nodes are possible views of nodes for distributed

algorithms of time 𝑢. Connect views that could be neighbors in ring.

  • Here is for instance of 𝐻1:
  • Chromatic number of 𝐻𝑢 is exactly minimum possible colors in time 𝑢.

Coloring Lower Bound on Oriented Ring

2 3 6 1 2 3 3 6 7 3 6 9

slide-38
SLIDE 38

Results: MIS

1 log∗ 𝑜 log 𝑜 𝑜𝜗 𝑜

Linked List [Linial, 1992] General Graphs, Randomized [Alon, Babai, and Itai, 1986] [Israeli and Itai, 1986] [Luby, 1986] [Métivier et al., 2009] Naïve Algo Decomposition, Determ. [Awerbuch et al., 1989] [Panconesi et al., 1996]

slide-39
SLIDE 39

Results: MIS

1 log∗ 𝑜 log 𝑜 𝑜𝜗 𝑜

Linked List [Linial, 1992] General Graphs, Randomized [Alon, Babai, and Itai, 1986] [Israeli and Itai, 1986] [Luby, 1986] [Métivier et al., 2009] Linked List, Deterministic [Cole and Vishkin, 1986] Decomposition, Determ. [Awerbuch et al., 1989] [Panconesi et al., 1996] Naïve Algo

slide-40
SLIDE 40

Results: MIS

1 log∗ 𝑜 log 𝑜 𝑜𝜗 𝑜

Linked List [Linial, 1992] General Graphs, Randomized [Alon, Babai, and Itai, 1986] [Israeli and Itai, 1986] [Luby, 1986] [Métivier et al., 2009] Linked List, Deterministic [Cole and Vishkin, 1986] Growth-Bounded Graphs [Schneider et al., 2008] |𝐽𝑇 𝑂2 | ∈ 𝑃(1) Decomposition, Determ. [Awerbuch et al., 1989] [Panconesi et al., 1996] Naïve Algo

slide-41
SLIDE 41

Results: MIS

1 log∗ 𝑜 log 𝑜 𝑜𝜗 𝑜

Linked List [Linial, 1992] General Graphs, Randomized [Alon, Babai, and Itai, 1986] [Israeli and Itai, 1986] [Luby, 1986] [Métivier et al., 2009] Linked List, Deterministic [Cole and Vishkin, 1986] Growth-Bounded Graphs [Schneider et al., 2008] |𝐽𝑇 𝑂2 | ∈ 𝑃(1) Other problems e.g., [Kuhn et al., 2006] e.g., covering/packing LPs with only local constraints: constant approximation in time 𝑃(log 𝑜) or 𝑃(log2 Δ) e.g., coloring, CDS, matching, max-min LPs, facility location Decomposition, Determ. [Awerbuch et al., 1989] [Panconesi et al., 1996] Naïve Algo

slide-42
SLIDE 42

Results: MIS

1 log∗ 𝑜 log 𝑜 𝑜𝜗 𝑜

Linked List [Linial, 1992] General Graphs, Randomized [Alon, Babai, and Itai, 1986] [Israeli and Itai, 1986] [Luby, 1986] [Métivier et al., 2009] Linked List, Deterministic [Cole and Vishkin, 1986] Growth-Bounded Graphs [Schneider et al., 2008] |𝐽𝑇 𝑂2 | ∈ 𝑃(1) Other problems e.g., [Kuhn et al., 2006] General Graphs [Kuhn et al., 2004, 2006] e.g., covering/packing LPs with only local constraints: constant approximation in time 𝑃(log 𝑜) or 𝑃(log2 Δ) e.g., coloring, CDS, matching, max-min LPs, facility location Decomposition, Determ. [Awerbuch et al., 1989] [Panconesi et al., 1996] Naïve Algo

slide-43
SLIDE 43

Example: Minimum Vertex Cover (MVC)

  • Given a network with n nodes, nodes have unique IDs.
  • Find a Minimum Vertex Cover (MVC)

– a minimum set of nodes such that all edges are adjacent to node in MVC 69 17 11 10 7

slide-44
SLIDE 44

Example: Minimum Vertex Cover (MVC)

  • Given a network with n nodes, nodes have unique IDs.
  • Find a Minimum Vertex Cover (MVC)

– a minimum set of nodes such that all edges are adjacent to node in MVC 69 17 11 10 7

slide-45
SLIDE 45

Example: Minimum Vertex Cover (MVC)

  • Given a network with n nodes, nodes have unique IDs.
  • Find a Minimum Vertex Cover (MVC)

– a minimum set of nodes such that all edges are adjacent to node in MVC 69 17 11 10 7

slide-46
SLIDE 46

Differences between MIS and MVC

  • Central (non-local) algorithms: MIS is trivial, whereas MVC is NP-hard
  • Instead: Find an MVC that is “close” to minimum (approximation)
  • Trade-off between time complexity and approximation ratio
  • MVC: Various simple (non-distributed) 2-approximations exist!
  • What about distributed algorithms?!?

69 17 11 10 7

slide-47
SLIDE 47

𝑇1

Finding the MVC (by Distributed Algorithm)

  • Given the following bipartite graph with 𝑇0 = 𝜀 𝑇1
  • The MVC is just all the nodes in 𝑇1
  • Distributed Algorithm…

𝑇0

slide-48
SLIDE 48

𝑇1

Finding the MVC (by Distributed Algorithm)

𝑇0

  • Given the following bipartite graph with 𝑇0 = 𝜀 𝑇1
  • The MVC is just all the nodes in 𝑇1
  • Distributed Algorithm…
slide-49
SLIDE 49

𝑇1

Finding the MVC (by Distributed Algorithm)

𝑇0

  • Given the following bipartite graph with 𝑇0 = 𝜀 𝑇1
  • The MVC is just all the nodes in 𝑇1
  • Distributed Algorithm…
slide-50
SLIDE 50

𝑇1 𝑇0

7 7 7 7 7 7 7 7 3 2 1 3 4 1 1 2 1 4 4 2 2 4 1 1

𝑂2(node in 𝑇0) 𝑂2(node in 𝑇1)

slide-51
SLIDE 51

𝑇1 𝑇0

7 7 7 7 7 7 7 7 3 2 1 3 4 1 1 2 1 4 4 2 2 4 1 1

𝑂2(node in 𝑇0) 𝑂2(node in 𝑇1)

Graph is “symmetric”, yet highly non-regular!

slide-52
SLIDE 52

Lower Bound: The Argument

  • The example graph is for t = 3.
  • All edges are in fact special bipartite graphs

with large enough girth.

  • If you use the graph of recursion level t, then a distributed algorithm

cannot find a good MVC approximation in time t.

slide-53
SLIDE 53

Lower Bound: The Math

  • Choose degrees 𝜀𝑗 such that 𝜀𝑗+1 𝜀𝑗

= 2𝑗𝜀.

  • We have 𝑇0 > 𝜀/2 𝑀1 , with 𝑀1 nodes on level 1
slide-54
SLIDE 54

Lower Bound: The Math

  • Choose degrees 𝜀𝑗 such that 𝜀𝑗+1 𝜀𝑗

= 2𝑗𝜀.

  • We have 𝑇0 > 𝜀/2 𝑀1 , with 𝑀1 nodes on level 1
  • By induction we have a (1 − Θ(1/δ)) fraction of the nodes is in 𝑇0.
  • Now δ, 𝑜, Δ are depending on the recursion level 𝑢.
slide-55
SLIDE 55

Lower Bound: The Math

  • Choose degrees 𝜀𝑗 such that 𝜀𝑗+1 𝜀𝑗

= 2𝑗𝜀.

  • We have 𝑇0 > 𝜀/2 𝑀1 , with 𝑀1 nodes on level 1
  • By induction we have a (1 − Θ(1/δ)) fraction of the nodes is in 𝑇0.
  • Now δ, 𝑜, Δ are depending on the recursion level 𝑢.

Graph useful for proving lower bounds in sublinear algos?

slide-56
SLIDE 56

Lower Bound: Results

  • We can show that for 𝜗 > 0, in 𝑢 time, the approximation ratio is at least
  • Constant approximation needs at least Ω(log Δ) and Ω( log 𝑜) time.
  • Polylog approximation Ω(log Δ/ log log Δ) and Ω( log 𝑜/ log log 𝑜).

𝑢 𝑢

slide-57
SLIDE 57

Lower Bound: Results

  • We can show that for 𝜗 > 0, in 𝑢 time, the approximation ratio is at least
  • Constant approximation needs at least Ω(log Δ) and Ω( log 𝑜) time.
  • Polylog approximation Ω(log Δ/ log log Δ) and Ω( log 𝑜/ log log 𝑜).

𝑢 𝑢

tight for MVC

slide-58
SLIDE 58

Lower Bound: Reductions

  • Many “local looking” problems need non-trivial t, in other words, the

bounds Ω(log Δ) and Ω( log 𝑜) hold for a variety of classic problems.

slide-59
SLIDE 59

Lower Bound: Reductions

  • Many “local looking” problems need non-trivial t, in other words, the

bounds Ω(log Δ) and Ω( log 𝑜) hold for a variety of classic problems.

line graph cloning MVC through MM line graph

slide-60
SLIDE 60

Results: MIS

1 log∗ 𝑜 log 𝑜 … log 𝑜 𝑜𝜗 𝑜

Linked List [Linial, 1992] General Graphs, Randomized [Alon, Babai, and Itai, 1986] [Israeli and Itai, 1986] [Luby, 1986] [Métivier et al., 2009] Linked List, Deterministic [Cole and Vishkin, 1986] Growth-Bounded Graphs [Schneider et al., 2008] |𝐽𝑇 𝑂2 | ∈ 𝑃(1) Other problems e.g., [Kuhn et al., 2006] General Graphs [Kuhn et al., 2004, 2006] e.g., covering/packing LPs with only local constraints: constant approximation in time 𝑃(log 𝑜) or 𝑃(log2 Δ) e.g., coloring, CDS, matching, max-min LPs, facility location Decomposition, Determ. [Awerbuch et al., 1989] [Panconesi et al., 1996] Naïve Algo

slide-61
SLIDE 61
slide-62
SLIDE 62
slide-63
SLIDE 63

Summary

1 log*n log 𝑜 … log 𝑜 Diameter

MIS, maximal matching, etc. Growth-Bounded Graphs (various problems) MST, Sum, etc. Approximations of dominating set, vertex cover, etc. Covering and packing LPs E.g., dominating set approximation in planar graphs

slide-64
SLIDE 64

Thank You!

Questions & Comments?

Thanks to my co-authors Fabian Kuhn Thomas Moscibroda Johannes Schneider www.disco.ethz.ch

slide-65
SLIDE 65

Open Problems

  • Close the gap between log 𝑜 and log 𝑜 (for randomized algorithms)!
  • Find a fast deterministic MIS algorithm (or strong det. lower bound)!
  • Where are the boundaries between constant, log*, log, and diameter?
  • What about algorithms that cannot even exchange messages?
  • Can the lower bound graph be used in the context of sublinear

algorithms?