Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Analysis of Algorithms
Leader Election in a Ring
John Augustine
unique
id
around
the
If the ring is bidirectional, then we fix a direction and use only that fixed
direction.
CS6100 (Even 2012): Leader Election in a Ring
n
2`1 + 1
n
2`1
+1
8n.
Time Complexity
Each node with uid v sends out its token that travels
at the rate of 1 hop for every 2v rounds. If the token
encounters a node with a smaller id, it stops. If a token
returns to its sender, the sender elects itself leader.
Again, the node with minimum id is elected leader. Its
token travels n hops.
The next smallest makes at most n/2 hops.
The kth smallest makes n/2k1 hops.
Therefore, total message complexity is at most 2n.
The time complexity is n 2umin .