Presentation is loading. Please wait.

Presentation is loading. Please wait.

MST GALLAGER HUMBLET SPIRA ALGORITHM

Similar presentations


Presentation on theme: "MST GALLAGER HUMBLET SPIRA ALGORITHM"— Presentation transcript:

1 MST GALLAGER HUMBLET SPIRA ALGORITHM
February 22, 2019

2 MST Undirected graph, length – weight of edge is unique (IDs)
A node knows the weights of the incident edges The algorithm is initiated in one or more nodes Obtaining IDs of neighbors requires 2|E| messages Symmetry problem could be solved by probabilistic algorithms Applications: Multicast Leader election Dynamic changes of topology February 22, 2019

3 Definiitons Fragment: subtree of a MST
Outgoing edge of the fragment (i, j) ; i is in the fragment, j is not in the fragment Lemma: Given a fragment of an MST, let e be a minimum-weight outgoing edge of the fragment. Then joining e and its adjacent nonfragment node to the fragment yields another fragment of an MST. Proof: assume e does not belong MST ( F e is not a fragment) Then we get a cycle: By replacing x by e we get a lighter ST  original MST was not minimum  wrong assumption F e x w(x)>w(e) February 22, 2019

4 GHS Lemma: Algorithms:
If all edges of a connected graph have different weights then the MST is unique Algorithms: fragments may grow in an arbitrary order If two fragments have a common node, union of the two fragments is also a fragment GHS : each fragment finds a minimum edge and tries to connect to the fragment incident to the edge Fragment levels: One node: level 0 Fragment F: level L  0 Fragment F’: level L’ February 22, 2019

5 GHS ALGORITHM If L < L’ then F (ready to join) becomes a part of F’ : level L’ If L = L’ and F, F’ have the same minimum-weight outgoing edge (core) the new level is L+1 If L > L’ : F waits, until F’ reaches a high enough level fragment F level 1 1.1 core of F node 4 is absorbed by F or later on by F’’ 1 2 3.1 1.7 3 2.6 4 3.8 2.1 core of F’ fragment F’ level 1 3.7 edge 1-5 is a core of F’’, level 2 5 6 February 22, 2019

6 OUTLINE OF THE ALGORITHM
Join fragments Relabel all nodes in the new fragment with the same label Notify them about the change of state Make them start a new round: Find the minimum outgoing edge of the fragment Find the minimum outgoing edge of a node Find the minimum over all nodes If no min – outgoing edge is found, the algorithm ends Otherwise February 22, 2019

7 CONNECTING FRAGMENTS 0-level fragments Non-zero level fragments
A node is in the state Sleeping Find : sends Connect over the minimum edge, goes to the state Found : waits for a response Non-zero level fragments Two L-1 level fragments are combined to L-level fragment over a core (assume the core is found) The weight of the core defines an ID of the new fragment Nodes incident to a core send Initiate (level, fragment_id) The Initiate message is propagated also to L-1 level fragments that are waiting to be connected (the same level, different ID, found) The message sets a new level, id and Find state in each node in the fragment (continue by Test message) core Initiate February 22, 2019

8 FINDING A MINIMUM-WEIGHT OUTGOING EDGE IN ONE NODE
branch rejected – back edge basic Messages: In the state Find a node sends Test (level, id _fragment) on a basic min.-weight edge If id_fragment(i) == id_fragment(j) node j sends Reject to node i The edge ij changes state to rejected A node tests another basic edge Test i j February 22, 2019

