# Accurate Range-Free Localization Algorithms Based on PSO for Wireless Sensor Networks

Abdelali Hadir, Younes Regragui, Nuno Garcia

► To cite this version:

Abdelali Hadir, Younes Regragui, Nuno Garcia. Accurate Range-Free Localization Algorithms Based on PSO for Wireless Sensor Networks. IEEE Access, 2021, 9, pp.149906-149924. 10.1109/AC-CESS.2021.3123360. [hal-03427460](https://hal.science/hal-03427460)

HAL Id: hal-03427460

https://hal.science/hal-03427460

Submitted on 20 Nov 2021

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
Received September 29, 2021, accepted October 15, 2021, date of publication October 27, 2021, date of current version November 11, 2021.

Digital Object Identifier 10.1109/ACCESS.2021.3123360

# Accurate Range-Free Localization Algorithms Based on PSO for Wireless Sensor Networks

ABDELALI HADIR<sup>1,2</sup>, YOUNES REGRAGUI<sup>1,3</sup>, AND NUNO M. GARCIA<sup>1,2</sup>

Corresponding author: Abdelali Hadir (a.hadir@ubi.pt)

This work was supported by Operação Centro-01-0145-FEDER-000019—C4—Centro de Competências em Cloud Computing, co-financed by the Programa Operacional Regional do Centro (CENTRO 2020), through the Sistema de Apoio à Investigação Científica e Tecnológica—Programas Integrados de IC&DT (Este trabalho foi suportado pela Operação Centro-01-0145-FEDER-000019—C4—Centro de Competências em Cloud Computing, co-financiada pelo Programa Operacional Regional do Centro (CENTRO 2020), através do Sistema de Apoio à Investigação Científica e Tecnológica—Programas Integrados de IC&DT). This work is also funded by FCT/MEC through national funds and when applicable co-funded by FEDER—PT2020 partnership agreement under the project UID/EEA/50008/2019 (Este trabalho é financiado pela FCT/MEC através de fundos nacionais e quando aplicável cofinanciado pelo FEDER, no âmbito do Acordo de Parceria PT2020 no âmbito do projeto UID/EEA/50008/2019).

**ABSTRACT** Recently, localization accuracy of unknown nodes has become a critical and challenging issue for many Wireless Sensor Networks (WSNs) and Internet of Things (IoT) applications. Without associating the detected event with its precise geographic location will be surely considered meaningless for these applications. Among all localization algorithms, we observe that the DV-Hop localization algorithm is highly recommended to use in many fields of application due to its simplicity, feasibility, low cost, and no extra hardware requirements, but the localization error caused by the DV-Hop algorithm is relatively large. In this current work, based on both the DV-Hop algorithm and the Particle Swarm Optimization algorithm, we proposed four new localization algorithms to overcome the shortcomings of low accuracy that the basic DV-Hop based algorithms produce. The simulation results showed that the proposed localization algorithms can achieve a better localization performance in terms of accuracy in comparison with other existing algorithms such as basic DV-Hop, MDV-Hop and DV-HopPSO under different random network topologies. We also observed that a significant localization accuracy is achieved by the proposed algorithm HWDV-HopPSO.

**INDEX TERMS** DV-Hop, Internet of Things, localization algorithm, particle swarm optimization, PSO, wireless sensor networks.

## I. INTRODUCTION

The Internet of Things (IoT) concept and Micro-Electromechanical Systems [1], [2] allow designing and manufacturing a large amount of small wirelessly interconnected devices, which are able to detect, monitor, process and transmit physical phenomena such as temperature, pressure via Radio Frequency Identification (RFID), Zigbee, Internet, Wi-Fi, Bluetooth, 3G, 5G, and so on. In fact, every sensor node is equipped with a processor, transceiver, and power unit. Every device (i.e., sensor) has the ability to send data to the Base Station (BS) where the gathered information can be analyzed and interpreted as useful information with significant meaning [3], [4]. In addition, these devices are considered to be a key component to deploy a wireless sensor network in different environments and with respect to

WSN design and requirements depending on each application field, such as military, target tracking and environmental applications [5]–[8]. Localization phase is the most required service for most IoT networks’ applications including smart cities, health care monitoring, traffic management, road traffic monitoring, disaster detection, geographic routing, and so on [9]–[14] because it helps to understand and analyze detected events by sensor nodes. More precisely, when the sensor is assigned precise roles, the collected events could be then figured out and easy to understand depending on their context or scenario of application [15]; otherwise, the identified event will have no important meaning. For instance, Figure 1 demonstrates the necessity and importance of localization in many applications.

According to Figure 1, finding out the exact location of devices is a crucial challenge in IoT applications. The Global Positioning System (GPS) [16] is one of the most common applications used to determine the location of sensor nodes

The associate editor coordinating the review of this manuscript and approving it for publication was Resul Das<sup>1,7</sup>.

<footnote n="1">¹ENCG, Hassan II University, Casablanca 20000, Morocco</footnote>

<footnote n="2">²Cloud Computing Competence Centre (C4-UBI), Universidade da Beira Interior, Rua Marquês d'Ávila e Bolama, 6201-001, Covilhã, Portugal</footnote>

<footnote n="3">³LAROSERI, Department of Computer Science, Chouaib Doukkali University, El Jadida 24000, Morocco</footnote>
<figure><img src="image_2.png" /><figcaption>FIGURE 1. Importance of the localization in many applications.</figcaption></figure>

in many fields. Therefore, equipping all these devices with GPS or a different auto-positioning system will not always be considered as the best solution because they are very costly in terms of additional hardware. This might add further overheads, such as power consumption. Consequently, many localization solutions have been proposed to overcome this issue based on the use of anchors (i.e, nodes whose locations are known) to estimate the positions of unknown nodes (i.e, the rest of the nodes whose locations are not known) deployed in the WSNs [17]. These anchor nodes perform a localization process to estimate the positions of unknown nodes. Indeed, the unknown nodes are randomly organized either because of the immensity or either of the hostility of the area in which nodes will be deployed. Figure 2 presents a descriptive example of the localization process. Over the last few years, localization algorithms have been attracted a great attention and are widely adopted for use for many sensor networks applications. Indeed, several localization algorithms have been proposed to accurately estimate the location of unknown nodes based on known nodes (anchors). These algorithms are generally divided into two major categories: range-based [18]–[20] and range-free [21], [22]. The range-based algorithms have been widely used, and in their turn, they include many algorithms such as ToA (Time of Arrival) [23], TDoA (Time Difference of Arrival) [24], RSSI (Received Signal Strength Intensity) [25] and AoA (Angle of Arrival) [26], respectively. All these localization algorithms try to calculate the distance or the angle between synchronized sensor nodes, and then approximate the location of unknown nodes using trilateration or triangulation techniques. These techniques have higher accuracy, but they require additional hardware and cause an extra overhead. Unfortunately, these techniques are not a good candidate for sensor nodes localization because they require additional hardware support, and thus are very costly to

be adopted, especially in large-scale sensor networks [27]. Range-free algorithms require only the connectivity information between sensor nodes. Moreover, the major idea behind these localization algorithms is based on the use of anchor nodes as they are assigned exact geographic positions and belong to the same geographic area. Therefore, unknown nodes try to exploit this advantage to estimate their locations in the wireless sensor network based on the connectivity with nearby anchors. The most popular algorithms that belong to this category include: DV-Hop algorithm [28], Centroid algorithm [29], Approximate Point in Triangle Test (APIT) algorithm [30], and Amorphous [31]. For example, the Centroid algorithm [32] is based on the number of neighboring anchor nodes to anchor nodes to compute the barycenter that will be considered as the estimated location of unknown nodes without additional materials. APIT [30] is a range-free localization algorithm that assumes the use of three anchor nodes to estimate the position of sensor nodes. This algorithm can achieve better results with a large number of anchors. Amorphous [33] is a very similar algorithm of DV-Hop used to determine the locations of unknown nodes with a high accuracy, especially in random WSNs. DV-Hop [34] is the well-known range-free localization algorithm. It's a suitable solution to localize unknown sensor nodes, which have some nearby anchors [17]. In DV-Hop, the sensor node calculates the minimum number of hops towards anchors and average hop size to estimate the positions of unknown nodes. This algorithm is simple, practicable and offers a high quality of coverage, and does not require additional overhead. In addition, DV-Hop has advantages such as capacities to localize unknown nodes that are surrounded by at least three neighbor anchors. In general, range-free algorithms have several advantages over range-based strategies, such as little communication overhead, no requirement of additional equipment, and provide a better localization accuracy.
However, many more efforts are needed to tackle the disadvantages of range-free localization algorithms such as localization accuracy. Therefore, in this paper, we propose four new localization algorithms which are based on DV-Hop and PSO to estimate the position of unknown nodes in WSNs with a higher localization accuracy. The main contributions of the current paper are summarized as follows:

* Four new localization algorithms named WDV-Hop, HWDV-Hop, WDV-HopPSO and HWDV-HopPSO, respectively are proposed.

* New steps have been added to increase the localization accuracy of these algorithms.

* Four different kinds of complex network topologies are considered.

* Performance of the proposed localization algorithms was evaluated in terms of localization error and localization accuracy. The results compared to the basic DV-Hop, DV-HopPSO and MDV-Hop according to the total number of nodes, percentage of anchor nodes and communication range.

* Simulation results show the superiority of the proposed algorithms in different scenarios.

The rest of this current paper is organized as follows. Section II presents the background on localization algorithms from the literature. In Section III, the localization process of basic DV-Hop algorithm and our proposed algorithms based on DV-Hop and Particle Swarm Optimization are detailed. In Section V, simulation results are investigated and localization performances are discussed. Finally, in Section VI, conclusions and future works are given.

## II. BACKGROUND AND RELATED WORKS

In this work, we focus on range-free algorithms and investigate mainly the localization improved algorithms of DV-Hop algorithm. Despite its advantages, the distance between anchor nodes and unknown nodes is prone to be inaccurate due to errors in the distance calculation of the average hop size. Moreover, errors in the computed distance between sensor nodes are the reason for poor localization accuracy. Furthermore, several enhancements of the DV-Hop algorithm have been proposed in the literature to enhance its location accuracy. The authors in [35], introduced a new DV-Hop based localization algorithm using one mobile anchor node and a modified hop count method to reduce the localization errors of the sensor nodes within wireless sensor networks. The performance of the proposed algorithms has been evaluated in terms of both the communication range and number of anchor nodes. Moreover, they assume that all anchor nodes keep fixed, except for one anchor which is considered mobile. This technique is adopted to construct another technique with a fixed anchor node. However, the results demonstrated that the presented technique in this algorithm based on a mobile anchor showed an improvement in the localization error in comparison to the DV-Hop algorithm. In [36], the authors introduced an enhanced algorithm based on the DV-Hop localization technique in order to overcome

the decrease in the localization accuracy of the basic DV-Hop, especially in the anisotropic network. In fact, the authors conducted three steps to enhance the basic DV-Hop algorithm. In addition, an improved PSO and SA hybrid algorithms were applied in order to find a solution for the nonlinear equations and optimize initially the calculated locations of unknown nodes. The simulation performance shows that the proposed algorithm has a better performance than the DV-Hop and other algorithms in the literature in terms of accuracy. However, the introduced technique increases the communication overload between sensor nodes in the network when performing a forwarding of information based on multi-hop paths. The authors in [35] introduced a new version of DV-Hop to improve the localization accuracy. This improved algorithm applied the double communication radius method to modify the minimum hop count between sensor nodes. Based on this technique, the algorithm may be able to minimize the error of the estimated distance and the Sparrow Search Algorithm (SSA) is used instead of the least square technique. In addition, the SSA algorithm applies the Levy flight strategy in order to enhance the estimation accuracy of unknown nodes' locations. The simulation performances showed that the proposed localization algorithm had a better performance than the basic DV-Hop. The authors in [37] presented another approach called the online sequential localization algorithm based on the DV-Hop. They introduced an algorithm consists of three main phases. Firstly, they used a new formula to compute the distance of average hop between nodes. Secondly, they converted the basic DV-Hop to an online sequential localization technique, and finally they used a sequential technique with the assistance of a pre-defined set of anchor nodes to calculate the location of target nodes. The results of simulation showed that the localization process of the introduced technique was more efficient than the standard DV-Hop. In [38], another improved version of the DV-Hop algorithm is introduced. The authors used the particle swarm optimization algorithm to minimize the localization error produced by the DV-Hop. Indeed, the three main steps of the basic DV-Hop are kept unchanged, whereas a fourth step has been appended to refine the estimated location of unknown nodes. Many analysis performance scenarios have been carried out in order to confirm that the proposed particle swarm optimization based algorithm can significantly minimize the localization error as compared to the basic DV-Hop. In [39], the authors introduced an improved version of the DV-Hop algorithm. In this version, the Received Signal Strength Indication (RSSI) and the polynomial approximation were used to estimate the distance between unknown nodes and anchor nodes. In addition, a recursive computation process to allow the localization of unknown nodes is applied to enhance the accuracy of sensor nodes' locations. Simulation results show that the introduced version of DV-Hop can significantly improve the accuracy of localization. In [40], a Bat algorithm has been applied to improve an existing improved version of the DV-Hop localization method (named BADV-Hop). In this paper, the main idea is to reduce the error brought
by the average distance per hop. Indeed, the Bat algorithm is considered as an intelligent optimization strategy, which is applied to improve the computation of the average distance per hop of anchor nodes.

Simulation results demonstrate that the BADV-Hop can significantly reduce the localization error without the need for additional materials. In [41], an improved based DV-Hop version was introduced. This algorithm performs a localization process based on a combination of two known algorithms to reduce the localization errors: Particle Swarm Optimization (PSO) and shuffled frog leaping algorithm (SFLA). The SFLA algorithm is used to calculate the new average hop size distance and the PSO algorithm is applied to estimate the unknown nodes' positions in WSNs. The simulation results demonstrate that the introduced algorithm can minimize the localization error as compared to the DV-Hop algorithm. In [42], an improvement of the DV-Hop is introduced, the algorithm is denoted as LSDV-Hop. The main idea of this algorithm is based on the use of least squares theory to improve the localization accuracy by extracting a transformation vector between the real and estimated positions of randomly chosen anchor nodes. The obtained least-squares transformation vector is used to update the estimated positions of unknown nodes. The simulation results show that the proposed LSDV-Hop algorithm improves the localization precision of unknown nodes as compared to the DV-Hop. The authors in [43], proposed an improved version of DV-Hop algorithm. The proposed new DV-Hop based algorithm uses a new technique to compute the hop size value in the second step and the 2D Hyperbolic is applied instead of the multitrilateration technique in the third step. Additionally, many simulation scenarios have been conducted to demonstrate that the localization error of the presented algorithm performed better than basic DV-Hop as well as other algorithms. In [44], many enhancements of the DV-Hop algorithm (called iDV-Hop1, iDV-Hop2, and Quad DV-Hop) have been proposed. Accordingly, many geometry techniques have been introduced to minimize the localization error of DV-Hop. The performance of the introduced algorithms have been evaluated under two different network topologies: uniform and c-shaped random networks. The simulation results confirmed that the iDV-Hop1 algorithm could minimize the localization error (up to three times) in scenarios with irregular topologies in comparison with DV-Hop and iDV-Hop2. Hence, with regular topologies, iDV-Hop2 and Quad DV-Hop give better results as compared with DV-Hop. In [45], another DV-Hop based algorithm is proposed. The authors highlight the impact of anchor nodes' mobility on localization error, energy consumption and localization accuracy according to three mobility models: Reference Point Group Mobility (RPGM), Random Waypoint (RWP) and Random Direction (RD) have been sufficiently examined. Several scenarios have been considered to examine the localization performance of introduced algorithms. The simulation results showed that the performance of the proposed algorithms significantly outperformed that of the DV-Hop algorithm regardless of the mobility scenario.

In this current paper, we focus on the range-free approach DV-Hop [28], and we propose four new localization algorithms for WSNs. Here, unknown sensor nodes accurately estimate their locations based on the new formula of average hop-size and Particle Swarm Optimization (PSO) is applied to refine the final position of unknown sensor nodes. Many scenarios have been conducted to verify and study the effectiveness of the proposed localization algorithms when compared to the basic DV-Hop, DV-Hop based PSO [38] (DV-HopPSO), and an improved DV-Hop (MDV-Hop) [43] localization algorithm for WSNs. All algorithms have been developed, implemented in MATLAB simulator and studied for their overall performance in static wireless sensor networks according to four different kinds of complex network topologies which are uniform random, O-shaped, H-shaped and X-shaped topology, respectively by varying the number of total nodes, percentage of anchor nodes and communication range of sensor nodes.

It can be seen from the works of literature that many localization algorithms based on DV-Hop have been designed to minimize the localization errors of each of the estimated unknown sensor nodes, but the accuracy is still not satisfactory and need to be improved. In this paper, four new localization algorithms based on DV-Hop and Particle Swarm Optimization (PSO) have been proposed to enhance the localization accuracy of unknown nodes in Wireless Sensor Networks in order to outperform applications' needs.

### III. PROPOSED LOCALIZATION ALGORITHMS

In this section, we introduced four new localization algorithms based on the DV-Hop and Particle Swarm Optimization algorithm. As previously mentioned, the DV-Hop localization algorithm has limitations that make the estimated location inaccurate for most WSNs applications uses, such as health care and environmental applications due to techniques applied to compute the average hop size and location estimation. However, utilizing nature-inspired optimization algorithms such as PSO is one of the most efficient approaches for increasing the DV-Hop algorithm's localization accuracy. Accordingly, we firstly describe the localization process of the original DV-Hop algorithm and our proposed localization algorithms WDV-Hop and HWDV-Hop previously presented in [46], [47], and afterwards we present the localization algorithms based on particle swarm optimization, named as WDV-HopPSO and HWDV-HopPSO, respectively.

#### A. BASIC DV-HOP

The DV-Hop algorithm [34] has been considered a benchmark for localization in WSNs in recent years. It is a suitable solution to localize devices within IoT applications as well as in WSNs. The DV-Hop algorithm uses some nearby anchors to estimate these devices' locations. The DV-Hop algorithm has three standard stages, which are represented as follows; information broadcasting, computation of average hop size distance, and position estimation. In the first stage, the anchors $A_i$ from the network broadcast a hello
<figure><img src="image_3.png" /><figcaption>FIGURE 2. An example of localization process.</figcaption></figure>

packet including the exact location information of $A_i$ and a hop-count value, which is initialized to 0. This hop-count value will increase with hops increase during the rebroadcasting process of the packet. During the first reception of the packet, every node $N$ (anchor or a normal node) records the anchor $A_i$ position, and initializes $hc_{i,N}$ as a hop-count value in the packet. $hc_{i,N}$ is recorded as the minimum number of hops between $N$ and $A_i$. It's worth noting that a normal node, also called an unknown node, is a sensor node with unknown coordinates, which need to be estimated. If the same packet is received again, $N$ updates the $hc_{i,N}$. If the received packet includes a value of count-hop lower than $hc_{i,N}$, $N$ updates again $hc_{i,N}$ with this lower value of hop count, and relieves the packet; otherwise, $N$ ignores the packet. During this stage, all sensor nodes report the minimum number of hops to every anchor node. In the second stage, as each anchor has received in the first stage the locations of anchors and its minimum hops to other anchor nodes, $A_i$ can calculate its average hop size, denoted $AvgHS_i$. Once $AvgHS_i$ is calculated, it will be flooded across the network by $A_i$. The average hop size $AvgHS_i$ of each anchor $A_i$, can be calculated according to the following formula.

$$ \mathbf{AvgHS}_i = \frac{\sum_{j \neq i} \sqrt{(x_i - x_j)^2 + (y_i - y_j)^2}}{\sum_{j \neq i} hc_{i,j}} \quad (1) $$

In the third stage, during the reception of $AvgHS_i$, the normal node $N$ multiplies $hc_{i,N}$ (the number of hops to $A_i$) by $AvgHS_i$, so that $N$ obtains the approximate distance of each anchor $A_i$, denoted $dist_i(dist_i = AvgHS_i \times hc_i)$, where, $i \in \{1, 2, \dots, k\}$ and $k$ is the total number of anchor nodes. Thus, the following equation can be derived, where $(x, y)$ is

the estimated position of $N$:

$$ \left\{ \begin{array}{l} (x - x_1)^2 + (y - y_1)^2 = dist_1^2 \\ (x - x_2)^2 + (y - y_2)^2 = dist_2^2 \\ \vdots \\ (x - x_k)^2 + (y - y_k)^2 = dist_k^2 \end{array} \right. \quad (2) $$

By solving the above equation based on the least squares techniques, a normal node $N$ could obtain its estimated $N_{DV-Hop}$ position as follows:

$$ N_{DV-Hop} : \begin{bmatrix} x \\ y \end{bmatrix} = (A^T A)^{-1} A^T B \quad (3) $$

where

$$ A = -2 \times \begin{bmatrix} x_1 - x_k & y_1 - y_k \\ x_2 - x_k & y_2 - y_k \\ \vdots & \vdots \\ x_{k-1} - x_k & y_{k-1} - y_k \end{bmatrix} \quad (4) $$

$$ B = \begin{bmatrix} dist_1^2 - dist_k^2 - x_1^2 + x_k^2 - y_1^2 + y_k^2 \\ dist_2^2 - dist_k^2 - x_2^2 + x_k^2 - y_2^2 + y_k^2 \\ \vdots \\ dist_{k-1}^2 - dist_k^2 - x_{k-1}^2 + x_k^2 - y_{k-1}^2 + y_k^2 \end{bmatrix} \quad (5) $$

$A^T$ is the transpose of the matrix $A$, and $A^{-1}$ represents its inverse. The anchors cannot be on the same line, otherwise the equation, $A^T A$ will be singular, so $(A^T A)^{-1}$ does not exist.

## B. WDV-HOP LOCALIZATION ALGORITHM

In our previous paper [46], [47], we proposed an enhanced DV-Hop technique, namely WDV-Hop. In fact, alike
DV-Hop, the WDV-Hop localization process is divided into the following three enhanced steps: i) anchor nodes flood their locations, ii) new formula of the average hop size is adopted, and iii) trilateration method is applied to estimate the nodes' position. More precisely, the first phase of our improved algorithm is similar to the basic DV-Hop. Every anchor node broadcasts a packet including the position of anchor $A_i$ and initializes the hop-count between two anchors by 0. In the second phase, we use a weighted mean technique [48] to compute the average hop size following a new formula. However, in order to calculate the average hop size in WDV-Hop, we applied the mean square error method [49]. Thus, the formula considered to obtain AvgHS$_i$, is described by the following formula:

