Leader Election in Rings - O (n2) Algorithm, Bully Algorithm
Leader Election in Rings - O (n2) Algorithm, Bully Algorithm
Course Outcome 2:
Leader Election in Rings - 𝑂𝑂(𝑛𝑛2 ), O(nlogn)
and Bully algorithms, Mutual Exclusion in
Shared Memory, CLASSICAL
ALGORITHMS- Token Based Algorithm:
Central Solution, Ring Based Mutual
Exclusion, Non-Token Based Algorithm: Ricart-
Agrawala’s Algorithm, Maekawa’s Algorithm.
1. LEADER ELECTION IN RINGS
Time: o(n)
In general:
LEADER ELECTION IN RINGS
Correctness: Similar to LCR algorithm.
Message Complexity:
Each message belongs to a particular phase
and is initiated by a particular processor.
Probe distance in phase i is 2𝑖𝑖.
Number of messages initiated by a processor in phase i is at
most 4· 2𝑖𝑖 (probes and replies in both directions).
LEADER ELECTION IN RINGS
How many processors initiate probes in phase k ?
For k = 0, every proc. does
For k > 0, every proc. that is a "winner" in phase k-1
does
– "winner" means has largest id in its 2k-1
neighborhood