 Research
 Open Access
 Published:
A highaccuracy and lowenergy rangefree localization algorithm for wireless sensor networks
EURASIP Journal on Wireless Communications and Networking volume 2023, Article number: 37 (2023)
Abstract
As the backbone of the Internet of Things, wireless sensor networks are widely applied to perceive the physical world. Most applications need to associate perception information with a position to generate physical significance. This paper proposes WRCDVHop, which has quadruple improvements of the wellknown DVHop. First, the hop count between a pair of sensor nodes is measured as a continuous value rather than a discrete value. Second, the unknown nodes calculate the average distance per hop by the weighted method. Third, each sensor node only records and relays limited but sufficient beacons of the anchors. Fourth, the unknown nodes apply the whale optimization algorithm to estimate positions. The first two improvements ensure that the distance estimation between a pair of sensor nodes is highly accurate, and the third improvement reduces the energy consumption. The last improvement makes the position estimation more precise. The simulation results show that WRCDVHop performs well in terms of localization accuracy and energy consumption.
1 Introduction
Wireless sensor networks (WSNs) have become one of the main methods of perceiving the physical world and are an important infrastructure component of the Internet of Things. A WSN consists of a large number of sensor nodes that communicate with each other wirelessly. It can monitor, sense and collect the required data in an area of interest [1]. WSNs have many applications, such as mine surveys, traffic and road monitoring, military deployments, underwater networks, etc. Most of these applications need to associate the information with the location to make the information meaningful.
Existing wireless sensor localization algorithms are usually classified into rangebased and rangefree algorithms [2]. A rangebased algorithm measures the distance between sensor nodes using the received signal strength indicator (RSSI), time of arrival (TOA), angle of arrival (AOA), or time difference of arrival (TDOA), and then it establishes nonlinear equations to be solved by optimization methods. The RSSIbased localization algorithm proposed in [3] combines bird swarm optimization and a quasiaffine evolutionary algorithm and optimizes the node centroid location according to RSSI. SEAL [4] was designed for underwater WSNs. It utilizes a highspeed autonomous underwater vehicle (AUV) to assist in localization, and assumes that the sensor nodes and AUVs can calculate the internode and nodeAUV distances. MDSALM [5] forms the distances between the sensor nodes as a sparse distance matrix and utilizes an augmented Lagrange matrix (ALM) filling algorithm to construct a complete distance matrix. Finally, multidimensional scaling (MDS) is applied to implement localization. DSMMMF (a diagonal spatial mappingbased multiple signal classification and matching pursuit fusion algorithm) [6] is proposed for indoor localization. It implements AOA and TOA estimations to localize the target by using a service antenna array with the spacing of the antenna, and does not satisfy the spatial sampling theorem. The cubebased threedimensional location system [7] uses distributed TDOAbased sensor arrays placed with a predefined method, which was designed for WSNs supporting narrowband signal transmissions only. The rangebased algorithm is constrained by the ranging technologies. RSSI is easy and inexpensive to implement, but its accuracy depends heavily on the environmental and weather conditions [8]. TOA and TDOA are more accurate than RSSI, but they depend on timesynchronized nodes, twoway ranging, or timedifference approaches provided by extra hardware, so they are expensive and affect the network’s lifespan [9, 10].
The rangefree algorithm only depends on the connectivity among the sensor nodes, and is easier and cheaper to implement than the rangebased algorithm, so it is widely adopted in applications. ICBGLS [10] follows the geometric constraintbased scheme and considered the diameter finding algorithm of convex polygons to decrease the average localization error as well as the average execution time. PCAL [11] is based on a neural network built by the hop counts between sensor nodes and uses principal component analysis (PCA) to reduce the dimensionality of the data. CRWSNP [12] applies convex programming to estimate the original positions, and then applies multiple iterations to improve the position estimation. ITCLPIT [13] is an improved triangle centroid localization algorithm based on the point in the triangle criterion, which reduces the overlap region by introducing two new anchors. The anchor segmentation and projection for irregular networks (ASPI) algorithm [14] are designed for irregular WSNs. It consists of anchor segmentation border construction, convex hull identification and projectionbased localization.
As a wellknown rangefree localization algorithm, DVHop (distancevector hop) [15] has attracted much attention due to its simplicity, lowcost and easy implementation, and there have been many improvements and enhancements. WHDVHop [16] introduces weights to the correlation matrix of the estimated distances between sensor nodes and anchors to improve accuracy. Three improvements of DVHop are proposed in [17]. Hereinto, iDVHop1 and iDVHop2 choose the two nearest anchors to a sensor node and the estimated position of the original DVHop to form three reference points, and the sensor node takes the centroid of these three points as its final estimation. Quad DVHop formulates the localization problem as a bounded least square problem and utilizes quadratic programming to solve it. DVmaxHop [18] introduces a control parameter MaxHop in the first step of DVHop for anisotropic WSNs, so a sensor node ignores the beacon whose hop count is greater than MaxHop. For aquaculture WSNs, IMDVhop [19] combines weighted least squares and hidden terminal coupling to enhance DVHop. PSODVHop [20] estimates the positions by a twodimensional hyperbolic algorithm and corrects the estimated position by the particle swarm optimization (PSO) algorithm. DECHDVHop [21] expresses the hop counts between sensor nodes by continuous values instead of discrete values and formulates the localization problem as an optimization problem that is solved by differential evolution (DE) algorithms. The halfmeasure weighted centroidbased DVHop algorithm [22] calculates the average hop distance by the halfmeasure weighted centroid and applies the least square method to estimate the sensor nodes’ positions. HMCSD [23] is a hybrid DVHop algorithm that includes three improvements, applying a correction factor to improve the hop counts, introducing a virtual intersecting circle to estimate the hop distance and using a modified cuckoo search to estimate the sensor node positions. IRDVHop [24] uses a recursive position computation and an optimization of the average distance per hop computation of anchors by exploiting a polynomial approximation. NSGAIIDVHop [25] applies the nondominated sorting genetic algorithm II (NSGAII) to estimate the positions. The improved DVHop based on hop thinning and distance correction [26] corrects the minimum hop counts by RSSI, and the average hop distance by a weighted average value of the hop distance error, and estimates the distance error. For threedimensional WSNs, N23DDVHop [27] formulates the localization problem as a multiobjective model and solves it by NSGAII. PMDVHop [28] proposes a path matching algorithm to determine the optimal anchoranchor shortest path and uses a modified PSO algorithm to optimize the initial estimated position.
This paper proposes WRCDVHop (weighted, RSSIbased, and continuous hop count DVHop), which both can improve the localization accuracy and also reduce the energy consumption. The improvements include the following:

1
Continuous value expressed hop counts. DVHop expresses the hop count between a pair of sensor nodes as an integer, which is far from the real distance. WRCDVHop expresses the hop count as a continuous number according to the neighbourhood relationship and RSSI.

2
Weighted average hop distance. The unknown nodes utilize a weighted method to calculate the average distance per hop instead of taking the first received average distance per hop as its result.

3
Limited number of relaying packets. When calculating the shortest paths between sensor nodes, a sensor node only receives and relays some of the anchors’ packets instead of all the packets, so the number of packets to be flooded is reduced significantly, and subsequently, the energy consumption will be greatly reduced.

4
Improved whale optimization algorithmbased position estimation. The sensor nodes utilize the improved whale optimization algorithm (WOA), a popular swarm intelligence optimization algorithm, to estimate their positions. This method can improve the estimation accuracy.
The rest of the paper is organized as follows. Section 2 defines the localization problem and describes DVHop’s basic steps. Section 3 presents the details of the proposed WRCDVHop algorithm. Section 4 presents the software simulation results and an analysis. Finally, Sect. 5 concludes the paper.
2 Problem statements and DVhop algorithm
A WSN consists of a large number of sensor nodes, and each sensor node has a unique ID. The localization determines the positions of the unknown nodes with the help of anchors. Assume there are N sensor nodes \(\{s_1,s_2,\ldots ,s_N\}\). The first M sensor nodes are the anchors, and the latter \(NM\) sensor nodes are the unknown nodes. Let \((x_i,y_i )\) be the position of sensor node \(s_i (i=1,2,\ldots ,N)\), and \((\hat{x_i},\hat{y_i})\) be the estimated position of unknown node \(s_i (i=M+1,M+2,\ldots ,N)\). All sensor nodes has a circular radio range with a radius R. Two sensor nodes are neighbours if they can communicate with each other directly, i.e., their distance is less than R. Suppose the WSN is densely deployed and connected, that is, any pair of sensor nodes can communicate with each other directly or indirectly. Given two sensor nodes \(s_i\) and \(s_j\), their hop count \(h_{ij}\) is the number of sensor nodes they pass through when they communicate, where the hop count of a pair of neighboring sensor nodes is 1. Moreover, two neighboring sensor nodes can measure RSSI, and let \(\textrm{RSSI}_{ij}\) be the RSSI value from \(s_i\) to \(s_j\).
Radio irregularity is a common phenomenon in wireless sensor networks, and we use DOI (degree of irregularity) to denote the irregularity of the radio pattern. DOI determines the communication range for 360 different directions, and it is defined as
where \(K_\theta\) is a coefficient to represent the difference in path loss in directions \(\theta\), and r is a random number fitting Weibull distribution. When \(\textrm{DOI}=0\), communication range is a perfect circle. As DOI increases, the communication range becomes more and more irregular.
DVHop [15] consists of three phases. First, each anchor broadcasts a beacon in a flooding manner, and then each sensor node calculates the shortest paths to the other sensor nodes. Second, each anchor \(s_i (i=1,2,\ldots ,M)\) calculates the average distance per hop \(\textrm{Avg\,Dis}_i\) using
and it floods \(\textrm{Avg\,Dis}_i\) to the whole network. Each unknown node calculates the distances to each anchor using the first received \(\textrm{Avg\,Dis}_i\) and the corresponding hop counts. Finally, each unknown node estimates its position.
3 Methodology
The original DVHop algorithm has two main disadvantages, a low localization accuracy and a high energy consumption. The former results from the large error in calculating the distance between the sensor nodes and the position estimation algorithm. The latter results from the two message flooding operations to calculate the shortest paths and to broadcast the average distance per hop. WRCDVHop aims to address both of the abovementioned disadvantages. The basic procedure of WRCDVHop is the same as DVHop as follows:

Calculate the continuous hopcount between the sensor nodes, see 3.1

Calculate the shortest paths between the unknown nodes and anchors, see 3.2

Calculate the average hop distance between the sensor nodes, see 3.3

