Distributed minimum spanning tree problem Kustaa Kangas University - - PowerPoint PPT Presentation

distributed minimum spanning tree problem
SMART_READER_LITE
LIVE PREVIEW

Distributed minimum spanning tree problem Kustaa Kangas University - - PowerPoint PPT Presentation

Distributed minimum spanning tree problem Kustaa Kangas University of Helsinki, Finland November 8, 2012 K. Kangas (U. Helsinki) Distributed minimum spanning tree problem November 8, 2012 1 / 59 Minimum spanning tree A spanning tree of an


slide-1
SLIDE 1

Distributed minimum spanning tree problem

Kustaa Kangas

University of Helsinki, Finland

November 8, 2012

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 1 / 59

slide-2
SLIDE 2

Minimum spanning tree

A spanning tree of an undirected graph is a subtree containing all vertices.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 2 / 59

slide-3
SLIDE 3

Minimum spanning tree

A spanning tree of an undirected graph is a subtree containing all vertices.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 3 / 59

slide-4
SLIDE 4

Minimum spanning tree

A spanning tree of an undirected graph is a subtree containing all vertices.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 4 / 59

slide-5
SLIDE 5

Minimum spanning tree

For a weighted graph, the weight of a spanning tree is the sum of the weights of its edges. A tree with a minimum weight is called a minimum spanning tree. For simplicity assume that all weights are disctinct so the MST is unique (proof in the report).

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 5 / 59

slide-6
SLIDE 6

Minimum spanning tree

For a weighted graph, the weight of a spanning tree is the sum of the weights of its edges. A tree with a minimum weight is called a minimum spanning tree. For simplicity assume that all weights are disctinct so the MST is unique (proof in the report).

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 6 / 59

slide-7
SLIDE 7

Finding minimum spanning tree

How to find the MST of a given graph? Fast and simple centralized algorithms: Kruskal: add edges greedily, avoid cycles. Prim: expand a single fragment greedily. Run in O(|E| log |N|).

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 7 / 59

slide-8
SLIDE 8

Kruskal’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 8 / 59

slide-9
SLIDE 9

Kruskal’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 9 / 59

slide-10
SLIDE 10

Kruskal’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 10 / 59

slide-11
SLIDE 11

Kruskal’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 11 / 59

slide-12
SLIDE 12

Kruskal’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 12 / 59

slide-13
SLIDE 13

Kruskal’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 13 / 59

slide-14
SLIDE 14

Kruskal’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 14 / 59

slide-15
SLIDE 15

Finding minimum spanning tree

How to find the MST of a given graph? Fast and simple centralized algorithms: Kruskal: add edges greedily, avoid cycles. Prim: expand a single fragment greedily. Run in O(|E| log |N|).

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 15 / 59

slide-16
SLIDE 16

Prim’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 16 / 59

slide-17
SLIDE 17

Prim’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 17 / 59

slide-18
SLIDE 18

Prim’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 18 / 59

slide-19
SLIDE 19

Prim’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 19 / 59

slide-20
SLIDE 20

Prim’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 20 / 59

slide-21
SLIDE 21

Prim’s algorithm

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 21 / 59

slide-22
SLIDE 22

Finding minimum spanning tree

Fast and common in the centralized setting. Slow in the distributed setting: Kruskal: requires global knowledge of the graph. Prim: requires communication within a large fragment.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 22 / 59

slide-23
SLIDE 23

Finding minimum spanning tree

Adding the minimum weight outgoing edge of any known fragment of the MST produces a new fragment of the MST.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 23 / 59

slide-24
SLIDE 24

Finding minimum spanning tree

Idea: Start with one fragment per node. Each fragment finds the minimum weight outgoing edge independently.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 24 / 59

slide-25
SLIDE 25

Finding minimum spanning tree

Fragments with a common minimum weight outgoing edge combine until there is one fragment containing the whole MST.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 25 / 59

slide-26
SLIDE 26

Model of computation

A classical algorithm by Gallager et al. [1983] does this in the asynchronous message passing model: Each node runs the same simple local algorithm. Each node initially knows only the weights of its incident edges. Adjacent nodes can exchange (short) messages. Asynchronous: messages arrive after an unknown but bounded delay. Performance measured in time and message complexity.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 26 / 59

slide-27
SLIDE 27

Maintaining fragments on node level

Each node keeps track of which incident edges are part of its fragment. How to find the minimum weight outgoing edge? Trivial for single nodes: just pick the minimum weight incident edge.

All nodes know which incident edges are in the fragment.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 27 / 59

slide-28
SLIDE 28

Maintaining fragments on node level

How about larger fragments? When two fragments combine, the edge joining them becomes the core of the new fragment. It serves as

1 a unique identity of the fragment 2 a hub of computation within the fragment

All nodes know the identity and the edge leading towards the core.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 28 / 59

slide-29
SLIDE 29

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 29 / 59

slide-30
SLIDE 30

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 30 / 59

slide-31
SLIDE 31

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 31 / 59

slide-32
SLIDE 32

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 32 / 59

slide-33
SLIDE 33

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 33 / 59

slide-34
SLIDE 34

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 34 / 59

slide-35
SLIDE 35

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 35 / 59

slide-36
SLIDE 36

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 36 / 59

slide-37
SLIDE 37

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 37 / 59

slide-38
SLIDE 38

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 38 / 59

slide-39
SLIDE 39

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 39 / 59

slide-40
SLIDE 40

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 40 / 59

slide-41
SLIDE 41

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 41 / 59

slide-42
SLIDE 42

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 42 / 59

slide-43
SLIDE 43

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 43 / 59

slide-44
SLIDE 44

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 44 / 59

slide-45
SLIDE 45

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 45 / 59

slide-46
SLIDE 46

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 46 / 59

slide-47
SLIDE 47

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 47 / 59

slide-48
SLIDE 48

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 48 / 59

slide-49
SLIDE 49

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 49 / 59

slide-50
SLIDE 50

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 50 / 59

slide-51
SLIDE 51

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 51 / 59

slide-52
SLIDE 52

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 52 / 59

slide-53
SLIDE 53

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 53 / 59

slide-54
SLIDE 54

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 54 / 59

slide-55
SLIDE 55

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 55 / 59

slide-56
SLIDE 56

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 56 / 59

slide-57
SLIDE 57

Finding the minimum weight outgoing edge

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 57 / 59

slide-58
SLIDE 58

Finding minimum spanning tree

Order of combinations matters! Expanding one node at a time is slow. We want to at least double fragment size every time. Rules to achieve this: Fragments with a single node are at level zero. Two fragments of level L may combine into a fragment of level L + 1. A lower level fragment may simply join another fragment. ⇒ A fragment of level L has at least 2L nodes.

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 58 / 59

slide-59
SLIDE 59

Complexity and conclusion

At most 2E + 5N log2 N messages needed. 2 messages for each edge rejection 5 other messages / node & level N nodes, at most log2 N levels The time complexity is O(N log N). See proof in the final report. An implementation (using HTML5 canvas) is available at http://www.cs.helsinki.fi/u/jwkangas/dmst/dmst.html

  • K. Kangas (U. Helsinki)

Distributed minimum spanning tree problem November 8, 2012 59 / 59