Skip to main content
. 2017 Mar 24;17(4):674. doi: 10.3390/s17040674
Algorithm 1. Optimizing the Position of the Cluster-in Nodes.
Input: set of cluster-in nodes Sc(sk), original position of the cluster-in nodes Po(sk).
Output: deployed position of the cluster-in node Pd(sk).
1: Initialize Pd(sk) = zeros(|Sc(sk)|, 3), SND, SCD = sk;
2: while Sc(sk)  
3:   calculate the CRR of the node in Sc(sk);
4:   si = the node with the minimum CRR;
5:   poriginal(si) = [xoriginal, yoriginal, zoriginal] according to Po(sk);
6:   assuming that pdeployed(si) = [xdeployed,ydeployed,zdeployed] and build the fitness function;
7:   initialize N1, N2, Np, G, and the search range;
8:   initialize the position Xj and the speed Vj of each pigeon individual j;
9:   calculate the fitness2 of each pigeon individual;
10:   Xg = arg min[fitness2(Xj)];
11:   for Nt = 1 to N1 do
12:     for i = 1 to Np do
13:       calculate Vi and Xi according to Equations (8) and (9);
14:     end for
15:     evaluate Xi, and update Xg;
16:   end for
17:   for Nt = 1 to N2 do
18:     if Np > 1
19:       rank the fitness2;
20:       Np = Np/2;
21:        removed the half of pigeons with a lower fitness2;
22:       calculate Xc according to Equation (11);
23:       for i = 1 to Np do (remaining pigeons)
24:         calculate Vi and Xi according to Equation (12);
25:       end
26:        evaluate Xi, and update Xg;
27:     end if
28:  end for
29:  record Xg into Pd(sk), namely, update the value of corresponding row in Pd(sk);
30:  Sc(sk) = Sc(sk) − si;
31:  SND = SND si;
32:  SCD = SCD si;
33: end while;
Notice: Po(sk) and Pd(sk) are the matrix with the size |Sc(sk)| × 3, and Po(sk) = [Poriginal(s1); Poriginal(s2);⋯, Poriginal(si)]. In addition, zeros(|Sc(sk)|, 3) is the matrix whose element is zero and whose size is size |Sc(sk)| × 3.