Skip to main content
. 2018 Sep 26;18(10):3237. doi: 10.3390/s18103237
Algorithm 1: Neighbor table construction algorithm of ELR-W protocol at node i
Notations:
HP = Hello packet
REj = Residual energy of neighbor node j
LEi,J = Link efficiency between node i and node j
HCj,BNC = Number of hop-counts from neighbor node j to BNC
di,j = Distance between nodes i and j
(NT) = Information in neighbor table
(HP) = Information in Hello packets
Input:
HPs from a neighboring node j
Process:
1.start
2.for each HP do
3. if HP(REJ, LEi,J, HCi,BNC, di,j)NT(REJ, LEi,J, HCi,BNC, di,j) then
4. update record for neighbor information in neighbor table
5. REj(NT)  REj(HP)
6. LEi,j(NT)  LEi,j(HP)
7. di,j(NT)  di,j(HP)
8. HCi,BNC(NT)  HCi,BNC(HP)
9. else
10.Discard HP
11.if HP(E(Res)J, LEi,J, HCi,BNC, di,j) = null then
12. add record in neighbor table
13. REj(NT)  REj(HP)
14. LEi,j(NT)  LEi,j(HP)
15. di,j(NT)  di,j(HP)
16. HCi,BNC(NT)  HCi,BNC(HP)
17. else go to line 3
18.end if
19.end if
20.end for
21.end