You are on page 1of 10

Wave and Traversal

Algorithms
Wave Algorithms
• A wave algorithm exchanges a finite number of messages and then makes a
decision, which depends casually on some event in each process.
• A wave algorithm is a distributed algorithm that satisfies the following three
requirements
• 1. Termination – Each computation is finite
• 2. Decision – contains at least one decide event
• 3. Dependence – Each decide event is casually preceded by an event in each process.
• Centralization – An algorithm is called centralized if there must be exactly
one initiator in each computation, and decentralized if the algorithm can be
started spontaneously by an arbitrary subset of the processes. Centralized
algorithms are also called single-source algorithms and decentralized
algorithms are called multi – source algorithms.
Tree Algorithm
• Assume that all leaves of the tree initiate the algorithm. Each process sends
exactly one message in the algorithm. If a process has received a message via
each of its incident channels except one, the process sends a message via the
remaining channel.
Echo Algorithm
• The algorithm floods <tok> messages to all processes, thus defining a
spanning tree, tokens are “echoed” back via the edges of this tree very much
like the flow of messages in the tree algorithm.
• The initiators sends messages to all its neighbours except the one from
which the message was received, when a non-initiator has received messages
from all its neighbours an echo is sent to the father. When the initiator has
received a message from all its neighbours, it decides.
Traversal algorithm
• A traversal algorithm is a centralized wave algorithm; i.e. there is one initiator, which
sends around a token.
• In each computation, the token first visits all processes
• Finally, the token returns to the initiator, who performs a decide event
• Traversal algorithms build a spanning tree
• The Initiator is the root, and
• Each nominator has as parent the neighbor from which it received the token first.
Tary’s Algorithm
• Consider an undirected network
• R1 A process never forwards the token through the same channel twice
• R2 A process only forwards the token to its parent when there is no other option
• The token travels through each channel both ways, and finally ends up at the
initiator.
Message complexity: 2E messages
Time complexity: ≤ 2E time units
Depth – First Search
• DFS is obtained by adding to Tary’s algorithm
• R3 When a process receives the token, it immediately, sends it back through
the same channel if this is allowed by R1, R2
• Example:

• In the spanning tree of a DFS, all frond edges connect an ancestor with one
of its descendants in the spanning tree.
Thank You

You might also like