Enhancing the Sensor Node Localization Algorithm Based on Improved DV-Hop and DE Algorithms in Wireless Sensor Networks

The Distance Vector-Hop (DV-Hop) algorithm is the most well-known range-free localization algorithm based on the distance vector routing protocol in wireless sensor networks; however, it is widely known that its localization accuracy is limited. In this paper, DEIDV-Hop is proposed, an enhanced wireless sensor node localization algorithm based on the differential evolution (DE) and improved DV-Hop algorithms, which improves the problem of potential error about average distance per hop. Introduced into the random individuals of mutation operation that increase the diversity of the population, random mutation is infused to enhance the search stagnation and premature convergence of the DE algorithm. On the basis of the generated individual, the social learning part of the Particle Swarm (PSO) algorithm is embedded into the crossover operation that accelerates the convergence speed as well as improves the optimization result of the algorithm. The improved DE algorithm is applied to obtain the global optimal solution corresponding to the estimated location of the unknown node. Among the four different network environments, the simulation results show that the proposed algorithm has smaller localization errors and more excellent stability than previous ones. Still, it is promising for application scenarios with higher localization accuracy and stability requirements.


Introduction
Wireless sensor networks (WSNs) are a form of network formed by freely organizing and combining tens of thousands of sensor nodes through wireless communication technology. It is a wireless network composed of several static or mobile sensors in a self-organizing and multi-hop way, aimed at exchanging the information processed by cooperative detection of perceived objects in the coverage area of the transmission network to users [1,2]. The wireless sensor has a far-reaching impact on human life and production as it integrates sensors, micro-electro-mechanical systems, and network communication technology [3][4][5]. At present, it has attracted significant attention from academia and industry and has become the focus and highlight of international competition. Localization technology is an essential supporting technology in wireless sensor networks where the estimated location information is crucial. A wide range of applications that require these easy-to-deploy, low-cost sensors

•
The equation formula for calculating the average distance per hop of anchor nodes is improved. The minimum mean square error criterion more excellent to calculate the average distance per hop, and the average distance per hop of anchor nodes is obtained by applying its average value. • DE algorithm has the defects of search stagnation and premature convergence; this improves the mutation formula and introduces random variation. In the crossover operation, the social learning part of the particle swarm optimization algorithm is introduced, and the heuristic information carried by the group optimal value is used to permit the current individual to learn from the group Sensors 2020, 20, 343 3 of 24 optimal individual, which is then intersected with the mutation vector. With the improvement of mutation operation and crossover operation of the basic DE algorithm, the diversity of the population is enhanced as well as information of the optimal individual in the population is effectively used to raise the efficiency of the algorithm.

•
To validate and show the effectiveness of the proposed algorithm, the proposed DEIDV-Hop algorithm is evaluated under four different network environments. In comparison with known algorithms, DV-Hop, PSODV-Hop [32], and GSODV-Hop [33], experimental results show that the proposed DEIDV-Hop algorithm has smaller localization errors and greater stability, yet more suitable for application scenarios with higher localization accuracy and stability requirements.
The remainder of this paper is organized as follows. In Section 2, we summarize the related work, while in Section 3 we introduce the original DV-Hop and DE algorithms. The target algorithm DEIDV-Hop is presented in Section 4, then experimental results and performance evaluation are given in Sections 5 and 6. Finally, the concluding remarks and future work direction of this paper are provided in Section 7.

Related Work
The range-free algorithm has several advantages: it is low cost and has low power consumption and simple hardware. DV-Hop localization algorithm has become an economical yet exceptionally important localization algorithm due to its simple algorithm, high coverage, and good feasibility that converts the estimated distance between nodes into the product of hop-count value and average distance per hop [32][33][34]. Even so, the disadvantage is that the localization accuracy is not good enough; accordingly, improvements in the localization accuracy are the key issues to this research. In this section, we introduce some related work of the DV-Hop localization algorithm.
Chen et al. proposed to estimate the distance of hop-count based on the value of neighbors in the same block [35]; to reduce the localization error, this study used weighted node distance to calculate the final location of nodes. Omar et al. used RSSI values to estimate the distance between the anchor node and the adjacent sensor node in one hop; such an estimated distance is applied to replace the average distance per hop in the original algorithm [31]. As a sensor node is located, it is elevated to act as an additional anchor node for subsequent use in other sensor nodes since the availability of the additional anchor node improves the accuracy of locating the remaining sensor nodes. Zhao et al. proposed a DV-Hop algorithm based on local weighted linear regression [35], where the unknown nodes attempt to estimate their locations by using nearby anchor nodes that maintain the proportional relationship between the geometric distance and the average distance per hop. The kernel method to improve the localization accuracy by increasing the weight of adjacent anchor nodes is applied.
Besides traditional optimization algorithms, many meta-heuristic algorithms to improve the localization algorithm have been considered, as they are competent to increase the accuracy of the original localization algorithm. Peng et al. proposed a genetic-based localization algorithm to improve the localization accuracy and convergence speed, limiting the feasible population region when the initial population was created. Three anchor nodes as the center to construct three squares are applied, in which the shadow area of the intersection of three squares is the overall workable area of the unknown nodes, and the initial population is generated randomly in the functional area. Singh et al. applied an improved algorithm for localization and then used particle swarm optimization to refine the results [36]. Zhao et al. proposed an improved localization algorithm based on hybrid chaotic strategy [10]. Harikrishnan et al. used the differential evolution algorithm to minimize localization error in wireless sensor network [12], while Cui et al. improved the values of hop-count by the values of common single-hop nodes between adjacent nodes and converted the discrete hop-count values into more accurate continuous values [37]. The differential evolution algorithm is introduced to achieve the optimal global solution corresponding to the estimated location of unknown nodes although it induces vast time overhead and energy consumption while improving the localization accuracy.