$$e_1 = \frac{1}{k-1} \sum_{j \neq i} (dist_{i,j} - AvgHS_i \times h_{i,j}^2) \quad (6)$$

where k is the number of anchor nodes, and AvgHS$_i$ is calculated by assuming that $(\partial e_1 / \partial AvgHS_i = 0)$. Here, $dist_{i,j}$ represents the distance from $A_i$ to $A_j$ and $hc_{i,j}$ represents the minimum hop-count values between $A_i$ and $A_j$. It's worth noting that $dist_{i,j}$ represents the real distance between the anchor $A_i$ and $A_j$, by assuming that the positions of anchor nodes are known, for example using the GPS module.

$$\mathbf{AvgHS}_i = \frac{\sum_{j \neq i} h_{i,j} \times dist_{i,j}}{\sum_{j \neq i} h_{i,j}^2} \quad (7)$$

So, the average hop size is calculated using the following formula:

$$\mathbf{AvgHS}_{new} = \frac{\sum_{i=1}^{k} w_i \times AvgHS_i}{\sum_{i=1}^{k} w_i} \quad (8)$$

where

$$w_i = \frac{1}{\sum_{j \neq i} |AvgHS_i - AvgHS_j|} \quad (9)$$

In the third phase, we applied the multitrilateration positioning technique to estimate the location of sensor nodes. Indeed, during AvgHS$_{new}$ reception, the normal node N multiplies $hc_{i,N}$ (the number of hops to $A_i$) by AvgHS$_{new}$, so that N obtains the approximate distance of each anchor $A_i$, denoted $dist_i$ ($dist_i = AvgHS_{new} \times h_i$), here, $i \in \{1, 2, \dots, k\}$ if we assume that there are totally k anchors. Then, the following equation can be derived, where $(x, y)$ is the estimated position of N:

