## 4 Survey of Existing Works
### PSO in WSNs
#### 4.1.2 PSO in Node Localization  
Creating location awareness in deployed nodes in WSNs is known as node localization [51]. An obvious but unattractive method of localization is to equip each node with a global positioning system (GPS). Many WSN localization algorithms approximate locations of sensors using a previous knowledge of the coordinates of special nodes called beacons. WSN localization is a two phase process: ranging phase and estimation phase. In first phase all the normal nodes estimate their distances from beacons, the special nodes, using signal propagation time or strength of the received signal [52]. Precise measurement of these parameters is not possible due to noise so the result of such localization is inaccurate. In the estimation phase, position of the target nodes is estimated using the ranging information either by solving equations, or by an optimizer like PSO, which minimizes localization error [10]. Node localization is a multidimensional optimization problem and it can be handled with bio-mimic methods like PSO. In [53] [PERSON] _et al._ have proposed a PSO based localization scheme. The objective is to estimate \(x\) and \(y\) coordinates of \(n\) nodes in a network of \(m\) nodes deployed in two dimensional plane. The remaining (\(m\) - \(n\)) nodes are anchor nodes. Hence for a 2-D localization problem, a total of \(2n\) unidentified coordinates, \(\Theta=[\Theta_{x}\), \(\Theta_{y}]\); where \(\Theta_{x}=[x_{1}\), \(x_{2}\),..., \(x_{n}]\) and \(\Theta_{y}=[y_{1}\), \(y_{2}\),..., \(y_{n}]\) are to be estimated using anchor node coordinates \([x_{n+1}\),..., \(x_{n+m}]\) and \([y_{n+1}\),..., \(y_{n+m}]\). If (\(x\), \(y\)) are the coordinates of the target node to be determined, then the distance between the target node and the \(i^{\text{th}}\) anchor node \(d_{i}\) will be:  
\[d_{i}=\sqrt{\left(x-x_{i}\right)^{2}+\left(y-y_{i}\right)^{2}} \tag{6}\]  
The BS runs PSO to minimize the objective function which is defined as:  
\[f(x,y)=\frac{1}{M}\sum_{i=1}^{M}(\sqrt{(x-x_{i})^{2}+(y-y_{i})^{2}}-\hat{d}_{i })^{2} \tag{7}\]  
where (\(x\), \(y\)) is the node location that needs to be determined and (\(x_{1}\), \(y_{1}\)) are the coordinates of the \(i^{\text{th}}\) anchor node. M \(\geq\) 3 is the number of beacons or anchor nodes within transmission range of the target node. Here \(\hat{d}_{i}\) is the measured value of \(d_{i}\) between the beacon \(i\) and a node (calculated under noise conditions). The variance of noise affects the localization precision. The method works well if the beacons have sufficient range or the beacons are plenty in number. Simulation showed that the localization error is more than halved with respect to simulated annealing [54] in all experiments, but it needs to be mentioned that in this method BS requires distance estimation from all nodes to all beacons. This results in congestion and massive expenditure of energy in WSNs. An addition to the above work is that reported in [55] by [PERSON] _et al._, which uses a bacterial foraging algorithm along with PSO. It is focused on range-based distributed iterative node localization. In this scenario the target node that has three or more beacons in its hearing range runs PSO to minimize the localization error and estimates its own x and y coordinates in a plane mission space. The localized nodes act as beacons themselves in the next iteration. This continues iteratively till all the nodes get localized. This method can localize all nodes that have three localized nodes or beacons in their range. This approach can lessen inaccuracies due to flip ambiguity based on some conditions. The work compares PSO with bacterial foraging algorithm with normal PSO. It is reported to show more efficiency in terms of searching capability. On the other hand, the bacterial foraging algorithm is reported to be less memory intensive and more accurate. In [56] [PERSON] _et al._ have proposed a PSO-based distributed localization scheme that does not involve beacons.