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

Slides:



Advertisements
Similar presentations
Energy-Efficient Distributed Algorithms for Ad hoc Wireless Networks Gopal Pandurangan Department of Computer Science Purdue University.
Advertisements

Chapter 5: Tree Constructions
Lecture 15. Graph Algorithms
Distributed Minimum Spanning Tree Gallagher, Humblet, Spira (1983) pseudocode adaptation by Kenneth J. Goldman September 2002.
Global States.
Distributed Leader Election Algorithms in Synchronous Ring Networks
Lecture 8: Asynchronous Network Algorithms
Chapter 15 Basic Asynchronous Network Algorithms
Leader Election Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.  i,j  V  i,j are non-faulty.
1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
Self Stabilizing Algorithms for Topology Management Presentation: Deniz Çokuslu.
1 K-clustering in Wireless Ad Hoc Networks Fernandess and Malkhi Hebrew University of Jerusalem Presented by: Ashish Deopura.
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.
Lecture 7: Synchronous Network Algorithms
Outline. Theorem For the two processor network, Bit C(Leader) = Bit C(MaxF) = 2[log 2 ((M + 2)/3.5)] and Bit C t (Leader) = Bit C t (MaxF) = 2[log 2 ((M.
Minimum Spanning Trees
Minimum Spanning Trees
1 Network Coding: Theory and Practice Apirath Limmanee Jacobs University.
1 Complexity of Network Synchronization Raeda Naamnieh.
1 University of Freiburg Computer Networks and Telematics Prof. Christian Schindelhauer Wireless Sensor Networks 21st Lecture Christian Schindelhauer.
CPSC 668Set 2: Basic Graph Algorithms1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
1 Minimum Spanning Trees Gallagher-Humblet-Spira (GHS) Algorithm.
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.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Bit Complexity of Breaking and Achieving Symmetry in Chains and Rings.
1 Brief Announcement: Distributed Broadcasting and Mapping Protocols in Directed Anonymous Networks Michael Langberg: Open University of Israel Moshe Schwartz:
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 4 – Consensus and reliable.
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.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 2 – Distributed Systems.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
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.
Message Passing Systems A Formal Model. The System Topology – network (connected undirected graph) Processors (nodes) Communication channels (edges) Algorithm.
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.
Message Passing Systems A Formal Model. The System Topology – network (connected undirected graph) Processors (nodes) Communication channels (edges) Algorithm.
Distributed Verification and Hardness of Distributed Approximation Atish Das Sarma Stephan Holzer Danupon Nanongkai Gopal Pandurangan David Peleg 1 Weizmann.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Routing in Communication Networks Routing: Network layer protocol that guides information units to correct destinations. A complex collection of decision.
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.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 10 Instructor: Haifeng YU.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 20.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 10, 2005 Session 9.
1 Broadcast. 2 3 Use a spanning tree Root 4 synchronous It takes the same time at link to send a message It takes the same time at each node to process.
A correction The definition of knot in page 147 is not correct. The correct definition is: A knot in a directed graph is a subgraph with the property that.
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.
Vertex Coloring Distributed Algorithms for Multi-Agent Networks
Graphs Upon completion you will be able to:
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
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.
CIS 825 Lecture 9. Minimum Spanning tree construction Each node is a subtree/fragment by itself. Select the minimum outgoing edge of the fragment Send.
CIS 825 Lecture 8. Leader Election Aim is to elect exactly one node as the leader.
1 Minimum Spanning Trees Gallagher-Humblet-Spira (GHS) Algorithm.
The Echo Algorithm The echo algorithm can be used to collect and disperse information in a distributed system It was originally designed for learning network.
Michael Langberg: Open University of Israel
A Distributed Algorithm for Minimum-Weight Spanning Trees
CS60002: Distributed Systems
Lecture 9: Asynchronous Network Algorithms
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
MST GALLAGER HUMBLET SPIRA ALGORITHM
Tree Construction (BFS, DFS, MST) Chapter 5
Minimum Spanning Tree.
MST GALLAGER HUMBLET SPIRA ALGORITHM
Lecture 8: Synchronous Network Algorithms
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Chapter 15.5 from “Distributed Algorithms” by Nancy A. Lynch
Presentation transcript:

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

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

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.

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.

Minimum (Weight) Spanning Tree

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

Model

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

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

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

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

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’

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’

Design - Union 14 Fragment F Fragment G

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

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!

Fragment size estimation (Level)

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

Fragments union operations 19 Condition Result Message Complexity

Design - Union 20

Fragment Names and Leaders 21

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 Connect Level Connect Test

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 Level Connect Test Accept Reject Connect Level Level 2

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

Node state machine SleepingFindFound 25

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

Description: Find MWOE – Level 0 27

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

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

Test-Accept-Reject Protocol F’ F

Merge F’F

Absorb F’ F

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

MWOE Correctness (Async Absorb) F’ F

Liveness Fragment Digraph

The Algorithm (As Executed at Each Node) 36

The Algorithm (As Executed at Each Node) 37

The Algorithm (As Executed at Each Node) 38

The Algorithm (As Executed at Each Node) 39

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

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

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

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

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

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

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

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

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

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

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

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

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

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 Test edge is 3

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

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 Code State Edgesi-bLNFNSNID 1: Branch, 3: Basic111Find1 2: Branch, 3: Reject211Found2 1: Branch, 2: Branch111Find3 Events Step 13 ProcessorTime 28 Network

EventTime ID2 recv Test(1,1) on 2 (Wait)9 ID1 recv Test(1,1) on 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 Test edge is nil

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

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

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

Communication Complexity 60

Questions? 61

Thank you! 62