| Algorithm 1: Aggregator Selection. |
| Input: Number of regions, set of nodes in the region |
| Output: Optimal aggregator node |
| 1. Initialization stage: |
| a. Calculate the total power level of all sensors in the region. |
| b. Calculate the individual power level of all sensor nodes. |
| c. Calculate the probability of percentage for every node to become an aggregator. |
| 2. Steady phase |
| The node with higher value of probability becomes an aggregator for that region. |