简体   繁体   中英

LCR vs Floodmax in distributed computing (Leader Election)

I am trying to understand the practical difference between LCR and Floodmax within the context of synchronous networks.

I understand that Floodmax has a time complexity of O(N) and in essence works as follows:

  • Every process keeps the maximum UID it has seen so far (initially its own).
  • At each round, each process sends this maximum value to every outgoing neighbor.
  • After diam rounds if the maximum value is the process's UID then it elects itself the leader, otherwise it is a non-leader.

LCR on the other hand:

  • Each process sends its UID around the ring. When a process receives a UID, it compares this one to its own.
  • If the incoming UID is greater, then it passes this UID to the next process.
  • If the incoming UID is smaller, then it discards it.
  • If it is equal, then the process declares itself the leader.

It too has a time complexity of O(N). So, in essence, both algorithms pass around UIDs in a token-ring network. Is there any real difference or advantage between the two?

As the name implies, the FloodMax algorithm "floods" the network with messages. Unlike LCR, FloodMax will work even if the network topology is not a ring. A pre-requisite for the FloodMax algorithm is that the network diameter must be known (with LCR this is not the case) and has a time complexity of diameter-rounds. LCR on the other hand does not require the network diameter to be known: because of this it requires additional communication overhead as the leader needs to notify all other processes to terminate once it has elected itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM