Distributed Algorithms

May 1st, 2015
Studypool Tutor
Price: $10 USD

Tutor description

The algorithm requires the processes know diameter of ring. The algorithm just floods the max UID throughout the network. so we call it flood max algorithm. Every process maintains a record of maximum UID it has seen so far (initially its own).At each round, each process propagates this maximum on all of its outgoing edges. After diameter rounds, if the value seen is the process own UID process selects itself a leader.

Word Count: 878
Showing Page: 1/8
Distributed AlgorithmsDDAPractical-21)Algorithm for leader election in general synchronous ring know as Flood Max algorithm and explanation of state diagram.//leader election in a general synchronous ringsetUID = {[3],[13],[12],[7],[19]}const N = #UIDrange ID = 1..NsetM = {UID}const Diam = 4 //should be 4range Int = 0..Diam//links or channels hold at most a single messageset Network = {[1][2], [2][3], [2][5], [5][3], [3][4], [4][1]}CHAN(Ch='[0][0]) =(put[Ch][m:M] -> get[Ch][m] -> CHAN).ALLOW = (get.Network.M->ALLOW)+{get[ID][ID][M]}.||NETWORK = (forall[ch:Network] CHAN(ch) || ALLOW)/{forall[i:ID] {put[i]/put[i][ID]}}.//the synchronous model proceeds in two stepsROUND = (step1 -> step2 -> ROUND).//the processesPROCESS(Id=1,U=19)= (start->init[Id][U]->step1->MSGS[U][0]),MSGS[max:M][rounds:Int]= (put[Id][max] -> step2 -> TRANS[max][rounds+1]),TRANS[max:M][rounds:Int]= (get[ID][Id][m:M]-> if (m>max) then(display[Id][m]->TRANS[m][rounds])else(display[Id][max]->TRANS[max][rounds])|step1 -> if (rounds==Diam) then LEADER[max] else MSGS[max][rounds]),LEADER[max:M]= if (max == U) then(leader[Id] -> STOP)else(notleader[Id] -> STOP).||SYS = (forall[i:ID] PROCESS(i,@(UID,i-1)) || NETWORK)>>{step1,step2}.propertyONELEADERELECTED[i:1..N]= (leader[i] -> ELECTED[i]).= (leader[i:ID] -> ELECTED[i]),menu RUN = {step1,step2}animation NETWORK = "xml/network.xml"actions{init[i][u:UID]/display[i][u],lea

Review from student

Studypool Student
" Awesome! Exactly what I wanted. "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1822 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors