1 Minimum Spanning Trees Gallagher-Humblet-Spira (GHS) Algorithm.

Slides:



Advertisements
Similar presentations
Chapter 11 Trees Graphs III (Trees, MSTs) Reading: Epp Chp 11.5, 11.6.
Advertisements

Chapter 5: Tree Constructions
Lectures on Graph Algorithms: searching, testing and sorting
Lecture 15. Graph Algorithms
Distributed Minimum Spanning Tree Gallagher, Humblet, Spira (1983) pseudocode adaptation by Kenneth J. Goldman September 2002.
Chapter 15 Basic Asynchronous Network Algorithms
Greedy Algorithms Greed is good. (Some of the time)
Graphs III (Trees, MSTs) (Chp 11.5, 11.6)
Minimum Spanning Tree CSE 331 Section 2 James Daly.
Self Stabilizing Algorithms for Topology Management Presentation: Deniz Çokuslu.
Minimum Spanning Trees GHS algorithm Based on “A distributed algorithm for minimum-weight spanning trees”, Gallager, Humblet, Spira 1983 גיא בניי ו - ירון.
1 2 Lecture Outline 1.Problem description TThe distinct weights demand 2.Review of spanning trees PProperties of spanning trees KKruskal’s algorithm.
3.3 Spanning Trees Tucker, Applied Combinatorics, Section 3.3, by Patti Bodkin and Tamsen Hunter.
Minimum Spanning Trees
Minimum Spanning Trees
CMPS 2433 Discrete Structures Chapter 5 - Trees R. HALVERSON – MIDWESTERN STATE UNIVERSITY.
Lectures on Network Flows
Discussion #36 Spanning Trees
CPSC 668Set 2: Basic Graph Algorithms1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
Minimal Spanning Trees. Spanning Tree Assume you have an undirected graph G = (V,E) Spanning tree of graph G is tree T = (V,E T E, R) –Tree has same set.
A Distributed Algorithm for Minimum-Weight Spanning Trees by R. G. Gallager, P.A. Humblet, and P. M. Spira ACM, Transactions on Programming Language and.
Minimum Spanning Trees
Raeda Naamnieh 1. The Partition Algorithm Intuitively, the idea of the following algorithm is to choose each cluster as a maximal subset of nodes whose.
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
Distributed Algorithms 2014 Igor Zarivach A Distributed Algorithm for Minimum Weight Spanning Trees By Gallager, Humblet,Spira (GHS)
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Minimum Spanning Tree Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
COSC 2007 Data Structures II Chapter 14 Graphs III.
CSCI 115 Chapter 7 Trees. CSCI 115 §7.1 Trees §7.1 – Trees TREE –Let T be a relation on a set A. T is a tree if there exists a vertex v 0 in A s.t. there.
 2004 SDU Lecture 7- Minimum Spanning Tree-- Extension 1.Properties of Minimum Spanning Tree 2.Secondary Minimum Spanning Tree 3.Bottleneck.
5.2 Trees  A tree is a connected graph without any cycles.
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
Spanning Trees. A spanning tree for a connected, undirected graph G is a graph S consisting of the nodes of G together with enough edges of G such that:
Introduction to Graph Theory
1 Leader Election in Rings. 2 A Ring Network Sense of direction left right.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
1 The Minimum Spanning Tree Problem Distributing Prim’s and Kruskal’s Algorithm.
Minimum Spanning Tree. Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
DISTRIBUTED ALGORITHMS Spring 2014 Prof. Jennifer Welch Set 2: Basic Graph Algorithms 1.
Tree Constructions Distributed Algorithms for Multi-Agent Networks Instructor: K. Sinan YILDIRIM.
 2004 SDU Lecture 6- Minimum Spanning Tree 1.The Minimum Spanning Tree Problem 2.Greedy algorithms 3.A Generic Algorithm 4.Kruskal’s Algorithm.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
Minimum Spanning Tree Given a weighted graph G = (V, E), generate a spanning tree T = (V, E’) such that the sum of the weights of all the edges is minimum.
Trees.
1 Minimum Spanning Trees Gallagher-Humblet-Spira (GHS) Algorithm.
Graph Search Applications, Minimum Spanning Tree
Chapter 9 : Graphs Part II (Minimum Spanning Trees)
Discrete Mathematicsq
A Distributed Algorithm for Minimum-Weight Spanning Trees
Lectures on Network Flows
CS60002: Distributed Systems
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Autumn 2016 Lecture 11 Minimum Spanning Trees (Part II)
MST GALLAGER HUMBLET SPIRA ALGORITHM
Minimum Spanning Tree.
Tree Construction (BFS, DFS, MST) Chapter 5
The Minimum Spanning Tree Problem
Autumn 2015 Lecture 11 Minimum Spanning Trees (Part II)
Minimum Spanning Tree.
Lectures on Graph Algorithms: searching, testing and sorting
MST GALLAGER HUMBLET SPIRA ALGORITHM
Minimum Spanning Tree.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
The Greedy Approach Young CS 530 Adv. Algo. Greedy.
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Chapter 15.5 from “Distributed Algorithms” by Nancy A. Lynch
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

1 Minimum Spanning Trees Gallagher-Humblet-Spira (GHS) Algorithm

2 Weighted Graph

3 Minimum weight spanning tree The sum of the weights is minimized (MST) For MST :is minimized

4 Spanning tree fragment: Any (connected) sub-tree of a MST

5 Minimum weight outgoing edge (MWOE) The adjacent edge to the fragment with the smallest weight that does not create a cycle

6 Property 1: The union of a fragment and its MWOE is a fragment (so called blue rule). Property 2: If the weights are unique then the MST is unique Two important properties for building MST

7 Property 1: The union of a fragment and its MWOE is a fragment Proof: Basic idea: we distinguish two cases: 1.the MWOE belongs to the MST 2.the MWOE does not belong to the MST In both cases, we can prove the claim.

8 MWOE Fragment MST T Case 1:

9 MWOE Fragment MST T Trivially, if then is a fragment

10 MWOE Fragment MST T Case 2:

11 MWOE Fragment MST T If then add toand remove

12 Fragment Since otherwise, wouldn’t be MST Obtain T’ and since

13 Fragment thus is a fragment of T’ END OF PROOF MST T’

14 Property 2: If the weights are unique then the MST is unique Proof:Basic Idea: Suppose there are two MST Then there is another MST of smaller weight Contradiction!

15 Suppose there are two MST

16 Take the smallest weight edge not in intersection

17 Cycle in RED MST

18 Cycle in RED MST e’: any red edge not in BLUE MST (  since blue tree is acyclic)

19 Cycle in RED MST Since is not in intersection, (the weight of is the smallest)

20 Cycle in RED MST Delete and add in RED MST We obtain a new tree with smaller weight Contradiction! END OF PROOF

21 Prim’s Algorithm (sequential version) Start with a node as an initial fragment Augment fragment with the MWOE Repeat Until no other edge can be added to

22 Fragment

23 Fragment MWOE

24 Fragment MWOE

25 Fragment MWOE

26 Fragment

27 Theorem:Prim’s algorithm gives an MST Proof: Use Property 1 repeatedly END OF PROOF

28 Prim’s algorithm (distributed version) Works by repeatedly applying the blue rule to a single fragment, to yield the MST for G Works with both asynchronous and synchronous uniform models (and also with non-unique weights) Algorithm: 1.let vertex r be the root as well as the first fragment 2.(synchronous case) r broadcasts a message on the current fragment to search for the MWOE of the fragment (each vertex in the fragment searches for its “local” MWOE) 3.convergecast (reverse broadcast) the local MWOE’s (each vertex sends the minimum it has seen) towards r 4.the MWOE is then selected by r and added to the fragment, by sending a connect message on the right path. Complexity: (time =) message = O(n 2 )

