Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distributed Algorithms 2014 Igor Zarivach A Distributed Algorithm for Minimum Weight Spanning Trees By Gallager, Humblet,Spira (GHS)

Similar presentations


Presentation on theme: "Distributed Algorithms 2014 Igor Zarivach A Distributed Algorithm for Minimum Weight Spanning Trees By Gallager, Humblet,Spira (GHS)"— Presentation transcript:

1 Distributed Algorithms 2014 Igor Zarivach A Distributed Algorithm for Minimum Weight Spanning Trees By Gallager, Humblet,Spira (GHS)

2 Agenda Introduction Review of spanning trees Description of GHS algorithm Algorithm execution on ring topology Complexity analysis

3 Dijkstra prize in 2004 An elegant and efficient distributed algorithm for finding a minimum spanning tree in an asynchronous network. The problem is important, both theoretically and practically Major algorithmic breakthrough on many fronts: It solved the fundamental problem of symmetry breaking (or leader election) in the setting of a general graph the algorithm has a surprisingly low message complexity for this important problem. Techniques for multicasting, and for query and reply. Beauty and elegance of the algorithm and its presentation. An exceptional degree of asynchrony among the nodes. Its structure is very intuitive and is easy to comprehend. The algorithm is sufficiently complicated and interesting and is a challenge problem for formal verification methods. Finding a proof is still very much an open problem in protocol verification and formal methods. In summary, this paper is a genuine milestone in the area of asynchronous network algorithms; it has changed this field completely, in terms of both algorithmics and analysis techniques.

4 Problem Statement Given: The input graph G(V,E) is a connected undirected graph with N nodes, and E edges with distinct finite weight. Need to find asynchronous distributed algorithm which determines the minimum spanning tree (MST) of the graph.

5 Minimum (Weight) Spanning Tree 4 5 12 3 2 9 1 10 4 5 11 7 16 12 15 3 2 8 9 14 6 13 1 10

6 Applications Efficient broadcasting in networks Establishing connectivity after nodes failure Leader election

7 Model

8 Definitions Fragment: a subtree of MST Branch: edge in MST, edge in fragment Outgoing edge: edge between different fragments Fragment’s MWOE: Minimum weight outgoing edge 8 Fragment 2 Fragment 3 Fragment 1 root branch outgoing edge MWOE

9 Two properties of MSTs Property 1: Given a fragment F of a MST, let e be a minimum-weight outgoing edge of F, then joining e and its adjacent non- fragment node to F yields another fragment F’ of an MST. Property 2: If all the edges of a connected graph have different weights, then the MST of the graph is unique. Fragment F MWOE e Fragment F’ branch e

10 Algorithm GHS High Level Each fragment finds its MWOE asynchronously When MWOE is found, the fragment attempts to combine with the fragment on the other end We will show how and when to combine the fragments so the algorithm is correct and has good message complexity 10 Fragment F’ Fragment F

11 11 5 5 5 Distinct weight edges Will the algorithm work for equal weight edges?

12 Design - Fragment Each fragment behaves asynchronously and independently Initially, every fragment consists of a single node Upon termination, there will be only one fragment Each fragment will have a leader, which initiates fragment operations Leader starts operation by broadcast Every node replies to the leader by convergecast The spanning tree is used for communication When two fragments are merged, spanning tree is updated Fragment F’

13 Design - Node Node has a pointer to the next node in the path to the leader (father) Node knows to which fragment it belongs 13 Fragment F’

14 Design - Union 14 Fragment F Fragment G

15 Fragment F’ Problem 1 - Cycle 15 Fragment F Fragment G Solution

16 Problem 2 – Unbalanced fragments 16 Solution Merge only smaller fragment to larger fragment Update father pointers of smaller fragment We need to estimate the size of the fragment!

17 Fragment size estimation (Level)

18 Design - Union 18 F Level 3 F’ Level 2 F can’t find MWOE, and waits

19 Fragments union operations 19 Condition Result Message Complexity

20 Design - Union 20

21 Fragment Names and Leaders 21

22 Example NetworkEvent All nodes wake up, choose MWOE and try to Connect to the neighbor ID1 and ID2 Merge and become Level-1 fragment, the same for ID4 and ID5. ID3 waits… ID3 tries to Connect again, Two fragments look for MWOE 22 12345 1342 Connect 12345 1342 Level 1 12345 1342 Connect Test

23 Example NetworkEvent Fragments are blocked because ID Level is smaller than 1 ID3 absorbs… Only now ID3 replies for both Test messages Two fragments merge to new Level-2 fragment And the algorithm ends with MST 23 12345 1342 Level 1 12345 1342 Connect Test Accept Reject Connect 12345 1342 Level 1 12345 1342 Level 2

