Skip to main content
. 2019 Oct 29;19(21):4704. doi: 10.3390/s19214704
Algorithm 1 ICL-LEACH Algorithm for CH Node Election
1:Require:N, M, n, r, R, p, G, Tinew, dmax, dij, λ1, λ2, λ3, Eiresidual, Eimax, randi, typei=no, CHi=no, loriginal, lcurrent
2:Ensure:M
3:While1rR and Eiresidual>0 do
4: If CHi=no
5:For i=1 to N do
6:  If randiTinew
7: typei=CH and CHi=yes
8:  CHnodebroadcasts the selected message to all the nodes
9:  CH node uses TDMA to allocate time slots and transmits data
10:   Else typei=CM and CHi=no
11:  CM node waits for the broadcast information of CH node
12:  CM node waits to allocate a time slot
13:   End if
14:    nodes enter the stabilization phase
15:End for
16:  Else CH node performs data fusion and data transmission
17: End if
18: rr+1
19:Endwhile