0% found this document useful (0 votes)
621 views10 pages

Wave and Traversal Algorithms

The document discusses different types of distributed algorithms: 1) Wave algorithms must terminate with each process making a decision casually dependent on an event in every other process. 2) Tree algorithms have each leaf initiate the algorithm by sending one message along incident channels until a message is received from all but one channel and sent through the remaining channel. 3) Traversal algorithms are centralized wave algorithms where a token first visits all processes building a spanning tree before returning to the initiator to decide.

Uploaded by

Joy Bagdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
621 views10 pages

Wave and Traversal Algorithms

The document discusses different types of distributed algorithms: 1) Wave algorithms must terminate with each process making a decision casually dependent on an event in every other process. 2) Tree algorithms have each leaf initiate the algorithm by sending one message along incident channels until a message is received from all but one channel and sent through the remaining channel. 3) Traversal algorithms are centralized wave algorithms where a token first visits all processes building a spanning tree before returning to the initiator to decide.

Uploaded by

Joy Bagdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 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