View full-text article in PMC Sensors (Basel). 2020 Jul 23;20(15):4095. doi: 10.3390/s20154095 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1: EERS pseudo-code for reference node selection (sink node only) Initial:,CoverNodesFlag←false,cnt ←0, k←0, SeqN←0 1. s←sink node 2. RefNodes(1)←s 3. Schslot(1)←0 4. CoverNodesFlag(s)←true 5. Compute the hop distance from s and the level to every node (i.e., using BFS) 6. while (k !=LevelMax−1) do//LevelMax is equal to the level of the farthest node from sink node 7. for (every edge (i,j)∈E, i∈Nk,j∈Nk+1 ) do 8. detrmine di,j 9. end for 10. while (CoverNodesFlag(Nk+1) !=true) do 11. R←Nk(max(di,j)) 12. RefNodes(cnt)←R 13. SchSlots(cnt)←cnt 14. CoverNodesFlag(m) ←true // (m⊆ Nk+1) are the neighbor nodes of R 15. cnt←cnt+1 16. end while 17. k←k+1 18. end while 19. SeqN←SeqN+1 20. brodcast refernces scheduling message <RefNodes,SchSlots, SeqN>