Calculate the positions of the unknown nodes using improved WOA, see 3.4
This section presents the details of these improvements.
3.1 Continuous hop count calculation
As mentioned in [21], DVHop estimates that the distance between a pair of neighbouring sensor nodes is always R. As shown in Fig. 1, sensor nodes \(s_i\), \(s_j\), and \(s_k\) are neighbours, but the distances from \(s_i\) to \(s_j\) and \(s_i\) to \(s_k\) are different. If these two distances are estimated to be R, the estimated distances between the unknown nodes and the anchors will be extremely inaccurate, subsequently leading to a high localization error. Therefore, WRCDVHop also represents the hop count between a pair of sensor nodes by a continuous value as [21], and it applies RSSI to make the value more accurate. The continuous hop count makes the distance estimation more accurate than the discrete hop count, and it can lead to a high localization accuracy.
Suppose \(s_i\) and \(s_j\) are a pair of neighbouring nodes, as shown in Fig. 2. The area of the radio intersection region ranges of \(s_i\) and \(s_j\) is
where \(d_{ij}\) is the distance between \(s_i\) and \(s_j\). Let \(\textrm{NS}_i\) and \(\textrm{NS}_j\) be the numbers of neighbouring sensor nodes of \(s_i\) and \(s_j\), respectively. Let \(\textrm{NS}_{ij}^i\) and \(\textrm{NS}_{ij}^j\) be the number of common neighbour sensor nodes nearer to \(s_i\) than \(s_j\), and nearer to \(s_j\) than \(s_i\), respectively. Given a common neighbour sensor node \(s_k\) of \(s_i\) and \(s_j\), if \(\textrm{RSSI}_{ki}\ge \textrm{RSSI}_{kj}\), \(s_k\) is nearer to \(s_i\) than \(s_j\). If \(\textrm{RSSI}_{ki} \le \textrm{RSSI}_{kj}\), \(s_k\) is nearer to \(s_j\) than \(s_i\). Therefore, we can calculate \(\textrm{NS}_{ij}^i\) and \(\textrm{NS}_{ij}^j\) based on RSSI values. For a densely and uniformly deployed WSN, we can use the following equations to estimate \(d_{ij}\):
After calculating \(x_1\) and \(x_2\) by (4), the continuous hop count between \(s_i\) and \(s_j\) is
After deployment, each sensor node broadcasts a message including its ID. Once a sensor node receives a message, it records the corresponding ID and RSSI into a neighbour list. Next, the neighbouring sensor nodes exchange their respective neighbour lists, and the continuous hop count can be calculated by the above method.
Algorithm 1 presents the details. All the sensor nodes run this algorithm simultaneously. In this algorithm, \(Nbr_i\) represents the neighbour list of \(s_i\). Initially, \(Nbr_i\) is empty (Line 1), and it is updated when \(s_i\) receives its neighbour’s packet (Lines 3–5). When \(s_i\) cannot receive any packet, it sends \(Nbr_i\) to its neighbours (Line 7). Lines 8–23 calculate the continuous hop counts between \(s_i\) and each of its neighbours \(s_j\). Herein, Lines 12–21 calculate \(N_{ij}^i\) and \(N_{ij}^i\), and Line 22 calculates \(h_{ij}\) using (4) and (5).
3.2 Shortest path calculation
Since the message flooding method consumes much energy and an unknown node can be localized with at least three noncolinear beacons, WRCDVHop does not require each sensor node to relay all the packets it receives.
Each anchor \(s_j (j=1,2,\ldots ,M)\) broadcasts a beacon \((s_j,x_j,y_j,h_{jj})\) to its neighbours, where \(h_{jj}=0\) initially. Each sensor node \(s_i (i=1,2,\ldots ,N)\) maintains a beacon list \(L_i=\{B_j\Vert B_j=(s_j,x_j,y_j,h_{ij})\}\), where \(B_j\) is the beacon from anchor \(s_j\), and \(h_{ij}\) is the continuous hop count from \(s_j\) to \(s_i\). \(L_i=\emptyset\) initially. When a sensor node \(s_i\) receives a beacon \(B_j\) from neighbor \(s_k\), it updates \(B_j\) to \((s_j,x_j,y_j,h_{ik}+h_{kj})\), and then it executes the following procedure:

1
If \(s_i\) received the beacon of \(s_j\) in previous steps, i.e., there is a beacon \(B_j^\prime =(s_j^\prime ,x_j^\prime ,y_j^\prime ,h_{ij}^\prime )\) whose \(s_j^\prime =s_j\),\(x_j^\prime =x_j\),\(y_j^\prime =y_j\).

(a)
If \(h_{ij}<h_{ij}^\prime\), \(s_i\) deletes \(B_j^\prime\) from \(L_i\) and inserts \(B_j\) into \(L_i\). Furthermore, \(s_i\) broadcasts \(B_j\) to its neighbors.

(b)
If \(h_{ij}>h_{ij}^\prime\), \(s_i\) ignores \(B_j\).

(a)

2
If \(s_i\) did not receive the beacon of \(s_j\) in previous steps, and the number of beacons in \(L_i\) is less than 3 or these beacons are colinear, \(s_i\) inserts \(B_j\) into \(L_i\) and broadcasts \(B_j\) to its neighbors. In order to determine whether the beacons of \(L_i\) are colinear, we can take any two beacons to establish a straight line and calculate the distances from the other beacons to the straight line. The beacons of \(L_i\) are colinear if all the distances are approximately equal to 0.

3
If \(s_i\) did not receive the beacon of \(s_j\) in previous steps, and the number of beacons in \(L_i\) is not less than 3 and these beacons are noncolinear, \(s_i\) computes \(h_{\max }\) as
$$\begin{aligned} h_{\max }=\max \{h_{il}\Vert h_{il}\in B_l \wedge B_l\in L_i\}. \end{aligned}$$(6)
(a)
If \(h_{ij}<h_{\max }\), \(s_i\) inserts \(B_j\) into \(L_i\) and relays \(B_j\) to its neighbors. Furthermore, \(s_i\) removes one beacon containing \(h_{\max }\) from \(L_i\).

(b)
If \(h_{ij}>h_{\max }\) and \(s_i\) ignores \(B_j\).

(c)
If \(h_{ij}=h_{\max }\), \(s_i\) inserts \(B_j\) into \(L_i\) and relays \(B_j\) to its neighbors.