Distance Vector-Hop (DV-Hop) and Differential Evolution (DE) Algorithms
In this section, the process of the DV-Hop and DE algorithm is briefly introduced.

DV-Hop Algorithm
The three steps of the DV-Hop algorithm are discussed as follows.
Step 1: Flooding In this step, all anchor nodes broadcast data packets with their localizations to their neighbors and hop digital segments are initially set to zero. The structure of the data packet is id, x i , y i , h i , including identifier id, the coordinate of the anchor node i is (x i , y i ), h i the minimum hop-count value from the anchor node i, and the initial value of h i is zero. Once the neighbor node receives a packet with a smaller hop-count value from a particular anchor node, the localization of the anchor node is recorded and adds "1" to the hop-count value before sending it to other neighbor nodes [38][39][40][41]. Packets with high hop-count values are defined as obsolete information to be ignored. As soon as this step is completed, each one of the unknown nodes in the network retrieves the value of the minimum hop-count for each anchor node.
Step 2: Distance Estimation between Nodes In this step, the distance between each node is estimated. First, it calculates the average distance per hop of each anchor node. For the anchor node, it uses Equation (1) to calculate the average distance per hop: where , (x i , y i ) and x j , y j represent the location of anchor nodes i and j, and h i,j represents the minimum hop-count value in anchor nodes i and j.
After calculating HopSize i , each anchor node broadcasts its HopSize i in the system through controlled flooding. Equation (2) is used to determine the estimated distance between the unknown node and the anchor node i.
where h u,i represents the minimum value of hop-count between anchor node i and unknown node u.
Step 3: Estimate the Location of Nodes In step 3, it is required to find out the location of all unknown nodes. For the unknown node u, the multilateration method [38] is used to estimate its location.
Let (x u , y u ) be the location of the unknown node u and (x i , y i ) be the location of the anchor node, where i = 1, 2, · · · , m. Therefore, the distance between unknown nodes u and m anchor nodes is specified by the following equation: Sensors 2020, 20, 343

of 24
Equation (3) can be extended to: The above Equation (4) can be expressed in matrix form as AX = B, where A, X and B are expressed by Equations (5)-(7), respectively.
It utilizes the least square method to solve the equation. The coordinate location of the unknown node u is calculated:

Differential Evolution Algorithm
Differential evolution (DE) algorithm is a new evolutionary computing technology [13], designed to keep the population-based global search strategy of the evolutionary algorithm utilizing real coding, i.e., a simple mutation operation based on difference and one-to-one elimination mechanism to update the population that reduces the complexity of genetic algorithm operation.

Initialization
DE uses NP D-dimensional real-valued parameter vectors as the population of each generation, and the t − th generation is denoted as x t i = x t i,1 , x t i,2 , · · · , x t i,D . Let the boundary of the parameter variable be x j , the initial value of the i − th individual is generated by Equation (9).

Mutation
For each target individual x t i , where i = 1, 2, · · · , NP, its mutant v t+1 i is generated by randomly select individuals that are used as the parent basis vector (rand) and a difference vector is used to generate the mutant individuals: v t+1 Among them, r 1 , r 2 and r 3 represent random numbers and different unequal natural numbers in the range [1,NP]. F ∈ [0, 2], as F represents the scaling factor.
The crossover process is shown in Equation (11).
where r j is the j − th random number between [0, 1]; rnbr_i is the random natural number between [1, D]; CR is the crossover rate, CR ∈ [0, 1].

Selection
DE uses the greedy operation to select between x t i and u t+1 i , and generate the next generation of the individual x t+1 i : where f (·) is the objective function. Given that the optimization problem in this paper is in minimization form, the selection condition is f u t+1 i ≤ f x t i . The overall flow chart of the DE algorithm is shown in Figure 1.

Goal
Given that the distance between the unknown node and the anchor node is an estimated value, the error is significant in the DV-Hop localization algorithm. In the original localization algorithm, it uses the unbiased estimation criterion to calculate the average distance per hop, and the estimation error of the average distance per hop achieved through this method is zero. However, the error complies with the Gaussian distribution. According to the parameter estimation theory, as the cost function of estimating the sub-error, it is more reasonable to use the mean square error than use only the variance or deviation. Therefore, the calculation formula of the average distance per hop is improved in this investigation.

