MST GALLAGER HUMBLET SPIRA ALGORITHM 1072020 1 MST
MST GALLAGER HUMBLET SPIRA ALGORITHM 10/7/2020 1
MST v v v Undirected graph, length – weight of edge is unique (IDs) A node knows weight of the incident edges The algorithm is initiated in one or more nodes Get IDs of neighbors takes 2|E| messages Symmetry problem could be solved by probabilistic algorithms §Applications: § Multicast § Leader election § Dynamic changes of topology 10/7/2020 2
Definiitons v v v Fragment: subtree of a MST Outgoing edge of the fragment (i, j) ; i is in the fragment, j is not in the fragment Lemma: • v 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 w(x)>w(e) e original MST was not minimum F x wrong assumption 10/7/2020 3
GHS v Lemma: • v Algorithms: • • v If all edges of a connected graph have different wieghts then the MST is unique 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’ 10/7/2020 4
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 1 1. 1 2 3. 1 core of F 1. 7 2. 6 3 4 2. 1 3. 8 5 core of F’ fragment F’ 10/7/2020 node 4 is absorbed by F or later on by F’’ level 1 3. 7 6 edge 1 -5 is a core of F’’, level 2 5
OUTLINE OF THE ALGORITHM v Join fragments • • • v Relabel all nodes in the new fragment with the same label Notify them about the change of state Make them to 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 10/7/2020 6
CONNECTING FRAGMENTS v 0 -level fragments • A node is in the state core – Sleeping Initiate – Find : sends Connect over the minimum edge, goes to the state – Found : waits for a response v 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) 10/7/2020 7
FINDING A MINIMUM-WEIGHT OUTGOING EDGE IN ONE NODE v Edge: • • • v branch rejected – back edge basic i Test j 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 gets to state rejected – A node tests another basic edge 10/7/2020 8
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/7/2020 9
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 10/7/2020 10
CONNECTING FRAGMENTS Report(w) Report(w’) Change_core Connect(L) • • • min outgoing edge 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 10/7/2020 11
CONNECTING FRAGMENTS cont’d Connect(L) F L Connect(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 2 L nodes => L log 2 N 10/7/2020 12
CONNECTING FRAGMENTS cont’d Connect(L) i j F F’ L v L < L’ L’ Lower level fragment can always join the higher level one; But not vice versa: L>L’ does not apply: Test would be waiting 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 10/7/2020 13
CORRECTNESS v Follows from Lemma 1, 2 assuming that • • v 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 10/7/2020 14
Cont’d v 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 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 10/7/2020 15
MESSAGE COMPLEXITY v v v 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 ------------------5 N messages number of levels: # L log 2 N # L – 2 log 2 N 5 N ( log 2 N) 10/7/2020 16
Cont’d v v 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 • Accepts at most one message Initiate --------- • 4 N < 5 N log 2 N • ------------ • 5 N log 2 N + |E| 10/7/2020 17
TIME COMPLEXITY v In the case of a sequential activation of nodes N(N-1) messages will be sent sequentially v Initialization phase: • • v waking up all nodes: N – 1 time units each node sends Connect 1 sending out Initiate messages N every node in a fragment of level 1 2 N In time 5 l. N – 3 N all nodes will be in a fragment of level l 10/7/2020 18
Cont’d v v v Proof: 1. l = 1 T = 2 N 2. Holds for l • • • v on level l every node sends at most N messages Test and gets a response in time 5 l. N –N sending out messages Report Change_root, Connect 3 N Initiate ----------------------------------5 l. N + 2 N = 5(l + 1) N – 3 N On the last level only messages Test, Reject, Report are sent ~ 3 N # levels log N => T = 5 N log. N. v 10/7/2020 19
- Slides: 19