Yo-yo (algorithm)
Yo-Yo is a distributed algorithm aimed at minimum finding and leader election in generic connected undirected graph. Unlike Mega-Merger it has a trivial termination and cost analysis.
Introduction
Yo-yo was introduced by Nicola Santoro. It proceeds by consecutive elimination and a graph-reduction technique called pruning. The algorithm is divided in a pre-processing phase followed by a cyclic repetition of a forward phase, called "Yo-" and a backward one, called "-Yo".Pre-requisites
Yo-Yo builds elects a minimum leader under the following premises:- Total reliability: No message is lost in transmission.
- Initial Distinct Values : Each node has a unique identifier.
- Bi-directional communications channels: Each edge is bi-directional, communications can travel in both directions.
Algorithm
Preprocessing
The preprocessing phase is started with a broadcast. At awake state, each node sends its id to all of its neighbors and orients the edge towards the higher-degree node. Note as this is just a logical step, the bi-directional channel is not lost in the procedure. By convergecast the initiator is notified of the preprocessing termination. This process creates three categories of nodes:- Sources: nodes with outgoing nodes, but no incoming nodes. These are the least nodes in each neighborhood.
- Intermediate nodes: nodes with both outgoing and incoming edges. These are neither the least nor the greatest nodes in each neighborhood.
- Sinks: nodes with incoming edges, but no outgoing edges. These are the greatest nodes in each neighborhood.
Yo-
The "Yo-" phase is initiated by the sources. A source sends its id through its incoming edges, and waits. The intermediate nodes wait to receive the respective ids from each of their incoming edges. Once all of expected values are collected, a minimum computation is performed and the minimum id is forwarded through the outgoing edges. Sinks are passive in this phase.The messages are sent through the oriented edges and reach the sinks, which trigger the "-Yo" phase.
-Yo
Sinks initiate the "-Yo" phase by computing the minimum id received and sending a positive YES or negative NO through their incoming edges. A YES is sent through the edges carrying the minimum computed id, a NO through the remaining edges. The messages walk up the structure to the sources: the sources with at least one incoming NO become dead and lose their candidate status.The "-Yo" phase also comprises a re-structuring phase where the sources-intermediates-sinks is accommodated for the non-candidate sources. The edges carrying a NO are reversed and the losers candidates of the current stage become either sinks or intermediate nodes.