Skip to main content
. 2019 Oct 21;19(20):4579. doi: 10.3390/s19204579
Algorithm 1. IEE-LEACH
1. N-number of nodes, r-number of rounds.
2. The first step is to initialize the network parameters for WSN.
3. The second step is the random deployment of the nodes in the network.
4. The third step is the deployment of the BS in the network.
5. Calculate dtoBS
6. for i=1 to r
7. Ea=Et(1rrmax)/n
8. pi=pnEriEi/(EtEa)
9. T(si)=pi/(1pi(rmod(1/pi)))
10. t=Random number
11. If (tT(si))
12. CH ni
13. Calculate dtoCH
14. end if
15. if (dtoCH<dtoBS)
16. Select CH and join the cluster;
17. else
18. Nodes do not participate in the cluster
19. end if
20. Transfer to BS
21. i=i+1
22. go to step 6
23. end