$$\left\{ \begin{array}{l} (x - x_1)^2 + (y - y_1)^2 = dist_1^2 \\ (x - x_2)^2 + (y - y_2)^2 = dist_2^2 \\ \vdots \\ (x - x_k)^2 + (y - y_k)^2 = dist_k^2 \end{array} \right. \quad (10)$$

By solving the above equation based on the least squares techniques, a normal node N could obtain its estimated $N_{DV-Hop}$ position as follows:

$$N_{DV-Hop} : \begin{bmatrix} x \\ y \end{bmatrix} = (A^T A)^{-1} A^T B \quad (11)$$

where

$$A = -2 \times \begin{bmatrix} x_1 - x_k & y_1 - y_k \\ x_2 - x_k & y_2 - y_k \\ \vdots & \vdots \\ x_{k-1} - x_k & y_{k-1} - y_k \end{bmatrix} \quad (12)$$

$$B = \begin{bmatrix} dist_1^2 - dist_k^2 - x_1^2 + x_k^2 - y_1^2 + y_k^2 \\ dist_2^2 - dist_k^2 - x_2^2 + x_k^2 - y_2^2 + y_k^2 \\ \vdots \\ dist_{k-1}^2 - dist_k^2 - x_{k-1}^2 + x_k^2 - y_{k-1}^2 + y_k^2 \end{bmatrix} \quad (13)$$

$A^T$ is the transpose of the matrix A, and $A^{-1}$ represents its inverse. The anchors cannot be on the same line, otherwise the equation, $A^T A$ will be singular, so $(A^T A)^{-1}$ does not exist.

$$A = (G^T G)^{-1} G^T b \quad (14)$$

Thus, N's coordinates are computed as follows:

$$\begin{cases} x_N = A(1) \\ y_N = A(2) \end{cases} \quad (15)$$

### C. HWDV-HOP LOCALIZATION ALGORITHM

In this second proposed Hyperbolic Weighted DV-Hop algorithm (denoted HWDV-Hop), the localization process is divided into the following three enhanced stages: i) anchor nodes flood their locations, ii) the new formula of average hop size is introduced, and iii) the 2D hyperbolic technique is applied, instead of the trilateration technique to compute the nodes' location. More precisely, the first stage of our algorithm is similar to the basic DV-Hop and WDV-Hop, respectively. Every anchor node broadcasts a packet including its locations and initializes the hop-count value between anchor nodes by 0. In the second stage, we use the weighted mean approach [33] to compute the average hop size AvgHS$_i$ following our new formula. Hence, the formula used to calculate the AvgHS$_i$ is illustrated as follows:

$$\mathbf{AvgHS}_{new} = \frac{\sum_{i=1}^{k} w_i \times AvgHS_i}{\sum_{i=1}^{k} w_i} \quad (16)$$

where

$$w_i = \frac{1}{\sum_{j \neq i} |AvgHS_i - AvgHS_j|} \quad (17)$$

In the third stage, instead of using the multitrilateration positioning technique to estimate nodes' position, we have applied the 2D hyperbolic location technique [50]. It is
assumed that $(x_i, y_i)$ are the coordinates of anchor node i and $(x_N, y_N)$ are the coordinates of normal node N. The estimated distance $dist_{i,N}$ is calculated as follows:

$$ dist_{i,N}^2 = (x_i - x_N)^2 + (y_i - y_N)^2 \quad (18) $$

If $R_i = x_i^2 + y_i^2$ and $S_i = x_N^2 + y_N^2$, then, the equation Eq.(10) can be rewritten as follows:

$$ d_{i,N}^2 - R^2 = -2x_i x_k - 2y_i y_k + S_i \quad (19) $$

The matrix form of Eq.(19) is:

$$ GA = b \quad (20) $$

where $A = [x_N, y_N, S_N]^T$, $G = \begin{bmatrix} -2x_1 & -2y_1 & 1 \\ -2x_2 & -2y_2 & 1 \\ \vdots & \vdots & \vdots \\ -2x_k & -2y_k & 1 \end{bmatrix}$,

$$ b = \begin{bmatrix} d_{1,N}^2 - R_1 \\ d_{2,N}^2 - R_2 \\ \vdots \\ d_{k,N}^2 - R_k \end{bmatrix} $$

According to Eq. (20), using the least mean square estimation method, A can be obtained by the following formula:

$$ A = (G^T G)^{-1} G^T b \quad (21) $$

Thus, N's coordinates are computed as follows:

$$ \begin{cases} x_N = A(1) \\ y_N = A(2) \end{cases} \quad (22) $$

## D. MOTIVATION BEHIND USING PSO

It is known that the localization error produced by the DV-Hop localization algorithm is caused by uncertainty resulting during the distance estimation in terms of the average hop size and the minimum hop count. Consequently, the generated error for estimated distance against real distance is relatively large, and therefore it affects the localization accuracy of sensor nodes in the network. In fact, localization in WSN is formulated as an NP-hard optimization problem. In the literature, nature-inspired algorithms are considered to be the most suitable optimization algorithm for this problem as they are able to find out the best solution. On the other hand, nature-inspired algorithms are classified into many categories, including Evolutionary Algorithms, Physical Algorithms, Swarm Intelligence, Bio-inspired Algorithms and other nature-inspired algorithms. However, based on the literature studies, the swarm intelligence algorithms have proved their ability to elaborate adaptable solutions to localization problems in WSNs due to their flexibility, robustness, self-organization, simplicity, and decentralization. In fact, these qualities are observed in social behaviors of animal communities such as ants, fishes, birds and so on. The swarm intelligence algorithms in their turn include many algorithms: PSO, ACO, ABC, and so on. Based on recent comparisons in the literature, we find that the PSO is the best optimization

algorithm for localization problems in WSNs due to many advantages:

* PSO uses fewer parameters to adjust the particles' population.

* has a low space complexity as it uses small temporary storage.

* It has a fast convergence speed as only the most optimist particle can share its solution with other particles.

* It guarantees the diversity of application as it is adopted for many problems to be resolved.

* It provides an easy way to interpret and adapt the solution to the problem.

