Computer Network Assignment Help
Computer Network Assignment Help
For any Assignment related queries, Call us at : - +1 678 648 4277
You can mail us at : - support@computernetworkassignmenthelp.com or
reach us at : - https://www.computernetworkassignmenthelp.com/
(a) First suppose that the processes are deterministic, and that
they know n (the size of the ring). Either give a correct leader
election algorithm for this case, or prove that no such
algorithm exists. If you give an algorithm, analyze its time and
message complexity.
It should be clear that, at the first phase where all the processes
choose distinct ids, exactly one process elects itself the leader,
and then the algorithm halts. So certainly the algorithm never
elects more than one leader.
At each phase, with probability at least 1/2, all the chosen ids are
distinct and the algorithm terminates. Since the choices in
different phases are independent, the probability that the
algorithm finishes within h phases is at least 1 − 2 1 h . Thus, with
probability 1, it eventually finishes.
At phase d, d ≥ 2:
Node v0 broadcasts ready messages down all the branches of the
tree built so far, until they reach the new nodes. Each new node
sends search messages to all its neighbors. When a node receives
a search message, if it does not already have a parent, it sets its
parent variable to the sender’s id, records that it is new, and sends
a parent response. If it already has a parent, it sends a nonparent
response.
When node v0 has received done messages from all its children, it
begins phase d + 1 if any of the messages contain value 1;
otherwise it halts.
(b) Analyze the time and communication complexity of your
algorithm, and compare them to the costs of the asynchronous BFS
algorithm presented in class.
Solution: The time complexity is O(diam2 · d). Each phase takes time
O(diam · d), and there are O(diam) phases.