24 Fragment Lifecycle 2. Find MWOE Level 0 – minimal edge, otherwise Test, Accept, Reject Can wait…. Convergecast (MWOE) 3. Union Merge New Fragment is created (Level L+1) Or Absorb Or Wait 24 Async: Smaller Fragments Absorbed

25 Node state machine SleepingFindFound 25

26 Specific messages: Initiate: Broadcast from leader to find MWOE; contains fragment identity. Report:Convergecast MWOE responses back to leader. Test: Asks whether an edge is outgoing. Accept/Reject: Answers to test. Change-core: Sent from leader to endpoint of MWOE. Connect: Sent across the MWOE, to connect fragments. We say merge occurs when connect message has been sent both ways on the edge (2 nodes must have same level). We say absorb occurs when connect message has been sent on the edge from a lower- level to a higher-level node. 26

27 Description: Find MWOE – Level 0 27

28 Description: Find MWOE – Level L 28 Fragment F MWOE e

29 Description: Find MWOE – Level L (continued) 29 Fragment F MWOE e

30 Test-Accept-Reject Protocol F’ F

31 Merge F’F

32 Absorb F’ F

33 Correctness Given Properties 1 and 2, it is sufficient to verify: 1.MWOE is correctly chosen by every fragment 2.No deadlocks due to Waits 33

34 MWOE Correctness (Async Absorb) F’ F

35 Liveness 35 1 4 2 3 5 6 Fragment Digraph

36 The Algorithm (As Executed at Each Node) 36

37 The Algorithm (As Executed at Each Node) 37

38 The Algorithm (As Executed at Each Node) 38

39 The Algorithm (As Executed at Each Node) 39

40 Simulation – Ring Communication Odd link – 1 cycle Even link – 2 cycles 40 1 3 2 3 2 1

41 EventTime Code State Edgesi-bLNFNSNID 1: Basic, 3: BasicSleeping1 2: Basic, 3: BasicSleeping2 1: Basic, 2: BasicSleeping3 Events Initialization ProcessorTime N/A Network 1 3 2 3 2 1

42 EventTime ID1 wakes up1 ID1 send Connect(0) to ID31 ID3 recv Connect(0) on 12 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic0Found1 2: Basic, 3: BasicSleeping2 1: Basic, 2: BasicSleeping3 Events Step 1 ProcessorTime 11 Network 1 3 2 3 2 1

43 EventTime ID3 recv Connect(0) on 12 ID3 wakes up2 ID3 send Connect(0) to ID12 ID3 send Initiate(1,1,Find) to ID12 ID1 recv Connect(0) on 13 ID1 recv Initiate(1,1,Find) on 13 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic0Found1 2: Basic, 3: BasicSleeping2 1: Branch, 2: Basic0Found3 Events Step 2 ProcessorTime 32 Network 1 3 2 3 2 1

44 EventTime ID1 recv Connect(0) on 13 ID1 recv Initiate(1,1,Find) on 13 ID1 send Initiate(1,1,Find) to ID33 ID3 recv Initiate(1,1,Find) on 14 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic0Found1 2: Basic, 3: BasicSleeping2 1: Branch, 2: Basic0Found3 Events Step 3 ProcessorTime 13 Network 1 3 2 3 2 1

45 EventTime ID1 recv Initiate(1,1,Find) on 13 ID3 recv Initiate(1,1,Find) on 14 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Basic, 3: BasicSleeping2 1: Branch, 2: Basic0Found3 Events Step 4 ProcessorTime 13 Network 1 3 2 3 2 1

46 EventTime ID1 recv Initiate(1,1,Find) on 13 ID3 recv Initiate(1,1,Find) on 14 ID1 send Test(1,1) to ID23 ID2 recv Test(1,1) on 34 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Basic, 3: BasicSleeping2 1: Branch, 2: Basic0Found3 Events Step 5 ProcessorTime 13 Network 1 3 2 3 2 1

47 EventTime ID3 recv Initiate(1,1,Find) on 14 ID2 recv Test(1,1) on 34 ID3 send Test(1,1) on 24 ID2 recv Test(1,1) on 26 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Basic, 3: BasicSleeping2 1: Branch, 2: Basic111Find3 Events Step 6 ProcessorTime 34 Network 1 3 2 3 2 1

48 EventTime ID2 recv Test(1,1) on 34 ID2 recv Test(1,1) on 26 ID2 send Connect(0) to ID34 ID3 recv Connect(0) on 26 ID2 recv Test(1,1) on 3 (Wait)5 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Branch, 3: Basic0Found2 1: Branch, 2: Basic111Find3 Events Step 7 ProcessorTime 24 Network 1 3 2 3 2 1

49 EventTime ID2 recv Test(1,1) on 3 (Wait)5 ID2 recv Test(1,1) on 26 ID3 recv Connect(0) on 26 ID2 recv Test(1,1) on 3 (Wait)6 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Branch, 3: Basic0Found2 1: Branch, 2: Basic111Find3 Events Step 8 ProcessorTime 25 Network 1 3 2 3 2 1

50 EventTime ID2 recv Test(1,1) on 26 ID3 recv Connect(0) on 26 ID2 recv Test(1,1) on 3 (Wait)6 ID2 recv Test(1,1) on 2 (Wait)7 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Branch, 3: Basic0Found2 1: Branch, 2: Basic111Find3 Events Step 9 ProcessorTime 26 Network 1 3 2 3 2 1

51 EventTime ID3 recv Connect(0) on 26 ID2 recv Test(1,1) on 3 (Wait)6 ID2 recv Test(1,1) on 2 (Wait)7 ID3 send Initiate(1,1,Find) to ID26 ID2 recv Initiate(1,1,Find) on 28 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Branch, 3: Basic0Found2 1: Branch, 2: Branch111Find3 Events Step 10 ProcessorTime 36 Network 1 3 2 3 2 1

52 EventTime ID2 recv Initiate(1,1,Find) on 28 ID2 recv Test(1,1) on 3 (Wait)8 ID2 recv Test(1,1) on 2 (Wait)9 ID2 send Test(1,1) to ID18 ID1 recv Test(1,1) on 39 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Branch, 3: Basic211Find2 1: Branch, 2: Branch111Find3 Events Step 11 – We go to 8 ProcessorTime 28 Network 1 3 2 3 2 1

53 EventTime ID2 recv Test(1,1) on 3 (Wait)8 ID2 recv Test(1,1) on 2 (Wait)9 ID1 recv Test(1,1) on 39 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Branch, 3: Reject211Find2 1: Branch, 2: Branch111Find3 Events Step 12 ProcessorTime 28 Network 1 3 2 3 2 1 Test edge is 3

54 EventTime ID2 recv Test(1,1) on 3 (Wait)8 ID2 recv Test(1,1) on 2 (Wait)9 ID1 recv Test(1,1) on 39 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Branch, 3: Reject211Find2 1: Branch, 2: Branch111Find3 Events Step 13 ProcessorTime 28 Network 1 3 2 3 2 1

55 EventTime ID2 recv Test(1,1) on 3 (Wait)8 ID2 recv Test(1,1) on 2 (Wait)9 ID1 recv Test(1,1) on 39 8 10 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Branch, 3: Reject211Found2 1: Branch, 2: Branch111Find3 Events Step 13 ProcessorTime 28 Network 1 3 2 3 2 1

56 EventTime ID2 recv Test(1,1) on 2 (Wait)9 ID1 recv Test(1,1) on 39 10 ID2 send Reject to ID39 ID3 recv Reject on 211 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Branch, 3: Reject211Found2 1: Branch, 2: Branch111Find3 Events Step 14 ProcessorTime 29 Network 1 3 2 3 2 1 Test edge is nil

57 EventTime ID1 recv Test(1,1) on 39 10 ID3 recv Reject on 211 9 10 Code State Edgesi-bLNFNSNID 1: Branch, 3: Reject111Found1 2: Branch, 3: Reject211Found2 1: Branch, 2: Branch111Find3 Events Step 15 ProcessorTime 19 Network 1 3 2 3 2 1 Test edge is 3

58 EventTime 10 ID3 recv Reject on 211 10 11 ID3 halts10 Code State Edgesi-bLNFNSNID 1: Branch, 3: Reject111Found1 2: Branch, 3: Reject211Found2 1: Branch, 2: Branch111Found3 Events Step 16 ProcessorTime 310 Network 1 3 2 3 2 1

59 EventTime ID3 recv Reject on 211 ID1 halts11 Code State Edgesi-bLNFNSNID 1: Branch, 3: Reject111Found1 2: Branch, 3: Reject211Found2 1: Branch, 2: Branch111Found3 Events Step 17 ProcessorTime 111 Network 1 3 2 3 2 1

60 Communication Complexity 60

61 Questions? 61

62 Thank you! 62


Download ppt "Distributed Algorithms 2014 Igor Zarivach A Distributed Algorithm for Minimum Weight Spanning Trees By Gallager, Humblet,Spira (GHS)"

Similar presentations


Ads by Google