(a)
The significance of the above process is to ensure that the number of beacons recorded and relayed by each sensor node is as few as possible but sufficient for localization. On the one hand, each sensor node can receive at least 3 beacons because the WSN is connected. On the other hand, when a sensor node has at least 3 noncolinear beacons, it ignores the beacons that are sent by the anchors further away than the current anchors, and it does not relay these beacons.
Algorithm 2 presents the details of the shortest path calculation, and all the sensor nodes run it simultaneously. In this algorithm, Lines 2–5 are executed by anchors to broadcast beacons. Lines 6–35 are the iterative process to calculate the shortest paths. After receiving a new beacon of anchor \(s_j\) through sensor node \(s_k\) (Line 6), Line 7 calculates \(h_{ij}\), and Line 8 initializes the flag. If the beacon of \(s_j\) has been received, Lines 9–19 update the records if the new \(h_{ij}\) is less than the old one, and relay the new value to its neighbours. Otherwise, Lines 20–34 append the beacon to \(L_i\) if \(L_i\) has only 1 or 2 beacons (Lines 21) or the new \(h_{ij}\) is not greater than \(h_{\max }\) (Lines 26–32).
3.3 Hop distance calculation
Suppose the beacon list of sensor node \(s_i\) is \(L_i=\{B_{i_j}\Vert j=1,2,\ldots ,K_i\}\) where \(K_i\) is the number of beacons of \(L_i\), and \(B_{i_j}=(s_{i_j},x_{i_j},y_{i_j},h_{i,i_j})\). Because each anchor may not receive all the beacons of the other anchors, the average distance per hop of anchor \(s_i (i=1,2,\ldots ,M)\) should change to
After calculating \(\textrm{Avg\,Dis}_i\), anchor \(s_i\) broadcasts this value to its neighbours. Once a sensor node \(s_j\) receives an \(\textrm{Avg\,Dis}_i\), it records and relays \(\textrm{Avg\,Dis}_i\) to its neighbors if and only if a beacon \(B_{j_k}\in L_j\) satisfies \(s_{j_k}=s_i\), namely, \(s_j\) records the beacon of \(s_i\) during the shortest path calculation. The unknown node \(s_j (j=M+1,M+2,\ldots ,N)\) calculates its own average distance per hop \(\textrm{HopDis}_j\) by
where \(\textrm{Avg\,Dis}_{j_k}\) is the average distance per hop calculated by \(s_{j_k} (s_{j_k}\in B_k,B_k\in L_j)\), and \(w_{j_k}\) is the weight of \(\textrm{Avg\,Dis}_{j_k}\) defined as
Finally, the unknown node \(s_j\) calculates its distance to anchor \(s_{j_k}\) of \(L_j\) by
3.4 WOAbased position estimation
WRCDVHop uses an improved WOA to estimate the positions of the unknown nodes. WOA mimics the hunting behavior of humpback whales [29]. Given an optimization problem in Ddimensional space, the WOA initializes P search agents. The position of the ith \((i=1,2,\ldots ,P)\) agent is \(\overrightarrow{Z_i}\). Next, the WOA iteratively seeks the optimal solution. During each iteration, each agent searches for the optimal prey by encircling the prey, executing the spiral bubblenet feeding manoeuvre and searching for the prey. Taking the ith agent as an example, the mathematical models of these three behaviours are as follows.

1
Encircling prey. The agent updates its position to the best agent as
$$\begin{aligned} \overrightarrow{Z_i}=\overrightarrow{Z^{\star }}\overrightarrow{A}\cdot \overrightarrow{C}\cdot \overrightarrow{Z^{\star }}\overrightarrow{Z_i}, \end{aligned}$$(11)where \(\overrightarrow{Z^{\star }}\) is the position of the best agent obtained so far, and \(\overrightarrow{C}\) and \(\overrightarrow{A}\) are coefficients defined as
$$\begin{aligned} \begin{array}{l} \overrightarrow{C}=2\overrightarrow{r_1}, \\ \overrightarrow{A}=2\overrightarrow{a}\cdot \overrightarrow{r_1}\overrightarrow{a}, \end{array} \end{aligned}$$(12)where \(\overrightarrow{a}\) is linearly decreased from 2 to 0 during iteration, and \(\overrightarrow{r_1}\in [0,1]\) is a random vector.

2
Bubblenet attacking. It is modelled by two approaches. The first is the shrinking encircling mechanism, which is implemented by decreasing \(\overrightarrow{a}\) in (12). The second is to mimic the spiral movement of the whale defined as:
$$\begin{aligned} \overrightarrow{Z_i}=\overrightarrow{Z^{\star }}\overrightarrow{Z_i}\cdot e^{br_2}\cdot \cos {(2\pi r_2)}+\overrightarrow{Z^{\star }}, \end{aligned}$$(13)where \(r_2\in [1, 1]\) is a random number, and b is a constant. The choice between these two approaches is determined by a random number \(r_3\in [0,1]\): If \(r_3<0.5\), it uses (11); otherwise, it uses (13).