In this work, our aim is to achieve reasonable accuracy with a faster convergence time based on the Particle Swarm Optimization algorithm. It is expected that PSO will help to optimize the estimated locations of unknown sensor nodes to achieve a higher localization accuracy in the area of interest. For this purpose, our proposed improvements of DV-Hop, including both WDV-Hop and HWDV-Hop, respectively, are extended to support an extra phase for PSO optimization in addition to three classical phases of the DV-Hop. Then, the localization process will consist of four main phases; i) the minimum hop is calculated per each sensor node, ii) average hop distance calculation is calculated by anchor nodes, iii) estimation of unknown node's locations, iv) processing PSO algorithm of optimization of unknown node's locations.

## E. PSO ALGORITHM

Particle Swarm Optimization (PSO) is a population based optimization algorithm introduced by Eberhart and Kennedy in 1995, which is motivated by the behavior of fish or bird flocking. Certainly, PSO is a branch of heuristic algorithms widely applied to optimize complex problems by continually trying to get the best solution with respect to certain measures of quality [25]. At each step, every particle changes its velocity towards the best and gbest locations during the searching operation.

The PSO is the most preferred algorithm to achieve better results than other techniques. After finding the two best values, the particles in PSO updates their velocity and positions according to the following equations as:

$$ \begin{aligned} V_{id}(t+1) = V_{id}(t) &+ C_1 \times \sigma_1 \times (P_{id} - V_{id}(t)) \\ &+ C_2 \times \sigma_2 \times (P_{gd} - V_{id}(t)) \end{aligned} \quad (23) $$

$$ X_{id}(t+1) = X_{id}(t) + V_{id}(t+1) \quad (24) $$

where $V_{id}$ is the velocity of the particle, $X_{id}$ is the position of the particle $C_1$ and $C_2$ are the acceleration coefficients and also known as learning factors. $\sigma_1$ and $\sigma_2$ are two positive random numbers between 0 and 1. $P_{id}$ is an optimal solution position of an individual extreme; $P_{gd}$ is global minimum (group optimal solution position of group). We assume (x,y) is the coordinate of the unknown node i, then the distance $d_i$ can be obtained as described in the second step of each presented improvement of DV-HOP algorithm. In fact, an error can be produced due to the estimated value of distance. In this
paper, we proposed four new localization algorithms based on particle swarm optimization to reduce the localization error as the main problem for localization in WSNs. In this section, the proposed objective function for PSO is illustrated as follows:

$$f(x, y) = \min \left( \sum_{i=1}^{k} \left| \sqrt{(x-x_i)^2 + (y-y_i)^2 - d_i} \right| \right) \quad (25)$$

According to objective function presented in equation Eq.(25), the fitness function is formulated as follows:

$$fitness = f(x, y) \quad (26)$$

Moreover, every particle makes an update based on Eq. (23), (24), (25), and (26). The fitness function applied to estimate the fitness of every particle is illustrated in equation Eq. (26). Furthermore, during this process, the best solution will be considered as the final estimated location of the unknown node. A detailed description of the overall localization process followed by our proposed algorithm is illustrated in Figure 3.

In the next subsection of this current paper, the PSO algorithm is applied to reduce the localization error produced by DV-Hop algorithm and other localization algorithms.

## IV. PSO BASED IMPROVED DV-HOP ALGORITHM

In this section, we proposed four new localization algorithms for WSNs. Firstly, the WDV-Hop and HWDV-Hop have been described in section 3. Afterwards, the PSO optimization algorithm is applied on both WDV-Hop and HWDV-Hop in order to accurately estimate the location of unknown nodes in wireless sensor networks. Many scenarios have been conducted to verify and study the effectiveness of the introduced algorithms when compared to the basic DV-Hop, DV-HopPSO, and MDV-Hop localization algorithms for WSNs. All algorithms have been implemented in MATLAB and their overall performance is studied in static wireless sensor networks. The four new proposed localization algorithms are called as WDV-Hop, WDV-HopPSO, HWDV-Hop and HWDV-HopPSO, respectively. These algorithms are comprised of four stages which are described as follows i) anchor nodes flood their locations, ii) the calculation of the average hop size is modified, iii) the 2D hyperbolic technique is used, instead of the trilateration technique to compute the nodes' location, and iv) the PSO is applied to accurately find the location of unknown nodes.

For the WDV-HopPSO localization algorithm, the first stage and third stage are the same as those of WDV-Hop which is an improved version of DV-Hop algorithm as discussed in the previous section 3. In the first stage, every anchor node broadcasts a packet containing the location information. In the second stage, the weighted mean technique [48] is used instead of the traditional formula to estimate the average hop size distance by every anchor node. In the third stage, the multitrilateration technique is used to determine the estimated location of unknown nodes in the

**Algorithm 1 The Pseudo Code for Our Algorithms**

1: **Input:** Total number of nodes n; percentage of anchors

2: k; communication range R

3: Generate the Network topology: square random; O-shaped; H-shaped; X-shaped

4:

5: **for** i = 1 to n **do**

6: **for** j = 1 to n **do**

7: Calculate the distance

8: $d_{i,j} = \sqrt{(x_i - x_j)^2 + (y_i - y_j)^2}$

9: and initialize hop-count $hc_{i,j} = 0$;

10: **if** $d_{i,j} \le R$ **then**

11: $hc_{i,j} = 1$;

12: **else if** $i == j$ **then**

13: $hc_{i,j} = 1$;

14: **else**

15: $hc_{i,j} = Inf$;

16: **end if**

17: **end for**

18: **end for**

19:

20: Calculate the hop count matrix between anchor nodes by shortest path algorithm;

21: Calculate the distance matrix between anchor nodes by shortest path algorithm;

22:

23: **for** i = 1 to k **do**

24: Calculate the average hop size distance $AvgHS_i$ per

25: anchor nodes according to Eq.(1);

26: **end for**

27: **for** i = 1 to k **do**

28: Calculate the $w_i$ weighted values per anchor nodes

29: according to Eq.(17);

30: **end for**

31:

32: Calculate the new corrected average hop size distance $AvgHS_{new}$ according to Eq.(16);

33:

34: **for** i = 1 to k **do**

35: Calculate the unknown new distance $d_{i,k} =$

36: $AvgHS_{new} \times hc_{i,k}$ from $i^{th}$ anchor to $k^{th}$

37: unknown node;

38: **end for**

39:

40: Estimate the unknown node location using 2D-hyperbolic algorithm applying Eq.(19);

41: Initialize the parameters of PSO using the coordinate of estimated node by 2D-hyperbolic;

42: Evaluate the particle's fitness values applying Eq.(25) and made an update of node position;

43: Stop the iteration when the goals achieved;

44:

45: **Output:** the best locations of unknown node.
<figure><img src="image_4.png" /><figcaption>FIGURE 3. Flowchart of proposed algorithms.</figcaption></figure>

network. In stage four, the PSO is applied in order to correct the estimated location of unknown nodes.

Alike WDV-HopPSO, the HWDV-HopPSO has also been divided into the following four enhanced stages: i) anchor nodes flood their locations, ii) the average hop size distance calculation is modified, iii) the 2D hyperbolic method is applied, instead of the multitrilateration method to compute the nodes' location, and iv) the PSO is applied to optimize the location of unknown nodes. More precisely, the first, second and third stages of the HWDV-HopPSO are similar to the HWDV-Hop. In fact, in the first stage, every anchor node floods its location to the other nodes. In the second stage, the weighted mean approach [33] is adopted to compute the average hop size $AvgHS_i$ following our new formula presented in section 3. In the third stage, the multitrilateration positioning technique is adopted instead of the 2D hyperbolic location

technique [50] to calculate the position of the unknown node. In step 4, we applied PSO to correct the estimated positions. Moreover, as mentioned in this current work we applied PSO to find the correct location of unknown nodes. The flowchart of the proposed localization algorithms based on the DV-Hop and the Particle Swarm Optimization algorithm is shown in Figure 3, in addition, a detailed pseudo-code is described in Algorithm 1.

V. SIMULATION RESULTS AND DISCUSSIONS

In this section, we mainly focus on the performance evaluation of the basic DV-Hop and DV-Hop-based improvement algorithms. We have developed all proposed algorithms in the MATLAB simulator in order to evaluate and study their localization errors as well as localization accuracy. MATLAB is a simulator software and numeric computing platform used by
many scientists to develop algorithms and analyze data, and create models. Accordingly, we have used MATLAB version 2019a to show and analyze the performance of introduced algorithms in static wireless sensor networks (SWSNs). Besides, the effectiveness of our proposed algorithms is compared to the original DV-Hop, improved DV-Hop based on PSO (denoted DV-HopPSO) [38] and improved DV-Hop (denoted MDV-Hop) [43] through simulations.

We have measured two key metrics of 40 experiments: the localization accuracy and localization error per node are evaluated, while varying parameters, such as the percentage of anchor nodes, total number of sensor nodes, and nodes communication range according to four kinds of distribution topology. Here, the localization accuracy is expressed as the average localization error of an algorithm, which is used to evaluate the superiority of an algorithm. It is calculated according to equation Eq. (27), shown at the bottom of the page, where $(x_{exact}^i, y_{exact}^i)$ is the estimated position of the sensor i by the respective localization algorithm, $(x_{estimated}^i, y_{estimated}^i)$ is the exact position of the sensor i, $d(estimated_i, exact_i)$ is the Euclidean distance between sensor i's exact location and its estimated location, N is the number of sensor nodes.

The localization error is expressed as the deviation between the exact location and the estimated location of the unknown node. It is illustrated by the formula in equation Eq. (28), as shown at the bottom of the page.

In this section, we performed extensive simulations to study the performance of these localization algorithms in static wireless sensor networks with the following parameters: i) the generated topology depends on the number of sensor nodes, percentage of anchor nodes and communication range, ii) nodes are randomly distributed in an area of $100m \times 100m$, iii) all distributed sensor nodes within the network have the same communication radius which is R. In Table 1, the parameters of the simulations are described.

In this section, we have also considered many scenarios to study the influence of several parameters, especially the communication range, number of anchor nodes, and number of unknown nodes, on the performance of the proposed localization algorithms. In these series of scenarios, we have computed the localization error with different communication range values, percentage of anchor nodes, and number of unknown nodes according to four complex network topologies, which are square random, O-shaped, H-shaped and X-shaped. The square random is one of the most commonly used topologies for WSNs where nodes are randomly dis-

