Research Article
A Clustering Protocol for Wireless Sensor Networks Based on Energy Potential Field
N( , C[]) | is the cluster node id, [] is a array of the cluster heads id | { | C[] = sort (C[]); | sort [n] according to the order from smallest to largest | find = 0; |
find is a flag of searching success or not | for to | { | if (Ef() = Ef(C[])); | Ef() is the field strength of node i | continue; | else | { | ; | return ; | } | } | if (find ) | Print (“Search fails!”); | } |
|