9 FINDING . . . If id_fragment(i)  id_fragment(j)
If fragment_level(i)  fragment_level(j) j sends Accept to i If fragment_level(i) > fragment_level(j) j postpones the reply until it reaches a higher level Reason: synchronization: the low-level fragment may be in an inconsistent state (might be even the same fragment that is slow with changing its id (if it is the same level, and it is the same fragment, then the IDs must be the same; and ID is used only once) No node found an outgoing edge => MST was found, termination Each node finnaly finds a min-weight ougoing edge if it exists February 22, 2019

10 FINDING A MINIMUM-WEIGHT OUTGOING EDGE FOR THE WHOLE FRAGMENT
Leaves of the fragment send Report (min_weight) min_weight =  if min. edge does not exist Internal nodes pick the minimum weight message, mark the edge as a best-edge and send Report (w) to their father-node Nodes change state to Found Report messages meet at the original core February 22, 2019

11 CONNECTING FRAGMENTS Report(w) Report(w’) Change_core
min outgoing edge Connect(L) Change_core is sent over the best-edges and edges change their direction The tree is now rooted in a node incident with the core Connect(L) is sent over the min. outgoing edge of fragment February 22, 2019

12 CONNECTING FRAGMENTS cont’d
Connect(L) Connect(L) F L F’ L New fragment has level L + 1 Nodes incident to the core will send Initiate L + 1 level fragment contains always at least 2 fragments of level L Fragment of level L contains at least 2L nodes => L  log2 N February 22, 2019

13 CONNECTING FRAGMENTS cont’d
Connect(L) Lower level fragment can always join the higher level one; But not vice versa: L>L’ does not apply: Test would be waiting i F L j F’ L’ L < L’ Node j sends Initiate(L’, F’) to i j is in state Find, has not sent Report yet=> F joins fragment F’ nodes in F send Test message j is in state Found, already has sent Report => fragment F’ has found an edge with a lower weight that (i,j) => Test message will not be sent in fragment F February 22, 2019

14 CORRECTNESS Follows from Lemma 1, 2 assuming that Ad 1:
1. the algorithm finds correctly the minimum-weight outgoing edge 2. waiting for a response will not cause a deadlock Ad 1: Connect(L) is sent over a minimum-weight outgoing edge of fragment of level L; Fragment is composed of all nodes that accepted Initiate(L, id_fragment) Fragment can grow by absorbing fragments of a lower level if the lower level fragment already sent Connect over its min. edge February 22, 2019

15 Cont’d Ad 2 Let us consider a set of fragments created during the algorithm run: For the min.-weight outgoing edge of fragment of a minimal level L: Test message the lowest level fragments: will will either wake 0-level fragment or a response is immediately sent back Connect message will wake 0-level fragment is accepted by a fragment of a higher level and Initiate message is sent back immediately it is accepted by a fragment of the same level and L+1 level fragment is created the above holds for any state => there is no deadlock February 22, 2019

16 MESSAGE COMPLEXITY Message length O(log N)
1. Every edge is rejected at most once: Test, Reject 2|E| 2. A node in a fragment of level L (except zero and highest level): accepts at most one message Initiate Accept sends at most one message Test (not rejected) Report Change_root or Connect 5N messages number of levels: # L  log2 N # L – 2  log2 N 5N ( log2 N) February 22, 2019

17 Cont’d 3. A node in fragment of zero-level
Accepts at most one message Initiate Sends out at most one message Connect A node in fragment of highest level Sends out at most one message Report 4N < 5N log2 N 5N log2 N + |E| February 22, 2019

18 TIME COMPLEXITY In the case of a sequential activation of nodes
N(N-1) messages will be sent sequentially Initialization phase: waking up all nodes: N – 1 time units each node sends Connect sending out Initiate messages N every node in a fragment of level N In time 5lN – 3N all nodes will be in a fragment of level l February 22, 2019

19 Cont’d Proof: 1. l = 1 T = 2N 2. Holds for l
on level l every node sends at most N messages Test and gets a response in time lN –N sending out messages Report Change_root, Connect N Initiate 5lN + 2N = 5(l + 1) N – 3N On the last level only messages Test, Reject, Report are sent ~ 3N # levels  log N => T  = 5N logN February 22, 2019

20 Epilogue Awerbuch 1987: Optimal algorithm
Faloutsos & Molle 1995: small fixes of Awerbuch’s algorithm February 22, 2019


Download ppt "MST GALLAGER HUMBLET SPIRA ALGORITHM"

Similar presentations


Ads by Google