29 Local description of syncr. Prim Each processor stores: 1.The state of any of its incident edges, which can be either of {basic, branch, reject} 2.Its own state, which can be either {in, out} 3.“Local” MWOE 4.Parent channel (route towards the root) 5.MWOE channel (route towards the MWOE of its appended subfragment) Type of messages: 1.(synchronous case) Search MWOE: coordination message 2.Test: for checking the status of an edge 3.Reject, Accept: response to Test 4.Report(weight): for finding the MWOE 5.Add edge: to add the fragment’s MWOE 6.Connect: to perform the union of the MWOE to the fragment (this changes status of a node from out to in).

30 Kruskal’s Algorithm (sequential version) Initially, each node is a fragment Find the smallest MWOE of all fragments Merge the two fragments adjacent to Repeat Until there is one fragment

31 Initially, every node is a fragment

32 Find the smallest MWOE

33 Merge the two fragments

34 Find the smallest MWOE

35 Merge the two fragments

36 Resulting MST

37 Theorem:Kruskal’s algorithm gives an MST Proof: Use Property 1, and observe that no cycle is created. END OF PROOF

38 Synchronous GHS Algorithm Distributed version of Kruskal’s Algorithm Works by repeatedly applying the blue rule to multiple fragments, to yield the MST for G Works with non-uniform models, unique weights Initially, each node is a fragment Each fragment finds its MWOE Merge fragments adjacent to MWOE’s Repeat in parallel: Until there is one fragment (Synchronous Phase)

39 Local description of syncr. GHS Each processor stores: 1.The state of any of its incident edges, which can be either of {basic, branch, reject} 2.Identity of its fragment (the weigth of an edge) 3.“Local” MWOE 4.Parent channel (route towards the root) 5.MWOE channel (route towards the MWOE of its appended subfragment)

40 Type of messages 1.New fragment(identity): coordination message sent at the end of a phase 2.Test(identity): for checking the status of an edge 3.Reject, Accept: response to Test 4.Report(weight): for finding the MWOE 5.Merge: send by the root to the node incident to the MWOE to activate union of fragments 6.Connect(My Id): to perform the union

41 Phase 0: Initially, every node is a fragment… … and every node is a root of a fragment

42 Phase 1: Find the MWOE for each fragment

43 Phase 1: Merge the fragments and select a new root Root Asymmetric MWOE symmetric MWOE The new root is adjacent to a symmetric MWOE

44 Rules for selecting a new root in a fragment Fragment 1 Fragment 2 root MWOE Merging 2 fragments

45 Merged Fragment root Higher ID Node on MWOE Rules for selecting a Root in fragment

46 Rules for selecting a Root in fragment Merging more than 2 fragments root

47 Rules for selecting a Root in fragment Higher ID Node on symmetric MWOE Merged Fragment Root asymmetric

48 In merged fragments there is exactly one symmetric MWOE Remark: Impossible Creates a fragment with two MWOE zero two Creates a fragment with no MWOE

49 After merging has taken place, the new root broadcasts New fragment(w(e)) to the new fragment is the symmetric MWOE of the merged fragments is the identity of the new fragment

50 And so, at the end of a phase each fragment has its own unique identity. Root End of phase 1

51 Phase 2: Find the MWOE for each fragment

52 Phase 2: Merge the fragments Root

53 At the end of a phase each fragment has its own unique identity. End of phase 2 Root

54 Phase 3: Find the MWOE for each fragment

55 Phase 3: Merge the fragments Root

56 Phase 3: New fragment FINAL MST

57 At the beginning of each phase each node in fragment finds its MWOE MWOE

58 To discover its own MWOE, each node sends a Test message containing its identity over its basic edge of min weight, until it receives an Accept test(  ) accept test(  ) reject

59 Then it knows its “local” MWOE MWOE

