Research Article

An Anchor Node Selection Scheme for Improving RSS-Based Localization in Wireless Sensor Network

Algorithm 2

The modified cuckoo search algorithm.
1.For all do
2.Calculate the fitness using the Equation (10)
3.End For
4.N_iter=1
5.While (N_iter<N_itertotal) do
6. For all do
7.Compute the step size for flight according to the Equation (11)
8.Generate a new cuckoo from the nest randomly by taking Lévy flight using the Equation (12)
9.If ()then
10.
11.End If
12.If ()then
13.
14.End If
15.Calculate the fitness using the Equation (10)
16.Choose a random nest () among n nest randomly
17.If () then
18.
19.
20.End If
21.End For
22.Keep the current global optimal fitness:
23.Compute the probability using the Equation (16)
24.A fraction () of worse nests abandoned and new ones/solutions are built/generated correspondingly
25.For all the nests(say, ) to be built/generated do
26.If ()then
27.
28.End If
29.If ()then
30.
31.End If
32.Calculate the fitness using the Equation (10) and evaluate its quality/fitness
33.Keep best solutions (or nests with quality solutions)
34.End For
35.Rank all the solutions and find the current best
36.End While