1 / 20

MST GALLAGER HUMBLET SPIRA ALGORITHM

MST GALLAGER HUMBLET SPIRA ALGORITHM. 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

glendat
Télécharger la présentation

MST GALLAGER HUMBLET SPIRA ALGORITHM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MSTGALLAGER HUMBLET SPIRA ALGORITHM

  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

  3. e F x 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 w(x)>w(e)

  4. GHS • Lemma: • 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’

  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 2.6 4 3 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

  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

  7. CONNECTING FRAGMENTS • 0-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

  8. FINDING A MINIMUM-WEIGHT OUTGOING EDGEIN ONE NODE • Edge: • branch • rejected – back edge • basic • Messages: • In the state Find a node sendsTest (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

  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

  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

  11. CONNECTING FRAGMENTS • 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 Report(w) Report(w’) Change_core min outgoing edge Connect(L)

  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

  13. CONNECTING FRAGMENTS cont’d • 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 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 j F’ L’ i F L L < L’

  14. CORRECTNESS • Follows from Lemma 1, 2 assuming that • 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

  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

  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 messageInitiate • Accept • sends at most one messageTest (not rejected) • Report • Change_root or Connect • ------------------------------------- • 5Nmessages • number of levels: # L  log2 N • # L – 2 log2 N • 5N ( log2 N)

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

  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 Connect1 • sending out Initiate messages N • every node in a fragment of level 1 2N • In time 5lN – 3N all nodes will be in a fragment of levell

  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 5lN –N • sending out messages Report • Change_root, Connect 3N • 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

  20. Epilogue • Awerbuch 1987: Optimal algorithm • Faloutsos & Molle 1995: small fixes of Awerbuch’s algorithm

More Related