# Range-Free Localization Approaches Based on Intelligent Swarm Optimization for Internet of Things
## 4 Simulation Results and Discussions  
Comprehensive simulations were carried out using a MATLAB-based simulator to assess the performance of all the introduced algorithms. MATLAB is a widely endorsed numeric computing platform favored by many researchers for algorithm analysis, data examination, and scenario modeling. Hence, in this study we employed MATLAB 2019a to assess the performance of our algorithms for localization within static WSNs. Moreover, the performance of our developed algorithms was contrasted with that of the original DV-Hop, a PSO variant called PSODV-Hop [48], and the enhanced DV-Hop algorithms MDV-Hop [33], W-DV-Hop [38], and HW-DV-Hop [39] through a series of simulations. The localization error and localization accuracy of each algorithm were evaluated by varying the simulation parameters, including the number of sensor nodes, ratio of sensor nodes to anchor nodes, range of communication \(R\), and maximum number of iterations considering a square random network topology and three distinct types of complex network topologies (H-shaped, O-shaped, and W-shaped). The localization accuracy used to confirm the efficiency of the introduced approach was determined by calculating the average localization error using the formula in Equation (33):  
\[\textit{Localization error}=\sqrt{(x_{\text{exact}}^{i}-x_{\text{estimated}}^{i })^{2}+(y_{\text{exact}}^{i}-y_{\text{estimated}}^{i})^{2}} \tag{32}\]  
\[\textit{Localization accuracy}=\frac{\sum_{i=1}^{N}\sqrt{(x_{\text{exact}}^{i}-x_{ \text{estimated}}^{i})^{2}+(y_{\text{exact}}^{i}-y_{\text{estimated}}^{i})^{2}} }{N\times R} \tag{33}\]  
where \((x_{exact}^{i},y_{exact}^{i})\) represents the exact coordinate of sensor \(i\) and \((x_{estimated}^{i},y_{estimated}^{i})\) represents the estimated coordinate of sensor \(i\). The localization error signifies the disparity between the accurate and estimated geographical position of the unknown node. This error is quantified according to the formula presented in Equation (32). The evaluation of the new algorithms involved the following parameters: (i) the network topology, characterized by the ratio of sensor nodes to anchor nodes and the communication range \(R\); (ii) the distribution of sensor nodes in a selected 100 m \(\times\) 100 m area; and (iii) the communication range \(R\) used by all sensors in the network. A total of 30 experiments were carried out, and the reported values represent the average result derived from each of these experiments. Table 2 describes the simulation parameters in detail. The efficiency of the introduced algorithms regarding localization accuracy was examined considering parameters such as the numbers of sensor nodes and anchor nodes, range of communication, maximum number of iterations, and time of complexity in four distinct types of topologies: square random, H-shaped, O-shaped, and W-shaped. The nodes within the square were distributed randomly in a defined area of interest. This distribution is the \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Network & \\ \hline Network topology & Square random, H-shaped, O-shaped, and W-shaped \\ Total runs & 30 \\ Length of area & 100 m \(\times\) 100 m \\ Number of nodes & 200, 250, 300, 350, 400, 450, and 500 \\ Number of anchor nodes & 15\%, 20\%, 25\%, 30\%, 35\%, and 40\% \\ Communication range \(R\) & 15 m, 20 m, 25 m, 30 m, and 35 m \\ \hline PSO & \\ \hline Number of iterations & 50 \\ particle sizes & 20 \\ Random values \(\sigma_{1}\) and \(\sigma_{1}\) & \([0,1]\) \\ Learning coefficient \(C_{1}\), \(C_{2}\) & 1.5 and 2 \\ Particle’s velocity \(V_{max}\) & 10 \\ \hline CSO & \\ \hline Number of iterations & 50 \\ Size of chicken swarm & 20 \\ Number of roosters & 8 \\ Number of chicks & 1 \\ Number of hens & 15 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Detailed simulation parameters. most commonly utilized topology for localization techniques.