for Wireless

— DV-Hop localization algorithm is a typical representative of range-free algorithms, which can be applied to large-scale wireless sensor network location monitoring with random distribution of nodes, such as geological hazard monitoring, water pollution monitoring, forest fire monitoring and more. In order to get a higher positioning accuracy, a new method is used to determine the average hop distance of anchor nodes firstly. Secondly, the estimated distances between nodes are calculated by using the correction value corresponding to the average hop distance; finally, in the positioning stage, when the number of anchor nodes is small, the Min-Max (Minimum-Maximum) method is used to obtain the estimated coordinates; on the contrary, the ML (Maximum Likelihood) method is used to calculate the estimated coordinates. One is to reduce the amount of calculation; the other is to keep the accuracy stable. Finally, the Quasi-Newton method is used to iteratively optimize the coordinates of unknown nodes. The results indicate that the accuracy of algorithm is about 15%- 20% higher than that of the original DV-Hop algorithm.


Introduction
WSNs (Wireless sensor networks) are widely used in various fields because of its convenient data collection and transmission, and simple networking. However, in any field, all kinds of information associated with data are indispensable, and location information is the most important of this information [1]. Therefore, location technology is a hot and difficult point in the research of wireless sensor networks, and it is the basis of acquiring various monitoring objects information [2].
In practice, localization algorithms can be divided into Range-Based algorithm and Range-free algorithm [3]. The latter can only be implemented according to the connectivity, such as convex programming algorithm [4], centroid algorithm [5], APIT algorithm [6], DV-Hop algorithm and more [7]. Range-based localization algorithm requires high hardware equipment and multiple measurements to obtain reasonable positioning accuracy, so the computation and communication costs are very high. Compared with the ranging-free algorithm, the location method is simple, does not need additional hardware equipment, and has less communication overhead. Therefore, this location method has attracted more and more attention. Among them, DV-Hop has many advantages in rang-free algorithm and is widely used in large WSN [8].
DV-Hop is a range-free algorithm that does not require additional hardware to locate only according to network connectivity. It is a coarse-grained estimation and localization algorithm. At present, experts and scholars at home and abroad have tried to improve the DV-Hop algorithm, and a lot of research work has been done. The localization accuracy is much higher than that of traditional algorithm. Liu Yan-hong and Liu Bing-ri of Jilin University proposed to replace the one-hop distance of anchor node in DV-Hop algorithm with RSSI ranging technology and to use hyperbola method instead of trilateral measurement to achieve positioning [9]. To a certain extent, the positioning accuracy has been greatly improved. Su Kai and Cao Yuan of Nanjing University put forward a hybrid location system based on UWB and DGPS [10]. Lin Jin-chao of Chongqing University of Posts and Telecommunications uses Taylor series method to iteratively refine the coordinates of unknown nodes by calculating the initial values of the location results obtained by least square method [11]. The above improvements only improve the DV-Hop algorithm step by step without considering its location accuracy. This paper mainly improves the DV-Hop algorithm from two aspects and simulates the comprehensive improvement. Compared with the original algorithm, the positioning accuracy and stability of the proposed algorithm are greatly improved.

DV-Hop Algorithm Description
The positioning process is as follows: Step 1: Distance vector switching protocol: According to the distance vector routing switching protocol, anchor nodes send packets to all other nodes in the network.
Step 2: Calculate the average hop and the distance: After obtaining the coordinates and hops of other anchor nodes, the average hop distance of each anchor node is calculated by formula 1. Through the second flooding method, all the obtained anchor node information and the average hop distance are sent to the network. In order to ensure that the unknown node receives the average hop distance of the nearest anchor node, only the first received average hop distance is saved.
and is the coordinate between . is the minimum hop( ). When the average hop distance of anchor node is obtained from formula 1, the estimated distance can be obtained by average hop distance and hop count [12].
Step 3 Positioning stage: The estimated distance between anchor node and unknown node is obtained by the second stage, so it can be solved by node coordinate estimation algorithm.

Improved Algorithm-CNDV-Hop (Corrected Quasi Newton DV-Hop)
In this paper, CNDV-Hop algorithm is simulated from the following two aspects and the positioning accuracy are greatly improved.

Improved average hopping distances
The traditional algorithm makes the unbiased estimation criterion calculate the average distance per hop. However, in random distributed wireless sensor networks, the estimation error of average hop distance is Gaussian distribution, and it is reasonable to use mean square error to estimate the average hop distance [13]. Therefore, the minimum mean square error criterion is used to calculate the distance instead of the unbiased estimation criterion. Namely, Let , the average hop distance of anchor node can be re-represented as: ( The average hop distance can be recalculated by formula 1，the minimum hop number between and are three hops; between are three hops, and between are six hops. The average hop distance are: In the second phase, the unknown node regards the first anchor node's average hop distance as its own. Considering the hop distance information of multiple anchor nodes, the positioning accuracy can be improved [14]. The number of anchor nodes that can communicate with unknown nodes is k, and the average hop correction for k anchor nodes is: Combined with formula (4), the improved average hop distance is as follows: In the formula, the improved average hop distance will be closer to the actual average hop distance of the whole network if the anchor node participates in the modification and improvement of calculating the average hop distance.
From the above conclusions and combined with Figure 1, the average hop distance of the improved anchor nodes are: , Therefore, to the anchor nodes are estimated to be: , and .

Improvement of positioning calculation
Performance comparison between ML algorithm and Min-Max algorithm: Traditional position calculation methods mostly use trilateral location method or ML algorithm to obtain coordinates [12]. Trilateral location method is simple in calculation and low in positioning accuracy. Maximum likelihood estimation method relies on ranging error, which requires a large number of floating-point operations and a large amount of computation. The biggest advantage of Min-Max algorithm is that it can obtain better positioning results without a lot of calculation, but the accuracy is not high when the number of anchor nodes is large. Based on this conclusion, the paper proposes that when the number of anchor nodes is small, the minimummaximum method is used to obtain the estimated coordinates, and when the number of anchor nodes is high, the maximum likelihood method is used to obtain the coordinates. Finally, the quasi Newton method is used to iteratively optimize the estimated coordinates.
In order to verify the positioning accuracy of anchor node by using maximum size (Min-Max) and maximum likelihood estimation (ML), this two kinds of positioning algorithms are simulated and analyzed in this paper. The simulation area is set to 200 * 200, simulation 100 times to take the mean.
Assuming that the communication radius is 40m, 20 random nodes are randomly deployed in the 200 * 200 meter area. In Figure 2 and Figure 3, 15 and 6 anchor nodes are respectively deployed. The simulation uses Min-Max method and ML method to solve unknown nodes. It can be seen from these two figures that ML positioning method has higher accuracy when there are more anchor nodes, and the highest accuracy is about 20 meters higher than Min-Max method. Min-Max positioning accuracy is higher than ML method when there are fewer anchor nodes, and the highest accuracy is about 50 meters. It can be seen that in the case of low proportion of anchor nodes, low computational complexity and low computational load, Min-Max method is usually used, which not only reduces the communication cost, but also reduces energy consumption. When the proportion of anchor nodes is high, ML method should be used to improve the positioning accuracy. Therefore, when solving unknown node coordinates, it is necessary to select the appropriate algorithm according to the network deployment.  In order to further determine the relationship between the ratio of anchor node and the accuracy of the two algorithms, the normalized average positioning error of the two algorithms is simulated in Figure 4 when the number of anchor nodes is increased from 3 to 11. It can be seen from the figure that ML algorithm more dependent on the    As shown in Table 1, the better the performance of Min-Max-DV-Hop algorithm is, the lower the proportion of anchor nodes is, the higher proportion of anchor nodes is, and the better performance of ML-DV-Hop algorithm is. The network area is 200*200m, and the critical proportion of anchor nodes is 30% when the total number of nodes is 20.

ML-DV-Hop Min-Max-DV-Hop ML-DV-Hop Min-Max-DV-
Iterative refinement based on Quasi Newton method: The distance between the anchor node and the unknown node is found. Assuming that the unknown node in K anchor nodes participates in the localization, the equation set shown in (6) can be used.
When the distance between the anchor node and the unknown node is found, if there are k anchor nodes in which the unknown node p participates in, the equation (6) can be used.  The equation (6) is transformed into a nonlinear optimization problem, namely: Among them, the coordinates of anchor node are ; is the distance between unknown node and anchor node. For the optimization problem, it needs to obtain the optimal solution of the objective function . In this algorithm, in order to make the positioning accuracy higher and solve the objective function quickly, the estimated coordinate is set as the initial point approximation of the Quasi-Newton algorithm firstly, and is regarded as the convergence criterion of the algorithm. A new approximation point is obtained and the gradient fall of is guaranteed until the optimal solution is obtained by finite iteration [12].

Simulation environment and evaluation indicators
In this paper, the improved positioning algorithm is simulated by using MATLAB simulation platform, and compared with the classical improved DV-Hop algorithm in recent two years. Reference [15] is recorded as ORDV-Hop. The performance of the algorithm can be fully demonstrated by simulating and analyzing the simulation environment, topology and node characteristics of wireless sensor networks. The network topology is set as follows: 100 nodes are randomly generated in the network, and the network parameters such as the sum-up points, anchor nodes and communication radius are the same in each simulation.
CNDV-Hop algorithm is evaluated by calculating the average location error, the normalized average location error, the root mean square error by equations ， and Figure 5 is the topological structure of wireless sensor networks, which is set as 200 * 200, and the area is distributed with 100 nodes randomly. Figures 6 and Figure  7 simulate the deviation between the actual and estimated positions of the unknown nodes in DV-Hop and CNDV-Hop algorithms respectively. From these two figures, it can be seen that the localization accuracy of CNDV-Hop algorithm is significantly higher than DV-Hop algorithm.  In Figure 8, it sets the ratio of anchor nodes is 30%. When R (communication radius) is 30 meters, the influence of the anchor node on the positioning results is simulated in different proportions. It can be calculated from the simulation that the normalization error of DV-Hop algorithm is 0.5164; the ORDV-Hop algorithm is about 0.4147 and the CNDV-Hop algorithm is 0.3829. In Figure 9, when R is 40 meters. The normalization error of DV-Hop algorithm is about 0.2958, and the ORV-Hop algorithm is about 0.2530. However, CNDV-Hop algorithm proposed in the paper is only 0.1753. In Figure 10, the proportion of anchor nodes is 30%. The simulation results show that the normalized root mean square error of CNDV-Hop algorithm is the lowest. When the communication radius is 40, the normalized root mean square error of DV-Hop algorithm is 0.3221, while the normalized root mean square error of CNDV-Hop algorithm is only 0.1765.

Conclusion
In this paper, a WSN localization algorithm based on DV-Hop is proposed, and the average hop distance and location calculation are corrected respectively. The improved average hop distance makes full use of the optimized anchor node information and has higher positioning accuracy than single anchor node. In the location calculation method, the improvements of the algorithm mainly include initial value estimation and final estimation of node coordinates. In the initial estimation, when there are fewer anchor nodes, Min-Max algorithm is used to solve the problem, and ML algorithm is used to solve the problem when there are more anchor nodes. At this time, through simulation, the localization algorithm of the proportion of anchor nodes in different situations is given. In the final estimation, the Quasi-Newton algorithm is used to iteratively optimize the initial value. Experiments show that the algorithm is a simple and efficient ranging-free positioning algorithm for wireless sensor networks.