<table><caption>TABLE 1. Parameters used in the simulation for the network.</caption><thead><tr><th>Parameter</th><th>Value</th></tr></thead><tbody><tr><td colspan="2"><strong>Network</strong></td></tr><tr><td>Network topology</td><td>Square random, O-shaped, H-shaped, and X-shaped</td></tr><tr><td>Total runs</td><td>40</td></tr><tr><td>Length of area</td><td>100m×100m</td></tr><tr><td>Total number of nodes</td><td>200, 250, 300, 350, 400, 450, and 500</td></tr><tr><td>Percentage of anchor nodes</td><td>15%, 20%, 25%, 30%, 35%, and 40%</td></tr><tr><td>Communication range R</td><td>15m, 20m, 25m, 30m, and 35m</td></tr><tr><td colspan="2"><strong>PSO</strong></td></tr><tr><td>Number of iterations</td><td>50</td></tr><tr><td>Size of particle</td><td>20</td></tr><tr><td>Random values σ<sub>1</sub> and σ<sub>2</sub></td><td>[0, 1]</td></tr><tr><td>Learning coefficient C<sub>1</sub></td><td>1.50</td></tr><tr><td>Learning coefficient C<sub>2</sub></td><td>2</td></tr><tr><td>Particle's velocity V<sub>max</sub></td><td>10</td></tr></tbody></table>

persed within the region. The O-shaped is irregularly network topology based on empty area on the interior side, H-shaped is another topology where nodes are randomly deployed with two empty areas, and X-shaped topology is also based on random deployment of nodes with an empty area on the four sides. Figure 4 illustrates the four used network topologies. In the next sections, the simulation results are given separately for each topology.

## A. SQUARE RANDOM NETWORK TOPOLOGY

In this subsection, we analyze the impact of communication range, percentage of anchor nodes and total number of nodes on localization accuracy of all aforementioned algorithms. Here, the communication range R varies from 15m to 35m, the total number of sensor nodes varies 200 to 500 and the percentage of anchor nodes varies from 15% to 40%, respectively.

Figure 5a shows that the increase in the communication range of sensor nodes has an effect on the localization accuracy. In fact, the localization errors of all algorithms decrease with the increase in the communication range because the network becomes more connected. Moreover, we can observe that both the basic DV-Hop and WDV-Hop have a higher localization error around 0.49R, while the HWDV-HopPSO has about 15% lower localization error, especially when the communication range is equal to 15m. In contrast, DV-HopPSO, WDV-HopPSO and HWDV-Hop outperform other algorithms in terms of localization error,

$$ \text{Localization accuracy} = \frac{\sum_{i=1}^{N} \sqrt{(x_{exact}^{i} - x_{estimated}^{i})^2 + (y_{exact}^{i} - y_{estimated}^{i})^2}}{N \times R} \quad (27) $$

$$ \text{Localization error} = \sqrt{(x_{exact}^{i} - x_{estimated}^{i})^2 + (y_{exact}^{i} - y_{estimated}^{i})^2} \quad (28) $$
<figure><img src="image_5.png" /><figcaption>FIGURE 4. Nodes deployment according to network topologies, a) square random deployment, b) O-shaped random deployment, c) H-shaped random deployment, d) X-shaped random deployment (number of unknown nodes is 400, percentage of anchors is 15% and communication radius R = 30m).</figcaption></figure>

including basic DV-Hop, WDV-Hop and MDV-Hop, which have around 0.39R, 0.37R and 0.38R, respectively. However, it is obviously observed that HWDV-HopPSO outperforms the basic DV-Hop, DV-HopPSO, WDV-Hop, WDV-HopPSO, HWDV-Hop and MDV-HOP, respectively.

In Figure 5b, simulation performances are depicted by varying the percentage of anchor nodes from 15% to 40%, while the number of sensor nodes and communication range are fixed at 200 and 30 m, respectively. The localization error of HWDV-HopPSO, WDV-HopPSO, DV-HopPSO and HWDV-Hop are about 0.21R, 0.24R, 0.24R and 0.25R, respectively, and the localization error for DV-Hop and WDV-Hop, MDV-Hop are around 0.32R, 0.29R and 0.27R when the percentage of anchor nodes reaches 20%. In this scenario, we remarked that both the proposed HWDV-HopPSO and WDV-HopPSO algorithms achieved a

lower localization error versus the percentage of anchor nodes as compared with the other algorithms and they outperform them with about 12% of lower localization error.

As depicted in Figure 5c, the localization error is computed by varying the total number of sensor nodes from 200 to 500, while the percentage of anchor nodes and communication range R are fixed at 20% and 30m, respectively. It is worth noting that when the density of the network is highly increased, the network becomes more connected due to a large number of total nodes deployed in the area of interest. Moreover, a better localization error is archived by the HWDV-HopPSO, which is around 0.21R. In comparison with DV-Hop, WDV-Hop and MDV-Hop, it is observed that the localization error is around 0.33R, 0.29R and 0.27R, respectively. Furthermore, the localization error in the case of WDV-HopPSO and HWDV-Hop is lower by around 9% and
<figure><img src="image_6.png" /><figcaption>**FIGURE 5.** Localization accuracy in square random network, a) Communication range vs. localization error (15% anchor nodes, 200 unknown nodes), percentage of anchor nodes vs. localization error (communication range R = 30 m, 200 unknown nodes), total number of nodes vs. localization error (15% anchor nodes, communication range R = 30 m).</figcaption></figure>

<table><caption>**TABLE 2.** Simulation results analysis versus the minimum, maximum and average localization error with parameters: number of sensors = 200, number of anchors = 40, R = 30 m and random square network.</caption><thead><tr><td>Algorithm</td><td>Min</td><td>Max</td><td>Mean</td></tr></thead><tbody><tr><td>DV-Hop</td><td>0.0344</td><td>0.823</td><td>0.304</td></tr><tr><td>DV-HopPSO</td><td>0.0228</td><td>0.7925</td><td>0.238</td></tr><tr><td>WDV-Hop</td><td>0.0286</td><td>0.881</td><td>0.292</td></tr><tr><td>WDV-HopPSO</td><td>0.016</td><td>0.7728</td><td>0.233</td></tr><tr><td>HWDV-Hop</td><td>0.0163</td><td>0.6164</td><td>0.246</td></tr><tr><td>HWDV-HopPSO</td><td><strong>0.0155</strong></td><td><strong>0.6093</strong></td><td><strong>0.208</strong></td></tr><tr><td>MDV-Hop</td><td>0.018</td><td>0.6375</td><td>0.260</td></tr></tbody></table>

around 4% on average as compared to DV-Hop and MDV-Hop, respectively. In addition, the localization error achieved by HWDV-HopPSO is lower by around 5%, 8% and around 12% on average in comparison with DV-HopPSO, MDV-Hop

and DV-Hop, respectively. However, the HWDV-HopPSO outperforms all the other localization algorithms and it shows a better localization accuracy.

In Table 2, we introduce a comparison between the proposed algorithms and the other algorithms in terms of minimum, maximum and average localization error, respectively.

## B. O-SHAPED RANDOM NETWORK TOPOLOGY

In this scenario, firstly, the localization accuracy is analyzed by varying the communication range from 15m to 35m, while both the total number of sensor nodes and percentage of anchor nodes are fixed at 200 and 20%, respectively.

Figure 6a shows that when the communication range of sensor nodes is increased, a better performance in terms of localization error is achieved by HWDV-HopPSO. For instance, when the communication range is equal to 15m, the HWDV-HopPSO, WDV-HopPSO and DV-HopPSO have a localization error of around 0.42R, 0.49R and 0.51R,
<figure><img src="image_7.png" /></figure>

<figure><img src="image_8.png" /></figure>

<figure><img src="image_9.png" /><figcaption>**FIGURE 6.** Localization accuracy in O-shaped random network, a) Communication range vs. localization error (15% anchor nodes, 200 unknown nodes), percentage of anchor nodes vs. localization error (communication range R = 30 m, 200 unknown nodes), total number of nodes vs. localization error (15% anchor nodes, communication range R = 30 m).</figcaption></figure>

<table><caption>**TABLE 3.** Simulation results analysis versus the minimum, maximum and average localization error with parameters: number of sensors = 200, number of anchors = 40, R = 30 m and O-shaped network.</caption><thead><tr><th>Algorithm</th><th>Min</th><th>Max</th><th>Mean</th></tr></thead><tbody><tr><td>DV-Hop</td><td>0.0159</td><td>0.8579</td><td>0.297</td></tr><tr><td>DV-HopPSO</td><td>0.0137</td><td>0.7622</td><td>0.234</td></tr><tr><td>WDV-Hop</td><td>0.0275</td><td>0.8485</td><td>0.281</td></tr><tr><td>WDV-HopPSO</td><td>0.0196</td><td>0.7787</td><td>0.229</td></tr><tr><td>HWDV-Hop</td><td>0.0163</td><td>0.5302</td><td>0.202</td></tr><tr><td>HWDV-HopPSO</td><td><strong>0.0159</strong></td><td><strong>0.5275</strong></td><td><strong>0.180</strong></td></tr><tr><td>MDV-Hop</td><td>0.0118</td><td>0.5987</td><td>0.210</td></tr></tbody></table>

respectively, otherwise the DV-Hop, WDV-Hop, HWDV-Hop and MDV-Hop have a localization error of around 0.65R, 0.64R, 0.54R and 0.52R, respectively. However, the simulation results showed that both HWDV-HopPSO and HWDV-Hop algorithms outperform the other algorithms.

<table><caption>**TABLE 4.** Simulation results analysis versus the minimum, maximum and average localization error with parameters: number of sensors = 200, number of anchors = 40, R = 30 m and H-shaped network.</caption><thead><tr><th>Algorithm</th><th>Min</th><th>Max</th><th>Mean</th></tr></thead><tbody><tr><td>DV-Hop</td><td>0.0317</td><td>1.1243</td><td>0.366</td></tr><tr><td>DV-HopPSO</td><td>0.0254</td><td>1.1107</td><td>0.288</td></tr><tr><td>WDV-Hop</td><td>0.0193</td><td>1.2074</td><td>0.369</td></tr><tr><td>WDV-HopPSO</td><td>0.0167</td><td>1.2037</td><td>0.296</td></tr><tr><td>HWDV-Hop</td><td>0.0186</td><td>0.9362</td><td>0.319</td></tr><tr><td>HWDV-HopPSO</td><td><strong>0.0154</strong></td><td><strong>0.8848</strong></td><td><strong>0.264</strong></td></tr><tr><td>MDV-Hop</td><td>0.0214</td><td>0.9516</td><td>0.345</td></tr></tbody></table>

