Skip to main content
. 2012 Aug 2;12(8):10463–10486. doi: 10.3390/s120810463

Algorithm 1: The Cluster-head (CH) and Vice-CH election.

for s1 to #nodes do
τs ← τs + Δτκ;
τsτs(1+Δτκ);
 Determine the value of the linguistic variable, etas;
ηs ← defuzzification of etas;
psκ={As=wτs+(1w)ηsw+(1w)(|Ns|1),ifsκ,0,ifsκ,;
chancespsκ;
 Advertise the value of chances;
 Receive the other advertisements and compare them;
if the value of chances is greater than of the others then
  Advertise a CH message;
else
  if the value of chances is the next higher value then
   Advertise a vice CH message;
  else
   Select the closest CH as its coordinator;
   Join the cluster.
  end
end
end