I'm new to the whole distributed system world. I need help to how to form a cluster on this environment and also decide which one is the CH(cluster header). I want use spanning tree to choose the nodes with highest energy to be the CH. When CH is chosen, every other nodes should send their information to CH and CH send it to the base station(the red node).
The problem is I don't know how the algorithm should be. Here's some algorithm I tried to do
Clustering algorithm
- Every one hour, nodes start a spanning tree to find the nodes which contains most energy
If a nodes which receive a “search” message:
-compare the energy left of each nodes, if the energy from the sender is lower than itself. Reply with it own ID. If the energy from the sender is higher than itself. Reply with the senders ID and pass it to the other neighbor
- When a nodes receives it’s own ID, it make it self cluster header
- When other nodes knows the cluster header has been choose start sending information to cluster header
Environment:
Assume that this is a router network
The number is energy power of each nodes
The red nodes is the base station.