In Figure 6b, the simulation results are expressed by varying the percentage of anchor nodes from 15% to 40%, while the total number of sensor nodes and communication range are fixed at 200 and 30m, respectively. We observed that the HWDV-HopPSO, HWDV-Hop and MDV-Hop algorithms
<figure><img src="image_10.png" /><figcaption>**FIGURE 7.** Localization accuracy in H-shaped random network, a) Communication range vs. localization error (15% anchor nodes, 200 unknown nodes), percentage of anchor nodes vs. localization error (communication range R = 30 m, 200 unknown nodes), total number of nodes vs. localization error (15% anchor nodes, communication range R = 30 m).</figcaption></figure>

achieve the best performance in terms of the localization error, where the localization errors for HWDV-HopPSO, HWDV-Hop, WDV-HopPSO and MDV-Hop are around 0.18R, 0.21R, 0.23R and 0.22R, respectively, as compared to DV-Hop, WDV-Hop and DV-HopPSO, which reach localization errors of around 0.29R, 0.27R and 0.24R, respectively, especially when the percentage of anchor nodes is 15%. The results for this scenario show that the lower localization error is achieved by the proposed HWDV-HopPSO and HWDV-Hop in comparison to the other algorithms.

In Figure 6c, simulation performances in terms of localization error are depicted by varying the number of sensor nodes from 200 to 500, while the percentage of anchor nodes and communication range R are fixed at 20% and 30m, respectively. We observed that the localization errors achieved by the HWDV-HopPSO, HWDV-Hop, MDV-Hop and WDV-HopPSO, which are 0.15R, 0.17R, 0.20R, and 0.21R, respectively, are lower as compared to DV-Hop, WDV-Hop, and DV-HopPSO (0.27R, 0.26R and 0.23R),

especially when the number of total nodes reaches 500. Furthermore, the results depicted in this scenario demonstrate the efficiency of proposed algorithms HWDV-HopPSO and HWDV-Hop for the O-shaped random network.

In Table 3, in addition to simulation results in the above subsection, we also introduce a comparison between the proposed algorithms and the other algorithms in terms of minimum, maximum and average localization error, respectively.

### C. H-SHAPED RANDOM NETWORK TOPOLOGY

In this scenario, firstly, the localization accuracy is analyzed by varying the communication range from 15m to 35m, while both the total number of sensor nodes and percentage of anchor nodes are fixed at 200 and 20%, respectively.

Figure 7a shows that when the communication range of sensor nodes is increased, lower localization errors are achieved by the proposed HWDV-HopPSO, WDV-HopPSO and DV-HopPSO, which have localization errors of around 0.55R, 0.56R and 0.58R, respectively, whereas DV-Hop,
<figure><img src="image_11.png" /><figcaption>FIGURE 8. Localization accuracy in X-shaped random networks, a) Communication range vs. localization error (15% anchor nodes, 200 unknown nodes), percentage of anchor nodes vs. localization error (communication range R = 30 m, 200 unknown nodes), total number of nodes vs. localization error (15% anchor nodes, communication range R = 30 m).</figcaption></figure>

WDV-Hop, HWDV-Hop and MDV-Hop have localization errors of around 0.73R, 0.7R, 0.68R and 0.73R, respectively, especially when the communication range is equal to 15m. However, the proposed HWDV-HopPSO and HWDV-Hop still outperform the other localization algorithms.

In Figure 7b, the localization error is analyzed by varying the percentage of anchor nodes from 15% to 40% while the number of sensor nodes and communication range are fixed at 200 and 30m, respectively. We observed that the localization error for the proposed HWDV-HopPSO, WDV-HopPSO, DV-HopPSO and HWDV-Hop is lower as compared to DV-Hop, WDV-Hop and MDV-Hop, respectively. For example, when the percentage of anchor nodes equals to 15%, the localization errors for HWDV-HopPSO, WDV-Hop, DV-HopPSO and HWDV-Hop are around 0.26R, 0.29R, 0.29R and 0.32R, respectively, as compared to DV-Hop, WDV-Hop and MDV-Hop, which have localization errors of around 0.37R, 0.36R and 0.35R, respectively. However, the simulation results show that both HWDV-HopPSO and

WDV-HopPSO achieved lower localization error as compared with the other localization algorithms.

As depicted in Figure 7c, when the total number of nodes is varied from 200 to 500, the communication range and the percentage of anchor nodes are fixed at 30m and 20%, respectively. We observed a better localization error in the case of HWDV-HopPSO, WDV-HopPSO, DV-HopPSO and HWDV-Hop. For example, when the total number of sensor nodes reaches 500, the localization errors of HWDV-HopPSO, WDV-HopPSO, DV-HopPSO and HWDV-Hop are around 0.25R, 0.27R, 0.27R, and 0.31R, respectively, as compared to 0.37R for DV-Hop, 0.35R for WDV-Hop and MDV-Hop, respectively. The obtained results demonstrate that the proposed HWDV-HopPSO and WDV-HopPSO algorithms have a significant performance in comparison with the other algorithms.

In Table 4, we introduce an extra comparison between the proposed algorithms and the other algorithms in terms of minimum, maximum and average localization error, respectively.
<table><caption>**TABLE 5.** Simulation results analysis versus the minimum, maximum and average localization error with parameters: number of sensors = 200, number of anchors = 40, R = 30 m and random X-shaped network.</caption><thead><tr><td>Algorithm</td><td>Min</td><td>Max</td><td>Mean</td></tr></thead><tbody><tr><td>DV-Hop</td><td>0.0373</td><td>1.1432</td><td>0.466</td></tr><tr><td>DV-HopPSO</td><td>0.0259</td><td>1.1192</td><td>0.391</td></tr><tr><td>WDV-Hop</td><td>0.0322</td><td>1.1727</td><td>0.449</td></tr><tr><td>WDV-HopPSO</td><td>0.0234</td><td>1.1531</td><td>0.387</td></tr><tr><td>HWDV-Hop</td><td>0.0239</td><td>1.0144</td><td>0.414</td></tr><tr><td>HWDV-HopPSO</td><td><strong>0.0139</strong></td><td><strong>0.8940</strong></td><td><strong>0.370</strong></td></tr><tr><td>MDV-Hop</td><td>0.0275</td><td>0.9546</td><td>0.439</td></tr></tbody></table>

## D. X-SHAPED RANDOM NETWORK TOPOLOGY

In this scenario, we analyze the localization accuracy by varying the communication range from 15m to 35m, while both the total number of sensor nodes and percentage of anchor nodes are fixed at 200 and 20%, respectively.

Figure 8a shows that both HWDV-HopPSO, WDV-Hop achieved lowest localization errors as compared to other localization algorithms. For example, when the communication range is equal to R = 15m, HWDV-HopPSO has around 0.65R, whereas both WDV-HopPSO and DV-HopPSO have a localization error of around 0.72R, respectively, and HWDV-Hop has a localization error of around 0.74R on average. In contrast, DV-Hop, WDV-Hop and MDV-Hop have localization errors of around 0.88R, 0.87R and 0.81R, respectively. However, the results reveal that the localization errors is decreased when increasing the communication range, where the proposed algorithms HWDV-HopPSO, WDV-HopPSO achieved better performance in comparison with other localization algorithms.

In Figure 8b, the simulation results are depicted by varying the percentage of anchor nodes from 15% to 40% while the number of unknown nodes and communication range are fixed at 200 and 30m, respectively. In this scenario, the HWDV-HopPSO, WDV-HopPSO, DV-HopPSO and HWDV-Hop achieve the lowest localization errors as compared to the other algorithms. The localization errors for HWDV-HopPSO, WDV-HopPSO, DV-HopPSO and HWDV-Hop are 0.37R, 0.39R, 0.40R and 0.41R, respectively as compared to DV-Hop, WDV-Hop and DV-HopPSO, which have 0.48R, 0.46R and 0.44R, respectively, especially when the percentage of anchor nodes is 15%. The obtained results in this scenario confirms that a lower localization error is achieved by both the proposed algorithms HWDV-HopPSO and HWDV-Hop in comparison with the other algorithms.

As depicted in Figure 8c, the localization error is analyzed by varying the total number of sensor nodes from 200 to 500, while the percentage of anchor nodes and communication range R are fixed at 20% and 30m, respectively. We remark that the localization errors achieved by HWDV-HopPSO, HWDV-Hop, DV-HopPSO and HWDV-HopPSO, which are 0.32R, 0.33R, 0.36R, and 0.37R, respectively, are lower than those of DV-Hop, WDV-Hop, and MDV-HopPSO, which have localization errors of 0.40R, 0.40R and 0.42R, especially when the number of total nodes is equal to 500. Furthermore, the obtained results according to this scenario demonstrate that the localization error significantly decreases when the percentage of anchors increases. Also, we observed that the proposed HWDV-HopPSO and HWDV-Hop outperform DV-Hop, MDV-Hop and other localization algorithms.

In Table 5, we compare the proposed algorithms and the other algorithms in terms of minimum, maximum and average localization error, respectively.

Figure 9 illustrates the localization error per sensor node for all introduced localization algorithms according to the square random network, O-shaped network, H-shaped and X-shaped network, respectively. Indeed, the localization error is computed while the total number of sensor nodes, percentage of anchors and communication range R are fixed at 200, 20% and 30m, respectively. It can be observed from the obtained results that the localization error of the proposed algorithm HWDV-HopPSO is lower as compared to the other algorithms regardless of the considered random network topology. Moreover, it is obvious that the proposed HWDV-HopPSO, WDV-HOP and HWDV-Hop algorithms achieve high localization accuracy as compared with DV-Hop and the other localization algorithms.

## E. TIME COMPLEXITY ANALYSIS

Due to limitations on the cost and the size, sensor nodes have a limited capacity of computation and energy, which makes them sensitive to implementing complex algorithms. For these reasons, the time complexity is taken into consideration in this subsection. Indeed, the localization problem in WSNs is considered as an NP-hard optimization problem and can be modeled as follows: we assume a WSN consisting of n unknown sensor nodes and k anchor nodes. Besides, the maximum generation and the population size of PSO are MaxG and NP, respectively. Generally, the complexity of an algorithm is expressed to measure the worst-case time complexity or the longest amount of time that an algorithm can take to complete.

