Skip to main content
. 2019 Jun 6;19(11):2579. doi: 10.3390/s19112579
Algorithm 1: The method for obtaining initial cluster centers
Input: the coordinate set of N sensor nodes {X1,X2,X3,,XN};
fori = 1, 2, 3, …, Ndo
  for j = 1, 2, 3, …, N do
   if i == j then
    set preference Si,i=6000
    else
     calculate similarity Si,j=XiXj2
    end if
  end for
end for
Repeat
for i = 1, 2, 3, …, N
  for j = 1, 2, 3, …, N
   calculate responsibility Ri,j=Si,jmaxjj{Si,j+Ai,j}
   if i == j then
    Ai,j=iimax{0,Ri,j}
   else
    Ai,j=min{0,Rj,j+i{i,j}max{0,Ri,j}}
   end if
  calculate T=argmaxj{Ai,j+Ri,j}
  End for
End for
UntilT does not change