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, Ti−new, dmax, dij, λ1, λ2, λ3, Ei−residual, Ei−max, randi, typei=no, CHi=no, loriginal, lcurrent
2:Ensure:M
3:While1≤r≤R and Ei−residual>0 do
4: If CHi=no
5:  For i=1 to N do
6:  If randi≤Ti−new
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: r←r+1
19:Endwhile