Process of Flooding
Flooding, as a classic routing algorithm, is the simplest and most reliable one. Nevertheless, it excessively occupies network resources and generates a large amount of communication overhead, making routing and link resources inefficient.
The routing algorithms involved in the first and second step of the DV-Hop algorithm in this paper are based on the Flooding, including the original DV-Hop algorithm. To reduce network communication overhead, reduce network energy consumption as well as to extend the network life cycle, the EEDCF routing algorithm [42] is considered and applied.

Process of Calculating the Average Distance per Hop
From the traditional method on the unbiased estimation criterion to calculate the average distance of per-hop HopSize i , let the value of the Equation (13) be zero.
The minimum mean square error criterion is used to calculate the average distance per hop, and calculated by minimizing the Equation (14).
Let ∂ f 2 ∂HopSize i = 0, the estimated average distance per hop based on the minimum mean square error criterion can be obtained as: The average distance per hop is determined through Equation (16): After calculating HopSize , each anchor node broadcasts its average distance per hop HopSize in the system through controlled flooding. When the unknown node u retrieves information from the anchor node i, it uses Equation (17) to determine the distance between the unknown node u and anchor node i.

Improvement of Differential Evolution Algorithm
In the basic differential evolution algorithm, three different individuals are randomly used to carry out mutation, crossover and individual update. This method is relatively simple, however, the update of individuals is unsighted without using the information of the optimal individuals obtained in the algorithm search that reduces the efficiency of the algorithm. Therefore, in the improved algorithm, the social part of PSO is introduced into the basic differential evolution algorithm. By learning from the optimal individual X g = x g1 , x g2 , · · · , x gn in the population, the updated individual can obtain the optimal individual heuristic information and promote the convergence speed of the algorithm.
With the introduction of the heuristic information of the global optimal individual, individuals tend to converge to the global optimal individual with the operation of the algorithm, leading to the convergence of individuals and the decline of population diversity. To improve the global searching ability of the algorithm, the diversity of the population and the global searching ability are increased by improving the mutation and crossover operation, and they are presented next.

Crossover
In the basic differential evolution algorithm, the target individual x t i and the mutant individual v t+1 i are crossed to generate the experimental individual u t+1 i . In the improved algorithm, the social learning part of the particle swarm optimization algorithm is introduced to make the current individual x t i learn from the optimal individual x t best of the group, and the results are crossed with the mutation vector v t+1 i . By using the heuristic information carried by the group optimal value, the optimization efficiency of the algorithm is improved. The cross operation is as follows: where c = 2. x t i,j + rand[0, 1] × c × x t best − x t i,j , and signifies that an individual x t i learns from the optimal individual x t best of the population.

Selection
In the improved differential evolution algorithm, the diversity of the population and the global search ability are increased by carrying out small probability random variation on the variation vector. The operation of mutation is as follows: P r is the probability of random variation. When the random number rand[0, 1] is higher than the random mutation probability P r , the mutation operation mode of the basic difference evolution algorithm is adopted; random mutation is carried out, if otherwise.

Differential Evolution Algorithm Implementation
In this paper, an optimized mathematical model is established by taking into consideration the distance between the unknown node and the anchor node, the location estimation process is simplified to minimize the optimization problem, and next, DE is used to provide a solution for the optimization model. First, the objective function is defined as: Among them, (x u , y u ) is the coordinate of the unknown node, (x i , y i ) is the coordinate of the anchor node, and d u,i is the estimated distance between the unknown node u and the anchor node i.
According to the aim function f (x u , y u ), the fitness function is expressed as:

Complete DEIDV-Hop Algorithm
By combining Sections 3 and 4, this paper proposes an enhanced DV-Hop algorithm based on DE called DEIDV-Hop, with the corresponding pseudo-code depicted in Algorithm 1.
The flow of the algorithm follows with DEIDV-Hop initializing network parameters and generating simulated network topology (random or grid topology) yet utilizing the shortest path method to retrieve the hop-count value between nodes, corresponding to lines 1-13. After that, the information on a hop-count value between nodes is retrieved, and the average distance per hop is calculated by Equation (16). Next, the estimated distance between unknown nodes and anchor nodes is calculated according to line 15. As the third step and corresponding to lines 16-36, the DE algorithm is utilized to estimate the location of unknown nodes by initializing the parameters of DE and have the maximum number of iterations set. It mutates the target individual selection Equation (18) (19) is used for the cross operation to obtain test individuals in lines 23-25. The greedy criterion is used to select the next generation of individuals for the target and experimental individuals in lines 27-31; finally, the optimal individual in the group is the estimated location of the unknown node at the end of the iteration.  Table 1 Experimental area is 100 × 100 m 2 3: Network deployment nodes to generate simulated network topology; 4: Calculate the hop-count value h i, j according to the shortest path algorithm 5: for k = 1 to N 6:

in line 22, and Equation
for i = 1 to N 7: While t < t max do 21: for i = 1 to NP //Mutation and Crossover 22: According to Equation (18), mutation vector v t i is generated; 23: for j = 1 to D 24: Trial vector u t i was obtained by crossover according to Equation (

Experimental Results and Analysis
Experimental analyses are carried out under four different network simulation conditions to show the effectiveness of the proposed algorithm, listed as random topology, grid topology, C-Shaped random topology, and C-Shaped grid topology, as shown in Figure 2 respectively. In random topology, all nodes are randomly deployed in the corresponding experimental area, while in grid topology, each node is deployed at the intersection of gridlines and differentiated according to the proportion of the deployment deviation, in which ratio of 0 means that the nodes are precisely distributed at the gridline intersection. In comparison with random topology, the node distribution of grid topology is uniform.
where ( ) is the estimated location and actual location of the unknown node u . ALE is the average localization error, N the total number of nodes, n is the number of unknown nodes. In Equation (23), the numerator represents the Euclidean distance between the estimated location and the actual location of the unknown node, and the estimated error distance. This article includes R in the denominator, thus, Equation (23) with R is called the normalized average localization error.
Thus, n is given as: Experiments verify its influence on the average localization error in three aspects: the communication radius of nodes, the percentage of anchor nodes, and the total number of nodes. The parameters used in the DEIDV-Hop experiment are shown in Table 1, while the parameter settings for PSODV-Hop [43] and GSODV-Hop [44] are identical to original references and shown in Tables  2 and 3,    When designing the C-shaped area, we considered excavating a part of the square area during the simulation. The cut-out area is 30 × 70 m 2 (the original area was 100 × 100 m 2 ).
In this investigation, only the two-dimensional coordinate plane is considered. All experimental results are averaged by running 100 times independently, and the size of the experimental area is 100 × 100 m 2 .
The localization error of unknown nodes u is: Sensors 2020, 20, 343 13 of 24 The average localization error (ALE) is taken as the evaluation criterion, and calculated as: where x est u , y est u and x act u , y act u is the estimated location and actual location of the unknown node u. ALE is the average localization error, N the total number of nodes, n is the number of unknown nodes.
In Equation (23), the numerator represents the Euclidean distance between the estimated location and the actual location of the unknown node, and the estimated error distance. This article includes R in the denominator, thus, Equation (23) with R is called the normalized average localization error.
Thus, n is given as: Experiments verify its influence on the average localization error in three aspects: the communication radius of nodes, the percentage of anchor nodes, and the total number of nodes. The parameters used in the DEIDV-Hop experiment are shown in Table 1, while the parameter settings for PSODV-Hop [43] and GSODV-Hop [44] are identical to original references and shown in Tables 2 and 3, respectively.  Table 3. Parameter settings of GSODV-Hop.
Parameter Value The error graphs of nodes in four topologies, namely square random topology, square grid topology, C-Shaped random topology, and C-Shaped grid topology are listed in Figure 2. As settings for the investigation, the communication radius R of the node is 20 m, the total number of deployment nodes is 100, and the percentage of anchor nodes is 20%.
As shown in Figure 2, when the node deployment area changes from square topology to C-shaped topology, the average localization error of the node rises sharply. On the other hand, from the perspective of node distribution, random topology and grid topology can be considered a sparse network and intensive network. It can be observed that the nodes of the grid topology are evenly distributed if compared with the random topology; the error of nodes is smaller as well. As the node deployment changes from the random topology to the grid topology, the average localization error of the nodes decreases. The main reason is due to the influence of the deployment area, where the node distribution is not uniform and the hop-count value between nodes is no longer accurate.

Effect of Deployment Deviation Ratio λ in a Grid Topology
In this section, we study the effect of different deployment deviation factors on ALE for two grid topologies. When grid topology nodes are deployed, different values λ can be selected, λ ∈ [0, 1]. As settings for the investigation environment, the total number of deployment nodes is 100, the percentage of anchor nodes is 20%, and the communication radius is 20 m. As discussed above, a smaller grid deployment deviation factor will have a better effect in the case of node deployment in a grid topology.
As shown in Figure 3, with the increase of λ, the ALE of DEIDV-Hop in two grid topologies also increases, though different λ values have a tiny influence on ALE results. When λ = 0, the grid topology ALE is the smallest and the localization effect is the best. However, in practical production and living applications, it is challenging to deploy nodes with precision at fixed points, and often at random. In this investigation, λ = 0.4 is adopted as a condition in the distribution of real network simulations, although other values such as 0.3 and 0.5 are also suitable.
network and intensive network. It can be observed that the nodes of the grid topology are evenly distributed if compared with the random topology; the error of nodes is smaller as well. As the node deployment changes from the random topology to the grid topology, the average localization error of the nodes decreases. The main reason is due to the influence of the deployment area, where the node distribution is not uniform and the hop-count value between nodes is no longer accurate.

Effect of Deployment Deviation Ratio λ in a Grid Topology
In this section, we study the effect of different deployment deviation factors on ALE for two grid topologies. When grid topology nodes are deployed, different values λ can be selected, [0,1] λ ∈ .
As settings for the investigation environment, the total number of deployment nodes is 100, the percentage of anchor nodes is 20%, and the communication radius is 20 m. As discussed above, a smaller grid deployment deviation factor will have a better effect in the case of node deployment in a grid topology. As shown in Figure 3, with the increase of λ , the ALE of DEIDV-Hop in two grid topologies also increases, though different λ values have a tiny influence on ALE results. When 0 λ = , the grid topology ALE is the smallest and the localization effect is the best. However, in practical production and living applications, it is challenging to deploy nodes with precision at fixed points, and often at random. In this investigation,

Effect of Communication Radius on Average Localization Error (ALE)
In this section, as settings for the investigation, the communication radius R of the node varies from 20 m to 40 m, the total number of deployment nodes is 100, and the percentage of anchor nodes is 20%. Experimental results are shown in Figures 4 and 5.

Effect of Communication Radius on Average Localization Error (ALE)
In this section, as settings for the investigation, the communication radius R of the node varies from 20 m to 40 m, the total number of deployment nodes is 100, and the percentage of anchor nodes is 20%. Experimental results are shown in Figures 4 and 5. distributed if compared with the random topology; the error of nodes is smaller as well. As the node deployment changes from the random topology to the grid topology, the average localization error of the nodes decreases. The main reason is due to the influence of the deployment area, where the node distribution is not uniform and the hop-count value between nodes is no longer accurate.

Effect of Deployment Deviation Ratio λ in a Grid Topology
In this section, we study the effect of different deployment deviation factors on ALE for two grid topologies. When grid topology nodes are deployed, different values λ can be selected, [0,1] λ ∈ .
As settings for the investigation environment, the total number of deployment nodes is 100, the percentage of anchor nodes is 20%, and the communication radius is 20 m. As discussed above, a smaller grid deployment deviation factor will have a better effect in the case of node deployment in a grid topology. As shown in Figure 3, with the increase of λ , the ALE of DEIDV-Hop in two grid topologies also increases, though different λ values have a tiny influence on ALE results. When 0 λ = , the grid topology ALE is the smallest and the localization effect is the best. However, in practical production and living applications, it is challenging to deploy nodes with precision at fixed points, and often at random. In this investigation,

Effect of Communication Radius on Average Localization Error (ALE)
In this section, as settings for the investigation, the communication radius R of the node varies from 20 m to 40 m, the total number of deployment nodes is 100, and the percentage of anchor nodes is 20%. Experimental results are shown in Figures 4 and 5.    From Figure 4, it can be seen that, under the four network topologies, the average ALE on four localization algorithms gradually decreases with the increase of the communication radius of the nodes. Among these four algorithms, DEIDV-Hop always has the smallest ALE. As shown in Figure 5: With the increase of communication radius, the communication range of unknown nodes becomes significant; there will have more single-hop nodes that can establish direct contact with more adjacent nodes. Also, it reduces the hop-count value between some of the unknown nodes and anchor nodes. The average distance per hop estimated by the algorithm and the hop-count value between nodes also tends to be accurate. Therefore, the estimated distance between the unknown node and the anchor node is also more accurate, and a more accurate estimation of the location of the unknown nodes is obtained. The Euclidean distance between the estimated and actual location of the unknown    From Figure 4, it can be seen that, under the four network topologies, the average ALE on four localization algorithms gradually decreases with the increase of the communication radius of the nodes. Among these four algorithms, DEIDV-Hop always has the smallest ALE. As shown in Figure 5: With the increase of communication radius, the communication range of unknown nodes becomes significant; there will have more single-hop nodes that can establish direct contact with more adjacent nodes. Also, it reduces the hop-count value between some of the unknown nodes and anchor nodes. The average distance per hop estimated by the algorithm and the hop-count value between nodes also tends to be accurate. Therefore, the estimated distance between the unknown node and the anchor node is also more accurate, and a more accurate estimation of the location of the unknown nodes is obtained. The Euclidean distance between the estimated and actual location of the unknown From Figure 4, it can be seen that, under the four network topologies, the average ALE on four localization algorithms gradually decreases with the increase of the communication radius of the nodes. Among these four algorithms, DEIDV-Hop always has the smallest ALE. As shown in Figure 5: With the increase of communication radius, the communication range of unknown nodes becomes significant; there will have more single-hop nodes that can establish direct contact with more adjacent nodes. Also, it reduces the hop-count value between some of the unknown nodes and anchor nodes. The average distance per hop estimated by the algorithm and the hop-count value between nodes also tends to be accurate. Therefore, the estimated distance between the unknown node and the anchor node is also more accurate, and a more accurate estimation of the location of the unknown nodes is obtained. The Euclidean distance between the estimated and actual location of the unknown node decreases, that is, the numerator of the ALE formula decreases, and the denominator R increases, which will inevitably bring about a decrease in the value of the entire formula.
In comparison with the random topology, the four algorithms under the grid topology have a significantly smaller average of ALE under the same conditions, which is caused by the denser distribution of network nodes. Due to the poor connectivity of nodes in sparse networks, some of the isolated nodes may be challenging to locate. The uneven distribution of nodes increases the hop-count value of unknown nodes from anchor nodes, and the estimated distance error also increases. The distribution of hop-count values between dense network nodes is relatively uniform, and the network connectivity between nodes is functional; thus, the average of ALE will be smaller.

Effect of the Percentage of Anchor Nodes on ALE
In this section, as settings for the investigation, the percentage of anchor nodes gradually changes from 10% to 40%, with the number of deployment nodes 100 and communication radius of nodes 20 m. Experimental results are shown in Figures 6 and 7.
Sensors 2020, 20, x 16 of 23 node decreases, that is, the numerator of the ALE formula decreases, and the denominator R increases, which will inevitably bring about a decrease in the value of the entire formula.
In comparison with the random topology, the four algorithms under the grid topology have a significantly smaller average of ALE under the same conditions, which is caused by the denser distribution of network nodes. Due to the poor connectivity of nodes in sparse networks, some of the isolated nodes may be challenging to locate. The uneven distribution of nodes increases the hopcount value of unknown nodes from anchor nodes, and the estimated distance error also increases. The distribution of hop-count values between dense network nodes is relatively uniform, and the network connectivity between nodes is functional; thus, the average of ALE will be smaller.

Effect of the Percentage of Anchor Nodes on ALE
In this section, as settings for the investigation, the percentage of anchor nodes gradually changes from 10% to 40%, with the number of deployment nodes 100 and communication radius of nodes 20 m. Experimental results are shown in Figures 6 and 7.  As shown in Figure 6, the ALE of four algorithms decreases with the increasing anchor node ratio, and DEIDV-Hop always has the smallest ALE. As shown in Figure  With the increasing ratio of anchor nodes, there are more anchor nodes in the deployment area; accordingly the accuracy of the average distance per hop of anchor nodes is higher. DV-Hop is a calculation method based on the estimated distance, and the localization error decreases proportionally with the decrease of the estimated distance error. The increasing value of anchor nodes provides more favorable conditions for meta-heuristic localization algorithms and support to find the optimal solution. As a result, the average ALE is reduced because the location of nodes is accurately estimated.

Effect of Node Density on ALE
In this section, the percentage of anchor nodes is 20% and the number of square topology deployment nodes is 100 to 400. Besides, the number of deployment nodes in the C-shaped deployment area is 100-406, and the communication radius 20 m. Experimental results are shown in Figures 8 and 9. As shown in Figure 6, the ALE of four algorithms decreases with the increasing anchor node ratio, and DEIDV-Hop always has the smallest ALE. As shown in Figure 7 and in comparison with DV-Hop: With the increasing ratio of anchor nodes, there are more anchor nodes in the deployment area; accordingly the accuracy of the average distance per hop of anchor nodes is higher. DV-Hop is a calculation method based on the estimated distance, and the localization error decreases proportionally with the decrease of the estimated distance error. The increasing value of anchor nodes provides more favorable conditions for meta-heuristic localization algorithms and support to find the optimal solution. As a result, the average ALE is reduced because the location of nodes is accurately estimated.

Effect of Node Density on ALE
In this section, the percentage of anchor nodes is 20% and the number of square topology deployment nodes is 100 to 400. Besides, the number of deployment nodes in the C-shaped deployment area is 100-406, and the communication radius 20 m. Experimental results are shown in Figures 8 and 9.

Effect of Node Density on ALE
In this section, the percentage of anchor nodes is 20% and the number of square topology deployment nodes is 100 to 400. Besides, the number of deployment nodes in the C-shaped deployment area is 100-406, and the communication radius 20 m. Experimental results are shown in Figures 8 and 9.  As seen in Figure 8, as the percentage of anchor nodes increases, the ALE of the four algorithms decreases, and DEIDV-Hop always has the smallest ALE amongst the four network topologies. Using a comparison in Figure 9 with DV-Hop, With the increase in the number of deployed nodes, the distribution of nodes becomes denser and tends to be in intensive networks. As each node has more single-hop connected nodes, the network connectivity is stronger. The deviation of the shortest path and straight line between nodes  As seen in Figure 8, as the percentage of anchor nodes increases, the ALE of the four algorithms decreases, and DEIDV-Hop always has the smallest ALE amongst the four network topologies. Using a comparison in Figure 9 with DV-Hop, With the increase in the number of deployed nodes, the distribution of nodes becomes denser and tends to be in intensive networks. As each node has more single-hop connected nodes, the network connectivity is stronger. The deviation of the shortest path and straight line between nodes is relatively small, as is also the estimated distance error between the unknown nodes and anchor As seen in Figure 8, as the percentage of anchor nodes increases, the ALE of the four algorithms decreases, and DEIDV-Hop always has the smallest ALE amongst the four network topologies. Using a comparison in Figure 9 with DV-Hop, • Three meta-heuristic localization algorithms PSODV-Hop, GSODV-Hop, and DEIDV-Hop improve average 46.49%, 47.39%, and 50.33%, respectively, on localization accuracy in the C-shaped grid topology.
With the increase in the number of deployed nodes, the distribution of nodes becomes denser and tends to be in intensive networks. As each node has more single-hop connected nodes, the network connectivity is stronger. The deviation of the shortest path and straight line between nodes is relatively small, as is also the estimated distance error between the unknown nodes and anchor nodes. As an overall evaluation, with the increase in the number of deployed nodes, the average localization error of nodes also decreases, becoming more effective and productive.

Convergence Speed of the Algorithm and the Localization Error of Unknown Nodes
Experimental analysis was performed under four different network simulation conditions to prove the effectiveness of the convergence speed of the proposed algorithm and the localization error of each unknown node. The four network topologies are square random topology, square grid topology, C-shaped random topology, and C-shaped grid topology. Experimental results are shown in Figures 10 and 11. The size of the experimental area is 100 × 100 m 2 .

Convergence Speed of the Algorithm and the Localization Error of Unknown Nodes
Experimental analysis was performed under four different network simulation conditions to prove the effectiveness of the convergence speed of the proposed algorithm and the localization error of each unknown node. The four network topologies are square random topology, square grid topology, C-shaped random topology, and C-shaped grid topology. Experimental results are shown in Figures 10 and 11. The size of the experimental area is 100 × 100 m 2 .

Convergence Speed of the Algorithm
In this section, the percentage of anchor nodes is 20% and the number of deployment nodes is 100. The communication radius is 20 m. The number of iterations of the algorithm is 1-200. All experimental results are averaged by executing 100 times independently. Experimental results are shown in Figure 10. According to the results of Figure 10, three meta-heuristic algorithms have faster convergence speeds yet better effects in the square topology. It can be clearly seen that the convergence speed of the three meta-heuristic algorithms is relatively fast; notably, the algorithm DEIDV-Hop proposed in this paper has a fast convergence speed and small localization error.
In the C-shaped topology, it is easy to see that the DV-Hop algorithm is very unstable. Because of changes in the deployment environment, there will be some isolated single-hop nodes, so the localization effect of the algorithm is very unstable. Looking at the curve in the Figure 10, the localization error values of the PSODV-Hop algorithm and GSODV-Hop algorithm continue to fluctuate with the increase of the number of iterations; in contrast, the DEIDV-Hop algorithm tends to have a stable value, which demonstrates the robustness of the algorithm.
The relationship between the number of iterations of the simulation algorithm and ALE in four topological environments proves that the DEIDV-Hop algorithm has fast convergence speed,

The Localization Error of Unknown Nodes
In this section, the percentage of anchor nodes is 20% and the number of nodes is 100. The communication radius is 20 m. Experimental results are shown in Figure 11. In this section, 1 ALE ≥ is considered as an isolated node, and it is considered as a node that cannot be located. As in Figure 11, boxplots are applied to show the following ALE results: minimum/maximum of the localization error, the median, and the 25th and 75th percentiles of the independent simulations of each unknown node in the algorithms of four network topologies. The DEIDV-Hop algorithm is relatively stable, and the localization error is lower than the original algorithms DV-Hop algorithm, PSODV-Hop algorithm, and GSODV-Hop algorithm,

•
In the square random topology, there are four nodes in the DV-Hop algorithm that cannot be located, and 33 nodes are higher than the average of the localization error. In the PSODV-Hop algorithm, one node cannot be located, and the localization error of 44 nodes is higher than the average. In the GSODV-Hop algorithm, two nodes cannot be located, and the localization error of 38 nodes is higher than the average. In the DEIDV-Hop algorithm, one node cannot be located, and 28 nodes are higher than the average.

•
In the square grid topology, among the four algorithms, no unknown node cannot be located. In the DV-Hop algorithm, the localization error of 41 nodes is higher than the average of the localization errors. The localization error of 36 unknown nodes in the PSODV-Hop algorithm is higher than the average. In the GSODV-Hop algorithm, the localization error of 36 nodes is higher than the average. In the DEIDV-Hop algorithm, the localization error of 36 nodes is higher than the average.

•
In the C-shaped random topology, there are 46 nodes in the DV-Hop algorithm that cannot be located, and the localization error of 37 nodes is higher than the mean of the localization error.
In the PSODV-Hop algorithm, there are 25 nodes cannot be located, and the localization error of 29 nodes is higher than the average. In the GSODV-Hop algorithm, 25 nodes cannot be located, and the localization error of 26 nodes is higher than the average. In the DEIDV-Hop algorithm, 14 nodes cannot be located, and the localization error of 36 nodes is higher than the average.

Convergence Speed of the Algorithm
In this section, the percentage of anchor nodes is 20% and the number of deployment nodes is 100. The communication radius is 20 m. The number of iterations of the algorithm is 1-200. All experimental results are averaged by executing 100 times independently. Experimental results are shown in Figure 10.
According to the results of Figure 10, three meta-heuristic algorithms have faster convergence speeds yet better effects in the square topology. It can be clearly seen that the convergence speed of the three meta-heuristic algorithms is relatively fast; notably, the algorithm DEIDV-Hop proposed in this paper has a fast convergence speed and small localization error.
In the C-shaped topology, it is easy to see that the DV-Hop algorithm is very unstable. Because of changes in the deployment environment, there will be some isolated single-hop nodes, so the localization effect of the algorithm is very unstable. Looking at the curve in the Figure 10, the localization error values of the PSODV-Hop algorithm and GSODV-Hop algorithm continue to fluctuate with the increase of the number of iterations; in contrast, the DEIDV-Hop algorithm tends to have a stable value, which demonstrates the robustness of the algorithm.
The relationship between the number of iterations of the simulation algorithm and ALE in four topological environments proves that the DEIDV-Hop algorithm has fast convergence speed, robustness, and stability.

The Localization Error of Unknown Nodes
In this section, the percentage of anchor nodes is 20% and the number of nodes is 100. The communication radius is 20 m. Experimental results are shown in Figure 11. In this section, ALE ≥ 1 is considered as an isolated node, and it is considered as a node that cannot be located.
As in Figure 11, boxplots are applied to show the following ALE results: minimum/maximum of the localization error, the median, and the 25th and 75th percentiles of the independent simulations of each unknown node in the algorithms of four network topologies. The DEIDV-Hop algorithm is relatively stable, and the localization error is lower than the original algorithms DV-Hop algorithm, PSODV-Hop algorithm, and GSODV-Hop algorithm,

•
In the square random topology, there are four nodes in the DV-Hop algorithm that cannot be located, and 33 nodes are higher than the average of the localization error. In the PSODV-Hop algorithm, one node cannot be located, and the localization error of 44 nodes is higher than the average. In the GSODV-Hop algorithm, two nodes cannot be located, and the localization error of 38 nodes is higher than the average. In the DEIDV-Hop algorithm, one node cannot be located, and 28 nodes are higher than the average.

•
In the square grid topology, among the four algorithms, no unknown node cannot be located.
In the DV-Hop algorithm, the localization error of 41 nodes is higher than the average of the localization errors. The localization error of 36 unknown nodes in the PSODV-Hop algorithm is higher than the average. In the GSODV-Hop algorithm, the localization error of 36 nodes is higher than the average. In the DEIDV-Hop algorithm, the localization error of 36 nodes is higher than the average.

•
In the C-shaped random topology, there are 46 nodes in the DV-Hop algorithm that cannot be located, and the localization error of 37 nodes is higher than the mean of the localization error.
In the PSODV-Hop algorithm, there are 25 nodes cannot be located, and the localization error of 29 nodes is higher than the average. In the GSODV-Hop algorithm, 25 nodes cannot be located, and the localization error of 26 nodes is higher than the average. In the DEIDV-Hop algorithm, 14 nodes cannot be located, and the localization error of 36 nodes is higher than the average.

•
In the C-shaped grid topology, there are 38 nodes in the DV-Hop algorithm that cannot be located, and the localization error of 34 nodes is higher than the mean of the localization error, where 26 nodes cannot be located and the localization error of 31 nodes is higher than the average in the PSODV-Hop algorithm. In the GSODV-Hop algorithm, 20 nodes cannot be located, and the localization error of 31 nodes is higher than the average. In the DEIDV-Hop algorithm, 18 nodes cannot be located, and the localization error of 30 nodes is higher than the average.
When the number of deployed nodes and the communication radius are the same, the four network topologies of the nodes will affect the distribution of the nodes. The grid topology will make the distribution of the nodes more uniform, denser, and tend to be intensive networks. In this way, each node has more single-hop connection nodes, and the hop-count value between nodes will become smaller and more regular. Thus, network connectivity is stronger. In random topology, the random distribution of nodes makes the hop-count value between nodes irregular, the connectivity between nodes deteriorates, and it tends to lead to sparse networks. There will be some isolated nodes that cannot be located, which increases the average localization error of nodes.

Conclusions and Future Work
In this paper, an enhanced algorithm for sensor node localization based on improved DV-Hop and DE Algorithms for WSNs is proposed, namely DEIDV-Hop. From evaluations and analysis, it is observed that the average distance per hop of anchor nodes is improved, confirming its advantages and efficacy.
In the localization estimation phase, the DE algorithm is introduced to locate unknown nodes, further reducing the localization error. To solve the problems of early maturity, low convergence, and low efficiency, the individual variation and cross operation formulas are improved. In the mutation operation, an attempt to increase the diversity of the population and the global search ability, the mutation vector is randomly mutated. Moreover, the social learning part of PSO is introduced in the crossover operation, and the optimization efficiency of PSO is improved by using the heuristic information carried by the optimal group value. Simulation results of the four network topology environments show that the average localization error of nodes can be effectively reduced by the DEIDV-Hop algorithm. Without the need for additional hardware, it shows excellent advantages and is effective. The simulation results show that the DEIDV-Hop algorithm has the fastest convergence speed and is the most stable. So far, a two-dimensional node location is the constraint to discussions in Sensors 2020, 20, 343 22 of 24 this investigation. The way of applying the algorithm to conduct node location in a more sophisticated space-three-dimensional node location is a direction to consider in terms of future research. In addition, based on the existing research, how to accurately apply the improved routing algorithm to the DV-Hop algorithm and make appropriate improvements to the routing algorithm to reduce the communication overhead of wireless threaded sensor networks and extend the life cycle of wireless sensor networks should be considered.

Conflicts of Interest:
The authors declare no conflict of interest.