| Algorithm 3: Cluster Maintenance |
| 1: if ACK from is not heard by
2: deplete from CM list 3: end if 4: if leaves the cluster 5: execute Algorithm 2 6: end if 7: if a new node requests to join the cluster 8: the new node sends HELLO message to 9: if (remaining energy of the new node ) 10: reply ACK and agree to join 11: else 12: ignore the request 13: end if 14: end if |