In this paper, the time complexity for each proposed algorithm is expressed. In fact, the time complexity in the first phase is $O(k^2)$ because all algorithms need to calculate the matrix of minimum hop count. In the second phase, DV-Hop and DV-HopPSO use a classical technique to calculate the average hop size distance by every anchor node within the network, so the time complexity is $O(k^2)$. Despite, the other proposed algorithms, WDV-Hop, WDV-HopPSO, HWDV-Hop, HWDV-HopPSO, MDV-Hop use different based weighted techniques, they have the same time complexity $O(k^2)$. In the third phase, the time complexity is $O(k*(n-k))$ because DV-Hop and DV-HopPSO apply the least square technique to estimate the locations of unknown nodes. The other proposed algorithms, WDV-Hop, WDV-HopPSO, HWDV-Hop, HWDV-HopPSO, MDV-Hop, respectively, apply the 2D-Hyperbolic technique instead of the trilateration technique to estimate node's location and then their time complexity is $O(k*(n-k))$. In the fourth phase, the last phase of
<figure><img src="image_12.png" /><figcaption>FIGURE 9. Localization error vs network topologies, a) localization error vs. random square network, b) localization error vs. O-shaped random network, c) localization error vs. H-shaped random network, d) localization error vs. X-shaped random network (total number of nodes is 200, 15% of anchor nodes, communication range R = 30 m).</figcaption></figure>

the optimization of unknown nodes' locations, the time complexity of DV-HopPSO, WDV-HopPSO, HWDV-HopPSO with PSO is O(MaxG*NP*(n-k)). Although an O(k*NP) extra time complexity is required to calculate the fitness function and O(MaxG*NP) to update the locations of particles, and then the time complexity of WDV-HopPSO and HWDV-HopPSO algorithms with PSO is O(MaxG*NP*(n-k)). Therefore, it can be observed that the time

complexity of HWDV-HopPSO is slightly increased due to changes made in phase two and the use of PSO to optimize the node locations in wireless sensor networks.

## VI. CONCLUSION

In this work, four new localization algorithms called HWDV-HopPSO, HWDV-Hop and WDV-Hop and WDV-HopPSO, respectively, have been proposed in order
to enhance the localization accuracy. Accordingly, four different complex network topologies including uniform random, O-shaped, H-shaped and X-shaped networks are considered to evaluate and analyze the performance of the proposed algorithms. Indeed, additional phases have been added to the standard DV-Hop algorithm in order to minimize the localization error of unknown nodes in wireless sensor networks. Extensive simulations have been conducted while varying the total number of nodes, percentage of anchors and communication range according to four different random networks for static wireless sensor networks. The obtained results show that the HWDV-HopPSO achieved the lower localization error as compared with DV-Hop, DV-HopPSO, MDV-Hop and the other algorithms in all conducted network scenarios. In addition, HWDV-HopPSO and WDV-HopPSO are better in comparison with DV-Hop, WDV-Hop, MDV-Hop, DV-HopPSO, and HWDV-Hop in the case of the uniform random network, H-shaped and X-shaped network, respectively. Otherwise, HWDV-HopPSO and HWDV-Hop showed also good performance in the case of O-shaped network topology. In general, simulation results confirmed that the HWDV-HopPSO and HWDV-Hop outperformed the DV-Hop and the other algorithms in SWSNs according to uniform random, O-shaped, H-shaped and X-shaped networks in terms of localization error, respectively. In our ongoing work, other simulations will be conducted to evaluate these algorithms for mobile wireless sensor networks. Moreover, the proposed algorithms will be extended to estimate the position of unknown sensor nodes in 3D.

## ACKNOWLEDGMENT

This work was supported by Operação Centro-01-0145-FEDER-000019—C4—Centro de Competências em Cloud Computing, co-financed by the Programa Operacional Regional do Centro (CENTRO 2020), through the Sistema de Apoio à Investigação Científica e Tecnológica—Programas Integrados de IC&DT (Este trabalho foi suportado pela Operação Centro-01-0145-FEDER-000019—C4—Centro de Competências em Cloud Computing, co-financiada pelo Programa Operacional Regional do Centro (CENTRO 2020), através do Sistema de Apoio à Investigação Científica e Tecnológica—Programas Integrados de IC&DT). This work is also funded by FCT/MEC through national funds and when applicable co-funded by FEDER—PT2020 partnership agreement under the project UIDB/EEA/50008/2020 (Este trabalho é financiado pela FCT/MEC através de fundos nacionais e quando aplicável cofinanciado pelo FEDER, no âmbito do Acordo de Parceria PT2020 no âmbito do projeto UIDB/EEA/50008/2020). This article is based upon work from COST Action IC1303-AAPELE-Architectures, Algorithms, and Protocols for Enhanced Living Environments and COST Action CA16226-SHELD-ON-Indoor living space improvement: Smart Habitat for the Elderly, supported by COST (European Cooperation in Science and Technology). More information

in www_cost.eu. (Abdelali Hadir, Younes Regragui, and Nuno M. Garcia contributed equally to this work.)

## REFERENCES

[1] A. Nauman, Y. A. Qadri, M. Amjad, Y. B. Zikria, M. K. Afzal, and S. W. Kim, "Multimedia Internet of Things: A comprehensive survey," *IEEE Access*, vol. 8, pp. 8202–8250, 2020.

[2] M. Rico-González, A. L. Arcos, D. Rojas-Valverde, F. M. Clemente, and J. Pino-Ortega, "A survey to assess the quality of the data obtained by radio-frequency technologies and microelectromechanical systems to measure external workload and collective behavior variables in team sports," *Sensors*, vol. 20, no. 8, p. 2271, Apr. 2020.

[3] K.-C. Chang, K.-C. Chu, H.-C. Wang, C.-S. Lin, and J.-S. Pan, "Energy saving technology of 5G base station based on Internet of Things collaborative control," *IEEE Access*, vol. 8, pp. 32935–32946, 2020.

[4] A.-J. Yuste-Delgado, J.-C. Cuevas-Martinez, and A. Triviño-Cabrera, "A distributed clustering algorithm guided by the base station to extend the lifetime of wireless sensor networks," *Sensors*, vol. 20, no. 8, p. 2312, Apr. 2020.

[5] D. Kandris, C. Nakas, D. Vomvas, and G. Koulouras, "Applications of wireless sensor networks: An up-to-date survey," *Appl. Syst. Innov.*, vol. 3, no. 1, p. 14, Feb. 2020.

[6] K. Kang, V. Maroulas, I. Schizas, and F. Bao, "Improved distributed particle filters for tracking in a wireless sensor network," *Comput. Statist. Data Anal.*, vol. 117, pp. 90–108, Jan. 2018.

[7] A. Zervopoulos, A. Tsipis, A. G. Alvanou, K. Bezas, A. Papamichail, S. Vergis, A. Stylidou, G. Tsoumanis, V. Komianos, G. Koufoudakis, and K. Oikonomou, "Wireless sensor network synchronization for precision agriculture applications," *Agriculture*, vol. 10, no. 3, p. 89, Mar. 2020.

[8] X. Fu, G. Fortino, P. Pace, G. Aloi, and W. Li, "Environment-fusion multipath routing protocol for wireless sensor networks," *Inf. Fusion*, vol. 53, pp. 4–19, Jan. 2020.

[9] Y. Qian, D. Wu, W. Bao, and P. Lorenz, "The Internet of Things for smart cities: Technologies and applications," *IEEE Netw.*, vol. 33, no. 2, pp. 4–5, Mar. 2019.

[10] M. Alazab, K. Lakshmanna, T. R. G. Q.-V. Pham, and P. K. R. Maddikunta, "Multi-objective cluster head selection using fitness averaged rider optimization algorithm for IoT networks in smart cities," *Sustain. Energy Technol. Assessments*, vol. 43, Feb. 2021, Art. no. 100973.

[11] G. Han, X. Yang, L. Liu, W. Zhang, and M. Guizani, "A disaster management-oriented path planning for mobile anchor node-based localization in wireless sensor networks," *IEEE Trans. Emerg. Topics Comput.*, vol. 8, no. 1, pp. 115–125, Jan. 2017.

[12] J. Al Qundus, K. Dabbour, S. Gupta, R. Meissonier, and A. Paschke, "Wireless sensor network for AI-based flood disaster detection," *Ann. Oper. Res.*, pp. 1–23, Aug. 2020.

[13] Y. Yang, J. Yan, J. Guo, Y. Kuang, M. Yin, S. Wang, and C. Ma, "Driving behavior analysis of city buses based on real-time GNSS traces and road information," *Sensors*, vol. 21, no. 3, p. 687, Jan. 2021.

[14] A. Hadir, K. Zine-Dine, M. Bakhouya, J. E. Kafi, and D. E. Ouadghiri, "Performance evaluation of DV-Hop localization algorithm for geographical routing in wireless sensor networks," *Proc. Comput. Sci.*, vol. 113, pp. 261–266, Jan. 2017.

[15] A. K. Paul and T. Sato, "Localization in wireless sensor networks: A survey on algorithms, measurement techniques, applications and challenges," *J. Sens. Actuator Netw.*, vol. 6, no. 4, p. 24, 2017.

[16] A. B. Castillo, C. D. G. Carmona, E. De La Cruz Sánchez, and J. P. Ortega, "Accuracy, intra- and inter-unit reliability, and comparison between GPS and UWB-based position-tracking systems used for time-motion analyses in soccer," *Eur. J. Sport Sci.*, vol. 18, no. 4, pp. 450–457, Apr. 2018.

[17] O. Cheikhrouhou, G. M. Bhatti, and R. Alroobaea, "A hybrid DV-Hop algorithm using RSSI for localization in large-scale wireless sensor networks," *Sensors*, vol. 18, no. 5, p. 1469, 2018.

[18] A. Coluccia and A. Fascista, "Hybrid TOA/RSS range-based localization with self-calibration in asynchronous wireless networks," *J. Sensor Actuator Netw.*, vol. 8, no. 2, p. 31, May 2019.