60 Then each node sends a Report with its local MWOE to the fragment root with convergecast (the global minimum survives in propagation) MWOE

61 The root selects the minimum MWOE and sends along the right path a Merge message, which will become a Connect message at the right node MWOE

62 Correctness To guarantee correctness, phases must be syncronized But at the beginning of a phase, each fragment can have a different number of nodes, and thus the MWOE selection is potentially asyncronous… But each fragment can have at most n nodes, has height at most n, and each node has at most n incident edges… So, the MWOE selection requires at most 3n rounds, and the Merge message requires at most n rounds. Then, the Connect message must be sent at round 4n+1 of a phase, and so at round 4n+2 a node knows whether it is a new root Finally, the New fragment message will require at most n rounds.  A fixed number of 5n+2 total rounds can be used to complete each phase!

63 Smallest Fragment size (#nodes) Phase Complexity

64 Maximum # phases: Maximum possible fragment size Number of nodes Algorithm Time Complexity  Total time = Phase time #phases =

65 Thr: Synchronous GHS requires O(|E|+n logn) msgs. Proof: We have the following messages: 1.Test-Reject msgs: at most 2 for each edge; 2.Each node sends/receives at most a single: New Fragment, Test-Accept, Report, Merge, Connect message for each phase. Since from previous lemma we have at most log n phases, the claim follows. Algorithm Message Complexity END OF PROOF

66 Asynchronous Version of GHS Algorithm Simulates the synchronous version Works with uniform models, unique weights Every fragment F has a level L(F)≥0: at the beginning, each node is a fragment of level 0 Two types of merges: absorption and join

67 Local description of asyncr. GHS Like the synchronous, but: 1.Identity of a fragment is now given by an edge weight plus the level of the fragment; 2.A node has its own status, which can be either of {sleeping, finding, found}

68 Type of messages Like the synchronous, but now: 1.New fragment(weight,level,status): coordination message sent just after a merge 2.Test(weight,level): to test an edge 3.Connect(weight,level): to perform the union

69 Fragment MWOE If then is absorbed by (cost of merging proportional to ) Absorption

70 New fragment MWOE The combined level is and a New fragment(weight,level,status) message is broadcasted to nodes of F 1 by the node of F 2 on which the merge took place

71 MWOE Fragment If then joins with (cost of merging proportional to ) Join

72 New fragment MWOE The combined level is and a New fragment(weight,L(F 2 )+1,finding) message is broadcasted to all nodes of F 1 and F 2, where weigth is that of the edge on which the merge took place

73 Fragment MWOE If then waits until previous rules apply (this is obtained by letting F 2 not replying to Test messages from F 1 ) Remark: the cost of joining would be proportional to F 1 for every small joined fragment, and this would be inefficient!!

74 Lemma: A fragment of level L contains at least 2 L nodes. Proof: By induction. For L=0 is trivial. Assume it is true up to L=k-1, and let F be of level k. But then, either: 1.F was obtained by joining two fragments of level k-1, each containing at least 2 k-1 nodes by inductive hypothesis  F contains at least 2 k k-1 = 2 k nodes; 2.F was obtained after absorbing another fragment F’ of level<k  F apply recursively to F\F’, until 1. applies. Algorithm Message Complexity END OF PROOF

75 Thr: Asynchronous GHS requires O(|E|+n logn) msgs. Proof: We have the following messages: 1.Connect msgs: at most 2 for each edge; 2.Test-Reject msgs: at most 2 for each edge; 3.Each node sends/receives at most a single: New Fragment, Test-Accept, Merge, Report message each time the level of its fragment increases; and since from previous lemma each node can change at most log n levels, the claim follows. Algorithm Message Complexity (2) END OF PROOF

76 Homework Execute asynchronous GHS on the following graph: assuming that system is pseudosynchronous: Start from 1 and 5, and messages sent from odd (resp., even) nodes are received after 1 (resp., 2) round(s)