| Algorithm 1. Unit Data Polling Scheduling and the Maximum Remaining Energy Routing Algorithm. | |
| 1: | Initialize: The complete list N of sensor nodes and the number of sensor nodes n, list D of demand nodes and the number of demand nodes ndn, list S of support nodes and the number of support nodes nsn, and the list of data sending DS and data receiving DR for all sensor nodes. |
| 2: | While ndn > 0, nsn > 0 and support nodes exist within a one- or two-jump distance from the demand nodes, do |
| 3: | For each Di, i ∈ ndn and Sj, j ∈ nsn, do |
| 4: | If Di and Sj lie within a single jump distance, then |
| 5: | Record the route and accumulate DSi and DRj |
| 6: | Update the quantity of data transmitted for Di and Sj |
| 7: | End if |
| 8: | If Di and Sj lie within a two-jump distance, then |
| 9: | Find all routes from Di to Sj, and select the route Nk that has the greatest remaining energy |
| 10: | Record the route and accumulate DSi, DRj, DSk, and DRk |
| 11: | Update the quantity of data transmitted for Di and Sj |
| 12: | End if |
| 13: | End for |
| 14: | End while |
| 15: | Compute the energy consumption using DS and DR. |
| 16: | Update the remaining energy for all nodes. |