[19] X. Fang, C. Wang, T.-M. Nguyen, and L. Xie, "Graph optimization approach to range-based localization," *IEEE Trans. Syst., Man, Cybern., Syst.*, vol. 51, no. 11, pp. 6830–6841, Nov. 2021.

[20] X. Liu, J. Yin, S. Zhang, B. Ding, S. Guo, and K. Wang, "Range-based localization for sparse 3-D sensor networks," *IEEE Internet Things J.*, vol. 6, no. 1, pp. 753–764, Feb. 2018.

[21] E. Shakshuki, A. A. Elkhail, I. Nemer, M. Adam, and T. Sheltami, "Comparative study on range free localization algorithms," *Proc. Comput. Sci.*, vol. 151, pp. 501–510, Jan. 2019.
[22] W. Wen, X. Wen, L. Yuan, and H. Xu, “Range-free localization using expected hop progress in anisotropic wireless sensor networks,” EURASIP J. Wireless Commun. Netw., vol. 2018, no. 1, pp. 1–13, Dec. 2018.

[23] T. Akiyama, M. Sugimoto, and H. Hashizume, “Time-of-arrival-based smartphone localization using visible light communication,” in Proc. Int. Conf. Indoor Positioning Indoor Navigat. (IPIN), Sep. 2017, pp. 1–7.

[24] X. Qu and L. Xie, “An efficient convex constrained weighted least squares source localization algorithm based on TDOA measurements,” Signal Process., vol. 119, pp. 142–152, Feb. 2016.

[25] R. Pita, R. Utrilla, R. Rodriguez-Zurrunero, and A. Araujo, “Experimental evaluation of an RSSI-based localization algorithm on IoT end-devices,” Sensors, vol. 19, no. 18, p. 3931, Sep. 2019.

[26] S. Wielandt and L. De Strycker, “Indoor multipath assisted angle of arrival localization,” Sensors, vol. 17, no. 11, p. 2522, 2017.

[27] N. Patwari, J. N. Ash, S. Kyperountas, A. O. Hero, R. L. Moses, and N. S. Correal, “Locating the nodes: Cooperative localization in wireless sensor networks,” IEEE Signal Process. Mag., vol. 22, no. 4, pp. 54–69, Jul. 2005.

[28] D. Niculescu and B. Nath, “Ad hoc positioning system (APS),” in Proc. IEEE Global Telecommun. Conf., vol. 5, Nov. 2001, pp. 2926–2931.

[29] N. Bulusu, J. Heidemann, and D. Estrin, “GPS-less low-cost outdoor localization for very small devices,” IEEE Pers. Commun., vol. 7, no. 5, pp. 28–34, Oct. 2000.

[30] Y. Zhang and Q. Zhang, “Research on APIT localization algorithm in wireless sensor networks,” in Proc. Chin. Control Decis. Conf. (CCDC), Jun. 2018, pp. 5487–5491.

[31] S. Shen, K. Qian, B. Yang, Y. She, W. Wang, and Y. Wang, “An improved amorphous algorithm in wireless sensor network based on approximate equilateral triangle beacon selection,” in Proc. Int. Conf. Netw. Netw. Appl. (NaNA), Oct. 2017, pp. 54–60.

[32] A. Kaur, P. Kumar, and G. P. Gupta, “A weighted centroid localization algorithm for randomly deployed wireless sensor networks,” J. King Saud Univ.-Comput. Inf. Sci., vol. 31, no. 1, pp. 82–91, 2019.

[33] R. Nagpal, H. Shrobe, and J. Bachrach, “Organizing a global coordinate system from local information on an ad hoc sensor network,” in Information Processing in Sensor Networks. Berlin, Germany: Springer, 2003, pp. 333–348.

[34] L. Doherty, K. Pister, and L. E. Ghaoui, “Convex position estimation in wireless sensor networks,” in Proc. 20th Annu. Joint Conf. IEEE Comput. Commun. Soc. (INFOCOM), vol. 3, Apr. 2001, pp. 1655–1663.

[35] J. Yanfei, Z. Kexin, and Z. Liquan, “Improved DV-Hop location algorithm based on mobile anchor node and modified hop count for wireless sensor network,” J. Electr. Comput. Eng., vol. 2020, pp. 1–9, Aug. 2020.

[36] Q. Shi, C. Wu, Q. Xu, and J. Zhang, “Optimization for DV-Hop type of localization scheme in wireless sensor networks,” J. Supercomput., pp. 1–24, Apr. 2021.

[37] S. Messous and H. Liouane, “Online sequential DV-Hop localization algorithm for wireless sensor networks,” Mobile Inf. Syst., vol. 2020, pp. 1–14, Oct. 2020.

[38] S. P. Singh and S. C. Sharma, “A PSO based improved localization algorithm for wireless sensor network,” Wireless Pers. Commun., vol. 98, no. 1, pp. 487–503, Jan. 2018.

[39] S. Messous, H. Liouane, O. Cheikhrouhou, and H. Hamam, “Improved recursive DV-Hop localization algorithm with RSSI measurement for wireless sensor networks,” Sensors, vol. 21, no. 12, p. 4152, Jun. 2021.

[40] X. Yang and W. Zhang, “An improved DV-Hop localization algorithm based on bat algorithm,” Cybern. Inf. Technol., vol. 16, no. 1, pp. 89–98, Mar. 2016.

[41] W. Ren and C. Zhao, “A localization algorithm based on SFLA and PSO for wireless sensor network,” Inf. Technol. J., vol. 12, no. 3, p. 502, 2013.

[42] S. Zhang, J. Li, B. He, and J. Chen, “LSDV-Hop: Least squares based DV-Hop localization algorithm for wireless sensor networks,” J. Commun., vol. 11, no. 3, pp. 243–248, 2016.

[43] G. Song and D. Tam, “Two novel DV-Hop localization algorithms for randomly deployed wireless sensor networks,” Int. J. Distrib. Sensor Netw., vol. 11, no. 7, Jul. 2015, Art. no. 187670.

[44] S. Tomic and I. Mezei, “Improvements of DV-Hop localization algorithm for wireless sensor networks,” Telecommun. Syst., vol. 61, no. 1, pp. 93–106, Jan. 2016.

[45] G. Han, J. Chao, C. Zhang, L. Shu, and Q. Li, “The impacts of mobility models on DV-Hop based localization in mobile wireless sensor networks,” J. Netw. Comput. Appl., vol. 42, pp. 70–79, Jun. 2014.

[46] A. Hadir, K. Zine-Dine, M. Bakhouya, and J. E. Kafi, “An optimized DV-Hop localization algorithm using average hop weighted mean in WSNs,” in Proc. 5th Workshop Codes, Cryptogr. Commun. Syst. (WCCCS), Nov. 2014, pp. 25–29.

[47] A. Hadir, K. Zine-Dine, M. Bakhouya, and J. E. Kafi, “Novel localisation algorithms in wireless sensor networks,” Int. J. Wireless Mobile Comput., vol. 16, no. 1, pp. 80–96, 2019.

[48] Y. S. Dodonov and A. Y. Dodonova, “Robust measures of central tendency: Weighting as a possible alternative to trimming in response-time data analysis,” Psikhologicheskie Issledovaniya, vol. 5, no. 19, pp. 1–11, Oct. 2011.

[49] S. Levy, Modern Signal Processing, vol. 46. Cambridge, U.K.: Cambridge Univ. Press, 2004.

[50] Y. T. Chan and K. C. Ho, “A simple and efficient estimator for hyperbolic location,” IEEE Trans. Signal Process., vol. 42, no. 8, pp. 1905–1915, Aug. 1994.

<figure><img src="image_13.png" /></figure>

**ABDELALI HADIR** received the M.S. degree in mathematics/informatics from UCD, Morocco, and the Ph.D. degree in computer science from UCD, in 2018. He is currently an Assistant Professor of computer science at the National School of Business and Management, Hassan II University, Casablanca, Morocco, and a Research Member with the University of Beira Interior (UBI), Covilhã, Portugal. He has authored and coauthored several scientific publications in international journals and conferences. His research interests include computer and networks, localization, geographic routing, modeling, analysis, optimization problems, artificial intelligence (AI), and machine learning (ML) dedicated to VANETs, wireless sensor networks (WSNs), and the Internet of Things (IoT). He was a member of the organizing committee and a member of the technical program of international conferences. He is a Reviewer of several indexed journals and magazines, such as IEEE Internet of Things Magazine.

<figure><img src="image_14.png" /></figure>

**YOUNES REGRAGUI** received the M.S. degree in computer science from the University of Chouaib Doukkali, Morocco, in 2013, and the Ph.D. degree in computer science from Chouaib Doukkali University. He was a Postdoctoral Researcher with Ibn Zohr University, Morocco, in 2020. His current research interests include mobile and vehicular ad-hoc networks, mobility modeling for tactical networks, traffic modeling in transportation systems, intelligent transport systems, coverage problems in sensor networks, and localization in sensor networks.

<figure><img src="image_15.png" /></figure>

**NUNO M. GARCIA** received the B.Sc. degree (Hons.) in mathematics/informatics and the Ph.D. degree in computer science engineering from the Universidade da Beira Interior (UBI), Covilhã, Portugal, in 2004 and 2008, respectively. He was an Entrepreneur, from 1988 to 2004, a member of the Research Team at Siemens SA, from 2004 to 2007, and Nokia Siemens SA, from 2007 to 2008, and the Head of research at PLUX SA, from 2008 to 2010. He was an Associate Professor (Habilitation) at the Computer Science Department, UBI, in 2010. He has been an Invited Associate Professor at the Universidade Lusófona de Humanidades e Tecnologias, Lisbon, Portugal, since 2010. He was the Founder of the Assisted Living Computing and Telecommunications Laboratory (ALLab), in 2010, where he is currently a Researcher, a research group within the Instituto de Telecomunicações, UBI. He was also the Co-Founder and is the Chair of the Executive Council of the BSAFE LAB-Law Enforcement, Justice and Public Safety Research and Technology Transfer Laboratory, a multidisciplinar research laboratory in UBI, in 2015. He has been working as the Vice Dean of the Faculty of Engineering, UBI, since 2018. His main research interests include next-generation networks, predictive algorithms for healthcare and well-being, distributed and cooperative algorithms, and the battle for a free and open internet.

<figure><img src="image_16.png" /></figure>