3
Searching for prey. It is formulated as
$$\begin{aligned} \overrightarrow{Z_i}=\overrightarrow{Z_{rand}}\overrightarrow{A}\cdot \overrightarrow{C}\cdot \overrightarrow{Z_{rand}}\overrightarrow{Z_i}, \end{aligned}$$(14)where \(\overrightarrow{Z_{rand}}\) is the position of an agent randomly selected from the current population.
As noted in [30], the WOA has less space complexity than the other swarm optimization algorithms, and it has a strong local search ability. However, it also has some defects. It easily falls into a local optima and has insufficient global search abilities, so it does not maintain an effective balance between exploration and exploitation. We introduce opposite agents into the WOA to balance exploration and exploitation.
After updating all the agents, some of them are randomly chosen to generate the opposite agents to the best agent \(\overrightarrow{Z^{\star }}\) as
where \(\overrightarrow{Z_j}\) is the position of a randomly chosen agent, \(r_4\) is a random number, and \(\overrightarrow{LB}\) and \(\overrightarrow{UB}\) are respectively the lowerbound and upperbound of the search space.
The fitness function of localizing unknown node \(s_j(j=M+1, M+2,\ldots ,N)\) is defined as
Algorithm 3 presents the details of WRCDVHop. This algorithm is run by all the sensor nodes simultaneously. Given a sensor node \(s_i\), it calculates the continuous hop counts and the shortest paths (Lines 1–2) first. If \(s_i\) is an anchor, it calculates and broadcasts \(\textrm{Avg\,Dis}_i\), and then they exit (Lines 37). If \(s_i\) is an unknown node, it continues the remaining steps. It calculates \(\textrm{HopDis}_i\) and the distances to the anchors within \(L_i\) (Lines 8–9). Lines 10–35 utilize the improved WOA for estimation. Lines 10–11 initialize a swarm of agents and obtain their fitness, and Line 12 assigns the current best agent to \(\overrightarrow{Z^{\star }}\). During each iteration, Lines 14–15 calculates \(\overrightarrow{a}\), \(\overrightarrow{A}\) and \(\overrightarrow{C}\). Lines 16–28 update all the agents according to the original WOA. Line 29 applies the proposed improvement. Line 30 limits all the agents within the search space. Lines 31–33 prepare for the next iteration. Finally, it returns the best coordinates \(\overrightarrow{Z^{\star }}\) as \((\hat{x_i},\hat{y_i})\) (Line 35).
4 Results and discussion
The simulations are performed in MATLAB R2018b. The sensor nodes are deployed in a square region with a side length of 100 m. The simulations are performed in four different deployments, random topology, grid topology, Crandom topology and Cgrid topology. Figure 3 demonstrates these four different topologies, where the red stars and blue circles are the anchors and unknown nodes, respectively.
The performance of the proposed WRCDVHop is compared with PSODVHop [20], DECHDVHop [21] and PMDVHop [28]. We utilize each algorithm to localize the above four different WSNs by 100 runs, and the results are the average of these runs. For WRCDVHop, the parameters are \(b = 1\) and \(t_{\max } = 200\). The parameters of the other algorithms are set according to the corresponding references.
4.1 Localization error analysis
4.1.1 Localization error comparison
In this section, N =100, M =30, R=20 m and DOI =0.02. As Fig. 4 shows, in all the topologies, WRCDVHop has the lowest median, followed by PMDVHop, DECHDV Hop and PSODVHop. Taking random topology as an example, the medians of PMDVHop, DECHDVHop and PSODVHop are 164.3%, 104.4% and 28.5% larger than WRCDVHop, respectively. For all the algorithms, the median of the Crandom topology is always the largest. The interquartile ranges of all the algorithms are within 0.061 to 0.086. The first two maximum interquartile ranges, 0.086 and 0.083, are PMDVHop and PSODVHop in the grid topology. The other interquartile ranges are all less than 0.08. For all the algorithms, the number of outliers of the Crandom topology is the highest. The numbers of outliers of the other topology are almost the same, which are 2 or 3. PSODVHop has the largest outlier in all the topologies. Furthermore, the distributions of the localization errors in all situations are rightskewed or symmetric.
Figure 5 shows the cumulative distribution function (CDF) curves. For all the algorithms in all the topologies, 98% of the sensor nodes can be localized with a normal localization error. For example, in the random topology, WRCDVHop, PMDVHop, DECHDV Hop and PSODVHop localize 98.57% of the sensor nodes with localization errors less than 0.25 m, 0.2797 m, 0.3652 m and 0.4716 m, respectively. In each topology, the distributions of the localization errors of all the algorithms are almost identical, and PSODVHop is always the largest, followed by DECHDVHop, PMDVHop and WRCDVHop.
To further compare the different algorithms, the impacts of R, M, and DOI on the average localization error, ALE, are analysed. ALE is defined as
4.1.2 Impacts of R on ALE
In this simulation, N=100, M=30, R=20 to 40 at a step of 5, and DOI = 0.02. The experimental results are shown in Table 1 and Fig. 6. The results show that WRCDVHop has the smallest ALE among all the algorithms. The ALE of all the algorithms decreases with an increasing R. As shown in Fig.6, on average, the ALE of \(R=40\) m improves by 49.67%, 46.75%, 67.79% and 59.44% compared with \(R=20\) m for all the algorithms in the random, grid, Crandom and Cgrid topologies, respectively. Considering the different algorithms, the ALE of \(R=40\) m improves by 73.04%, 64.50%, 48.03% and 38.08% compared to \(R=20\) m for all the topologies using WRCDV Hop, PMDVHop, DECHDVHop and PSODVHop, respectively.
As R increases, a sensor node has more neighbours, so the hop counts between the sensor nodes are more accurate, leading to the distances calculated by (10) being more accurate. On the other hand, a larger R enhances the connectivity of the WSN, so each unknown node can utilize more anchors to localize itself.
4.1.3 Impacts of M on ALE
In this simulation, R=20 m, M=10 to 30 at a step of 5, N=100, and DOI = 0.02. The results are shown in Table 2 and Fig. 7, which shows that the ALE decreases with an increasing M. Compared with the other three localization algorithms, WRCDVHop has the smallest ALE. For all the localization algorithms, the ALE of the random and grid topologies is smaller than that of the Crandom and Cgrid topologies, and the ALE of the grid topology is smaller than that of the random topology. In these four topologies, WRCDVHop always has the highest localization accuracy, followed by PMDVHop, DECHDVHop and PSODVHop. As shown in Fig. 7, on average, the ALE of \(M=30\) improves 17.51%, 26.31%, 60.44% and 64.43% compared to \(M=10\) for all the algorithms in the random, grid, Crandom, and Cgrid topologies, respectively. Considering the different algorithms, the ALE of \(M=30\) improves by 42.88%, 44.61%, 43.43% and 37.77% compared to \(M=10\) for all the topologies using WRCDVHop, PMDVHop, DECHDVHop and PSODVHop, respectively.
As M increases, there are more anchors to assist the localization, and the average \(\textrm{Avg\,Dis}\) decreases and becomes more accurate, so the localization accuracy becomes higher.
4.1.4 Impacts of DOI on ALE
In this simulation, R=20 m, M=30, N=100, DOI = 0.05 to 0.25 at a step of 0.05. The results are shown in Table 3 and Fig. 8. For all the topologies, the ALE of the four algorithms increases with an increasing DOI, and the ALE of WRCDVHop is the smallest among all the algorithms in all cases. For all the algorithms and DOIs, the ALE of the random and grid topologies are smaller than those of the Crandom and Cgrid topologies. Moreover, the ALE of WRCDVHop is the least affected by DOI among the four algorithms. As shown in Fig. 8, on average, the ALE of \(\textrm{DOI}=0.25\) decreases by 14.77%, 16.60%, 15.29%, and 22.54% compared to \(\textrm{DOI}=0.05\) for all the algorithms in the random, grid, Crandom, and Cgrid topologies, respectively. Considering the different algorithms, the ALE of \(\textrm{DOI}=0.25\) decreases by 20.68%, 22.68%, 11.50% and 14.33% relative to \(\textrm{DOI}=0.05\) for all the topologies using WRCDVHop, PMDVHop, DECHDVHop and PSODVHop, respectively.
As DOI increases, the radio range of the sensor nodes becomes more irregular, resulting in an increasingly inaccurate hop count estimation. Moreover, the larger DOI makes the sensor nodes record beacons of the “wrong” anchors. For example, suppose \(s_i\) is an anchor, and an unknown node \(s_j\) is one of its neighbours, which means \(s_j\) can receive and record the beacon of \(s_i\). However, when DOI becomes larger, \(s_j\) may not receive the beacon of \(s_i\) because the radio range of \(s_i\) cannot cover \(s_j\).
4.2 Energy consumption analysis
The low energy consumption requirement is one of the most important constraints on WSNs, so the localization algorithm should try to reduce the energy consumption as well as improve the localization accuracy, and then the lifetime of the WSN can be as long as possible. In DVHop and most of its improved algorithms, most of the energy is consumed for message communication, especially in calculating the shortest path and broadcasting the average distance per hop. To analyse the communications energy consumption during localization, we use the firstorder radio model [31] shown in Fig. 9, where \(\eta\) denotes the number of bits of the packet to be transmitted, and d is the distance between the sensor nodes. The radio dissipates \(E_{\textrm{elec}}\) to run the transmitter or receiver circuitry for every bit and \(\epsilon _{\textrm{amp}}\) for the transmit amplifier. The energy consumed by transmitter to transmit a \(\eta\) bits packet at distance d is
The energy consumed by receiver to receive this message is
In this simulation, N=100, M=20 to 40 at steps of 5, R=20 m, DOI = 0.02, \(E_{\textrm{elec}}\)=50 nJ/bit and \(\epsilon _{\textrm{amp}}\)=100 pJ/bit/\(m^2\). The result is shown in Fig. 10. Note that the energy consumption of WRCDVHop and DECHDVHop contains the energy consumed during the continuous hop count calculation. Under all the topologies, the energy consumption of the four algorithms increases as the number of anchor nodes increases because more packets are broadcast and relayed with more anchors. The energy under the random and Crandom topology is smaller than that of the grid and Cgrid topologies. WRCDVHop always has the smallest energy consumption under the four topologies, followed by DECHDVHop, PMDVHop and PSODVHop. This can also be proven by Table 4.
For all the algorithms, the more anchors there are, the more packets there are to be received and relayed, so the energy consumption increases with the number of anchors. WRCDVHop and DECHDVHop need to broadcast additional packets to calculate the continuous hop count, so they need more energy in this phase. However, the continuous hop count leads to a more accurate hop distance estimation, so each sensor node can adjust the power to relay the packet according to the estimated hop distance, and thus, the energy consumption is reduced in calculating the shortest path and broadcasting the average distance per hop. WRCDVHop constrains each sensor node to only relaying the necessary packets, so the number of packets transmitted in the entire network is less than that of DECHDVHop; thus, WRCDVHop can further reduce the energy consumption.
4.3 Complexity performance analysis
The four algorithms utilize swarm intelligence optimizers to estimate the locations of the sensor nodes, so their complexity depends on many factors, including the size of the swarm, the number of anchors, the number of iterations and the update equations. Instead of using a theoretical analysis, the complexity of these algorithms is compared by the average execution time of localizing one sensor node.
In this section, N=100, M=20, R=20 m and DOI = 0.02. As Table 5 shows, WRCDV Hop consumes the least time under all the topologies, followed by PMDVHop, DECHDV Hop and PSODVHop. On average, PMDVHop, DECHDVHop and PSODVHop consume 11.98%, 28.69% and 72.10% more time than WRCDVHop, respectively. WRCDVHop localizes each sensor node by a few but a sufficient number of anchors, while the other three algorithms use all the anchors. Moreover, WRCDVHop requires each sensor node to record and relay some of the received beacons, while the other algorithms record and relay all the beacons. These two reasons shorten the execution time of WRCDVHop.
The deployment of sensor nodes in the grid and Cgrid topologies is regular, which speeds up the shortest path calculation, so the execution time of the random topology is longer than that of the grid topology. On average, the random topology needs 3% more time to localize a sensor node than the grid topology, and the Crandom topology consumes 7% more time than the Cgrid topology. Furthermore, the Crandom and Cgrid topologies have holes, so they need more time to calculate the shortest path, and subsequently, they consume more time than the random and grid topologies. On average, the Crandom topology consumes 21.82% more time than the random topology, and the Cgrid topology consumes 16.72% more time than the grid topology.
5 Conclusion
This paper proposes a lowpower and highaccuracy rangefree localization algorithm, WRCDVHop, to address the deficiencies of DVHop. WRCDVHop can achieve higher localization accuracy and lower energy usage because:

1
It expresses the hop counts between the sensor nodes by continuous values, which is more accurate than integer values, so a sensor node can adjust its radio power while broadcasting beacons instead of always using the maximum radio power. Furthermore, the continuous hop counts make the distance estimation between the unknown nodes and anchors more accurate, which increases the localization accuracy.

2
It ensures that each sensor node only receives and relays the beacons of the nearest and sufficient anchors, so WRCDVHop consumes less energy. WRCDVHop uses fewer anchors to localize the unknown nodes than the other algorithms but it represents the hop counts between the sensor nodes by a continuous value, and it introduces a weighted idea in calculating the average distance per hop, so the more accurate distance estimation helps it to achieve a higher accuracy.

3
It improves the WOA to jump out of the local optimum, and the improved WOA outperforms PSO in PMDVHop and PSODVHop and DE in DECHDVHop. This further improves the localization accuracy.
The simulations under four different network topologies show that WRCDVHop has a higher localization accuracy and smaller energy consumption than PMDVHop, PSODVHop and DECHDVHop. In future, we will extends WRCDVHop to threedimensional sensor networks, and try to find the other better optimization algorithms to estimate the positions.
Availability of data and materials
Data sharing not applicable to this article as no datasets were generated or analyzed during the current study.
Abbreviations
 WSN:

Wireless sensor network
 RSSI:

Received signal strength indicator
 TOA:

Time of arrival
 TDOA:

Time difference of arrival
 AUV:

Autonomous underwater vehicle
 DVHop:

Distancevector hop
 WRCDVHop:

Weighted, RSSIbased, and continuous hop count DVHop
 WOA:

Whale optimization algorithm
 DOI:

Degree of irregularity
 ALE:

Average localization error
 CDF:

Cumulative distribution function
References
Z. Fei, B. Li, S. Yang, C. Xing, H. Chen, L. Hanzo, A survey of multiobjective optimization in wireless sensor networks: metrics, algorithms, and open problems. IEEE Commun. Surv. Tutor. 19(1), 550–586 (2017). https://doi.org/10.1109/COMST.2016.2610578
Z. Lalama, S. Boulfekhar, F. Semechedine, Localization optimization in WSNs using metaheuristics optimization algorithms: a survey. Wirel. Pers. Commun. 122(2), 1197–1220 (2022). https://doi.org/10.1007/s11277021089458
E.M. Malathy, M. Asaithambi, A. Dheeraj, K. Arputharaj, Hybrid bird swarm optimized quasi affine algorithm based node location in wireless sensor networks. Wirel. Pers. Commun. 122(2), 947–962 (2022). https://doi.org/10.1007/s1127702108934x
T. Ojha, S. Misra, M.S. Obaidat, SEAL: Selfadaptive AUVbased localization for sparsely deployed underwater sensor networks. Comput. Commun. 154, 204–215 (2020). https://doi.org/10.1016/j.comcom.2020.02.050
P. Wang, G. Tu, Localization algorithm of wireless sensor network based on matrix reconstruction. Comput. Commun. 154, 216–222 (2020). https://doi.org/10.1016/j.comcom.2020.01.051
X. Yang, Y. She, M. Zhou, W. Nie, Service antenna arraybased parameter estimation for decimeter level indoor localization. IEEE Sens. Lett. 6(7), 1–4 (2022). https://doi.org/10.1109/LSENS.2022.3184348
C.Y. Wei, C.C. Chen, Cubebased multitarget 3d localization using bayesian learningbased turbo decoding in wireless sensor networks. IEEE Sens. J. 22(17), 17291–17306 (2022). https://doi.org/10.1109/JSEN.2022.3193021
J. Luomala, I. Hakala, Analysis and evaluation of adaptive RSSIbased ranging in outdoor wireless sensor networks. Ad Hoc Netw. 87, 100–112 (2019). https://doi.org/10.1016/j.adhoc.2018.10.004
R.M. Buehrer, H. Wymeersch, R.M. Vaghefi, Collaborative sensor network localization: algorithms and practical issues. Proc. IEEE 106(6), 1089–1114 (2018). https://doi.org/10.1109/JPROC.2018.2829439
T. Das, P.M. Khilar, R.R. Swain, Rangefree intersecting chordbased geometric localization scheme for wireless sensor networks. Int. J. Commun. Syst. 33(3), 1–23 (2020). https://doi.org/10.1002/dac.4217
S.S. Banihashemian, F. Adibnia, A new rangefree PCAbased localization algorithm in wireless sensor networks. Int. J. Commun. Syst. 33(6), 1–16 (2020). https://doi.org/10.1002/dac.4291
F. Darakeh, G.R. MohammadKhani, P. Azmi, CRWSNP: cooperative rangefree wireless sensor network positioning algorithm. Wirel. Netw. 24(8), 2881–2897 (2018). https://doi.org/10.1007/s1127601715052
F.J. Mao Li, C. Pei, Improvement of triangle centroid localization algorithm based on PIT criterion (ITCLPIT) for WSNs. EURASIP J. Wirel. Commun. Netw. 19, 1–16 (2022). https://doi.org/10.1186/s13638022021093
J. Wang, L. Cheng, Y. Tu, S. Gu, A novel localization approach for irregular wireless sensor networks based on anchor segmentation. IEEE Sens. J. 22(7), 7267–7276 (2022). https://doi.org/10.1109/JSEN.2022.3143826
D. Niculescu, B. Nath, DV based positioning in Ad Hoc networks. Telecommun. Syst. 22(1), 267–280 (2003). https://doi.org/10.1023/A:1023403323460
J. MassSanchez, E. RuizIbarra, J. CortezGonzález, A. EspinozaRuiz, L.A. Castro, Weighted hyperbolic DVhop positioning node localization algorithm in WSNs. Wirel. Pers. Commun. 96(4), 5011–5033 (2017). https://doi.org/10.1007/s1127701637275
S. Tomic, I. Mezei, Improvements of DVhop localization algorithm for wireless sensor networks. Telecommun. Syst. 61(1), 93–106 (2016). https://doi.org/10.1007/s1123501500149
F. Shahzad, T.R. Sheltami, E.M. Shakshuki, DVmaxHop: a fast and accurate rangefree localization algorithm for anisotropic wireless networks. IEEE Trans. Mob. Comput. 16(9), 2494–2505 (2017). https://doi.org/10.1109/TMC.2016.2632715
J. Zhu, C. Lv, Z. Tao, An improved localization scheme based on IMDVhop for largescale wireless mobile sensor aquaculture networks. EURASIP J. Wirel. Commun. Netw. (2018). https://doi.org/10.1186/s1363801811906
S.P. Singh, S.C. Sharma, A PSO based improved localization algorithm for wireless sensor network. Wirel. Pers. Commun. 98(1), 487–503 (2018). https://doi.org/10.1007/s1127701748801
L. Cui, C. Xu, G. Li, Z. Ming, Y. Feng, N. Lu, A high accurate localization algorithm with DVhop and differential evolution for wireless sensor network. Appl. Soft Comput. 68, 39–52 (2018). https://doi.org/10.1016/j.asoc.2018.03.036
L. Jian Yin, A new distance vectorhop localization algorithm based on halfmeasure weighted centroid. Mob. Inf. Syst. (2019). https://doi.org/10.1155/2019/9892512
X. Yu, M. Hu, Hopcount quantization ranging and hybrid cuckoo search optimized for DVhop in WSNs. Wirel. Pers. Commun. 108(4), 2031–2046 (2019). https://doi.org/10.1007/s11277019065077
S. Messous, H. Liouane, N. Liouane, Improvement of DVhop localization algorithm for randomly deployed wireless sensor networks. Telecommun. Syst. 73, 75–86 (2020). https://doi.org/10.1007/s11235019005926
P. Wang, F. Xue, H. Li, Z. Cui, L. Xie, J. Chen, A multiobjective DVhop localization algorithm based on NSGAII in Internet of Things. Mathematics (2019). https://doi.org/10.3390/math7020184
D. Xue, Research of localization algorithm for wireless sensor network based on DVhop. EURASIP J. Wirel. Commun. Netw. (2019). https://doi.org/10.1186/s1363801915395
X. Cai, P. Wang, L. Du, Z. Cui, W. Zhang, J. Chen, Multiobjective threedimensional DVhop localization algorithm with NSGAII. IEEE Sens. J. 19(21), 10003–10015 (2019). https://doi.org/10.1109/JSEN.2019.2927733
Q. Shi, Q. Xu, J. Zhang, An improved DVhop scheme based on path matching and particle swarm optimization algorithm. Wirel. Pers. Commun. 104(4), 1301–1320 (2019). https://doi.org/10.1007/s1127701860848
S. Mirjalili, A. Lewis, The whale optimization algorithm. Adv. Eng. Softw. 95, 51–67 (2016). https://doi.org/10.1016/j.advengsoft.2016.01.008
X. Zhang, S. Wen, Hybrid whale optimization algorithm with gathering strategies for highdimensional problems. Expert Syst. Appl. 179, 115032 (2021). https://doi.org/10.1016/j.eswa.2021.115032
W.R. Heinzelman, A. Chandrakasan, H. Balakrishnan, Energyefficient communication protocol for wireless microsensor networks. In: Proceedings of the 33rd Annual Hawaii International Conference on System Sciences, vol. 8 (2000). https://doi.org/10.1109/HICSS.2000.926982
Funding
This work is supported by the National Key R&D Program of China (Grant No. 2018YFC1406203), Natural Science Foundation of China (Grant No. 62072287), Natural Science Foundation of Shandong Province, China (Grant No. ZR2021LZH004), Shandong Postgraduate Tutor Guidance Ability Improvement Project (Grant No. SDYY17040), and Science and Technology Support Plan of Youth Innovation Team of Shandong Higher School, China (Grant No. 2019KNJ024).
Author information
Authors and Affiliations
Contributions
HC proposed the main idea and analyzed the result. He is the main writer of this paper. SW performed the simulation. CZ revised the paper. All authors read and approved the final manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare that they have no competing interests.
Additional information
Publisher's note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Cui, H., Wang, S. & Zhou, C. A highaccuracy and lowenergy rangefree localization algorithm for wireless sensor networks. J Wireless Com Network 2023, 37 (2023). https://doi.org/10.1186/s13638023022463
Received:
Accepted:
Published:
DOI: https://doi.org/10.1186/s13638023022463
Keywords
 Wireless sensor network localization
 Rangefree
 Whale optimization algorithm
 Hop count