Skip to main content
. 2019 Jun 6;19(11):2579. doi: 10.3390/s19112579
Algorithm 2: The method for clustering
let T as the set of initial cluster centers;
calculate the number of initial cluster centers k=T
Repeat
 assign each remaining common node to the cluster with the nearest medoid;
 randomly select a common sensor node τrandom;
 calculate the cost function S(S=σ*σ) of swapping node τj with τrandom;
if S<0 then
  swap τj with τrandom to form the new set of k clusters;
 Until no change
Output: a set of k clusters.