Research Article

Energy-Efficient Unequal Chain Length Clustering for Wireless Sensor Networks in Smart Cities

Algorithm 1

Cluster head selection.
() if    then
()
() end if
() if  beCandidateHead = True  then
()
(6) else
(7) EXIT;
(8) end if
(9) On receiving a form node
(10) if   OR   then
(11) Add to cluster group
(12) end if
(13) while  beCandidateHead = True do
(14) if  ,
  then
(15)
(16) Exit
(17) end if
(18) On receiving form node
(19) if    then
(20) and then EXIT
(21) end if
(22) On receiving a form node
(23) if    then
(24) Remove from cluster group
(25) end if
(26) end while
(27)
(28) On not receiving a form node
(29)