Node Localization Algorithm Based on Modified Archimedes Optimization Algorithm in Wireless Sensor Networks

Node localization information plays an important role in wireless sensor networks (WSNs). To solve the problem of low localization accuracy of distance vector hop (DV-Hop) localization algorithm in wireless sensor networks, an improved localization algorithm called MAOADV-Hop based on the modified Archimedes optimization algorithm (MAOA) and DVHop is proposed, which can achieve the balance between the localization speed and the localization precision. Firstly, tent chaotic mapping and particle swarm optimization (PSO) algorithm are introduced into Archimedes optimization algorithm to improve the initial population diversity and change the update rules of density and volume, which improve the global convergence ability and convergence speed of the algorithm. Secondly, the MAOA is used to replace the least square part of the DV-Hop localization algorithm to improve the localization accuracy of the algorithm. Finally, MAOADV-Hop is verified through four different network environments and compared with DE_DV-Hop, BOA_DV-Hop, and DV-Hop. The simulation results show that the localization speed of the proposed approach is faster than that of DE_DV-Hop and BOA_DV-Hop, and the localization error is less than that of DV-Hop, DE_DV-Hop, and BOA_DV-Hop.


Introduction
Wireless sensor networks (WSNs) consist of a number of static or mobile sensors in self-organizing and multihop manner, aimed at sending the information detected and processed by the sensor nodes in the coverage area of the network to the users [1,2]. WSNs integrates MEMS, sensor technology with network communication technology [3] and is widely used in agriculture [4], military [5], environmental protection [6], intelligent transportation [7,8], and other fields. It has been the focus and highlight of international competition because of the focuses of Industry and Academia [9,10].
Because the location information of nodes plays an important role in the working process of WSNs [11], localization is an indispensable basic technology [12]. Although the current GPS localization system can accurately locate the target, it is difficult to use satellite positioning informa-tion for accurately locating the target in some special places [13,14]. Therefore, it is very meaningful and challenging work to study the accurate localization algorithm for WSNs.
The rest of this paper is organized as follows: In Section 2, we describe the localization algorithms in WSNs and the main contributions of our work. In Section 3, we improve the Archimedes optimization algorithm (AOA) and compared with the other algorithms. In Section 4, the MAOADV-Hop localization algorithm is proposed and the the experimental simulation comparison is carried out to verify the performance of the localization algorithm. Finally, we summarize the work of this paper and describe the future work in Section 5.
The DV-Hop localization algorithm is one of the most famous range-free localization algorithms in WSNs [24][25][26] due to its high robustness and simplicity. But, the DV-Hop algorithm has a lower localization accuracy in complex environment. Thus, many improved DV-Hop algorithms have been proposed in recent years. Messous et al. proposed an improved recursive DV-Hop localization algorithm for randomly deployed wireless sensor networks, which uses an optimization formula to calculate the average hop count of anchor nodes to obtain better localization accuracy [27]. Shi et al. proposed an improved DV-Hop scheme based on path matching and particle swarm optimization algorithm, which uses an improved particle swarm optimization algorithm to optimize the location of unknown nodes [28]. Han et al. proposed an improved localization algorithm based on the improved DV-Hop and differential evolution (DE) algorithm in 2020 [29]. Huang and Zhang proposed a weighted DV-Hop localization algorithm for wireless sensor networks based on DE algorithm [30]. Lei et al. proposed DV-Hop localization based on the improved sparrow search algorithm (SSA) in wireless sensor networks in 2020, using the double communication radius method to improve DV-Hop and the improved sparrow search algorithm to estimate the location of nodes [31]. Huang et al. proposed a three-dimensional localization algorithm for WSNs based on improved A * and DV-Hop algorithms [32]. Han et al. proposed a multitarget vector hopping localization algorithm based on differential evolution quantum particle swarm optimization [33].
AOA is an algorithm with fast convergence speed and good global convergence ability [34], but its performance of the global convergence speed can be improved. Thus, a modified AOA (MAOA) with better global convergence ability is proposed. And the MAOA is used to improve the performance of the DV-Hop algorithm, that is, the MAOADV-Hop algorithm.
The main contributions of our work in this paper can be summarized as follows.
The Archimedes algorithm is optimized. Firstly, tent chaotic map is introduced into AOA to increase the diversity of the initial population of the algorithm. Secondly, the concepts of social learning and individual cognition in PSO are introduced to update the iterative equations of density and volume in AOA. It accelerates the convergence of density and volume to enhance the convergence speed of the algorithm.
MAOA is tested on several test functions and compared with AOA, DE, butterfly optimization algorithm (BOA) [35], PSO, and marine predator algorithm (MPA). The performance of the improved MAOA is verified.
The paper proposed a WSN localization algorithm based on MAOA and the DV-Hop algorithm (MAOADV-Hop).
Compared with DV-Hop, DE_DV-Hop, and BOA_DV-Hop, the MAOADV-Hop has better convergence rate than that of DE_DV-Hop and BOA_DV-Hop and has better localization accuracy than that of the DV-Hop and BOA_ DV-Hop.

AOA and MAOA
In this section, Section 3.1 introduces the entire optimization process of AOA. Section 3.2 improves AOA by using the tent chaotic map and the concepts of social learning and individual cognition in PSO, and MAOA is proposed. Section 3.3 verifies the performance of MAOA by comparing with five swarm intelligence optimization algorithms.
3.1. Archimedes Optimization Algorithm. AOA is a metaheuristic algorithm inspired by Archimedes' principle. Like other population-based metaheuristic algorithms, AOA begins its searching process through an initial population with random volume, density, and acceleration. The steps of the algorithm are as follows.
Step 1. Initialize population position, volume, density, and acceleration using where X i denotes the ith object in N population. N and D, respectively, denote population number and dimensions of the search space. ub i and lb i are the lower and upper bounds of the search space, respectively. vol i , den i , and acc i denote volume, density, and acceleration of the ith object, respectively. rand ðN, DÞ is a N × D dimensional matrix, which can be randomly calculated by the system function. Then, the individual X best with the best fitness value and the corresponding acc best , den best , and vol best were selected.
Step 2. Update the density and volume of ðt + 1Þth iteration of ith object using den t+1 i = den t i + rand × den best − den t denote the acceleration, density, and volume of the ith individual in the ðt + 1Þth iteration, respectively. acc mr , den mr , and vol mr denote the acceleration, density, and volume of random individuals, respectively.
If TF > 0:5, the phase is exploitation phase and no collision between objects. Update acceleration using acc t+1 i = den best + vol best × acc best den t+1 i + vol t+1 Then, normalize the acceleration using where u and l are the range of normalization and set to 0.9 and 0.1, respectively. acc t+1 i,norm denotes the percentage of steps that each agent will change. If the object i is far away from global optimum, the acc t+1 i,norm value will be high which means that the object is in the exploration phase.
Step 5. If TF ≤ 0:5, update the population X position using where C 1 is a constant equal to 2. Otherwise, if TF > 0:5, update the population X position using where C 1 is a constant equal to 6. T = C 3 × T F, T increases with time. F is a parameter that changes the direction of motion, calculated using where C 3 and C 4 are used to balance the movement direction of the population to adjust the ability of the algorithm to jump out of the local optimization.
Step 6. Evaluation. Select the individuals with the best fitness and their acceleration, density, and volume based on the updated population. Then, the algorithm proceeds to the next iteration until the iteration reach the max-iterations.

The Improvement of Archimedes
Optimization Algorithm 3.2.1. Tent Chaotic Mapping. Tent chaotic map can improve the population diversity to strength the global search ability of the algorithm [36]. The mathematical expression is shown in where a is the chaos factor, and a = 0:7 in here. D is the dimension of population.

The Modified Archimedes Optimization Algorithm
(MAOA). Firstly, the paper introduces tent chaotic map into the population initialization phase of AOA. Secondly, referring the concepts of social learning and individual perception in PSO to optimize the density and volume formula of AOA, the paper proposed the MAOA. The steps of MAOA are as follows: Step 1: initialization. initialize the positions of all objects using where D is the dimension of population and N is the number of the population. The ub i and lb i are the lower and upper bounds of the search space, respectively.

Journal of Sensors
Initialize density (den), volume (vol), and acceleration (acc) for the ith object using Initialize the optimal position (P i ) and corresponding fitness (P best i ) for the ith object using Then, P den and P vol corresponding to P and X best , ac c best , den best , and vol best are selected in the initialized population.
Step 2: update the density and volume of population using where t is the current iteration and r 1 and r 2 represent individual cognitive coefficients and social learning coefficient, respectively. If r 1 = 0, there is no individual cognition and the convergence speed of the algorithm is fast but fall into local optimization easily.
Step 3, step 4, and step 5 are all same as AOA. After the three-step update iteration, a new population X new is obtained.
Step 6: evaluate each object using fitness of objective function and remember the best solution found so far. Update the current optimal position P of each object and Multimodal function 12569.48    Journal of Sensors the corresponding P best , P den , and P vol . Then, update the global optimal individual X best and corresponding acc best , den best , and vol best .

Algorithm Simulation Analysis.
In this section, we compared the performance of MAOA with five algorithms, including AOA, BOA, PSO, DE, and MPA by 13 test functions. The global convergence ability and convergence speed of the proposed MAOA are analyzed to verify the optimization ability. Simulation platform: Windows 10 system using Intel (R) Core (TM) i5-10210U CPU @16 G RAM, and MATLAB 2018b.
3.3.1. Parameter Setting of MAOA. In the improved algorithm, the parameters including C 1 , C 2 , C 3 , C 4 , r 1 , and r 2 need to be set. According to the analysis of AOA algorithm in reference [23], we choose C 1 = 2, C 2 = 6. The sensitivity of the other four parameters of MAOA is analyzed by unimodal function F 5 and multimodal test function F 12 .
Setting the parameter N = 30 and max − iterations = 200, the test results are shown in Table 1. It is obvious from the test results in Table 1 that the performance of MAOA is the best while C 3 = 1, C 4 = 2, r 1 = 1:8, and r 1 = 0:5.  Table 2, including seven unimodal functions, F 1 − F 7 , and six multimodal functions, F 8 − F 13 : The dimensions of the test function are all set to 30. To avoid the error resulted by accidental factors, the average value of the results of 100 runs of each algorithm is used to measure the optimization performance of each algorithm. The parameters of each algorithm are shown in Table 3, and the test results are shown in Table 4.
In Table 4, the 'Mean' represents the average value of the optimization results and the 'Std' represents the standard deviation of the optimization results, and the blackened one is the minimum value. Compared with other algorithms, MAOA outperformed other metaheuristic algorithms for 11 functions including F 1 , F 2 , F 3 , F 4 , F 5 , F 7 , F 9 , F 10 , F 11 , F 12 , and F 13 : In the process of 100 tests, the standard deviation of the test result of MAOA algorithm is relatively small. This indicates that the stably global convergence ability of the algorithm, so the improvement of AOA is effective and MAOA has better global convergence ability than others.

Complexity Analysis of Algorithm
(1) Complexity analysis of AOA The time complexity of AOA is given as follows: Assuming that the population size is n, the dimension of search space is d, and the maximum iteration is T. The population density, volume, acceleration, and initialization complexity are all OðndÞ, the fitness value of calculation complexity is OðndÞ. The exploration and exploitation phases update complexity are OðTð1 + 2n + 2n log nÞ. To sum up, the time complexity of the whole algorithm is expressed as (2) Complexity analysis of MAOA The time complexity of MAOA is given as follows: the population, density, volume, P, and acceleration initialization complexity are all OðndÞ, and the fitness value of calculation complexity is OðndÞ. The exploration and exploitation phases  (16) and (17), compared with the time complexity of AOA, the time complexity of MAOA only increases OðndÞ + OðTð2ÞÞ.
(3) Complexity contrast between AOA and MAOA AOA and MAOA were optimized over 13 test functions for 30 times, and the total time and the average time per run were compared, and the results are shown in Table 5.
In Table 5, the unit of all data is seconds. The results are shown as follows: the total time of MAOA is longer than that of AOA about 0.115 seconds, and the average time per run of MAOA is longer than that of AOA about 3:840E − 03 seconds. Therefore, the time complexity of MAOA increased is not obvious, compared with that of AOA.

MAOADV-Hop Algorithm
4.1. The Node Localization Algorithm. In this section, an improved localization algorithm, MAOADV-Hop, is proposed by introducing MAOA into DV-Hop. The step of the algorithm is shown as follows.
Step 1. Flooding. All anchor nodes broadcast data packets from their locations to their neighbors, and those neighbors of the receiving packet send the new packet to the other neighbors. Finally, we can gain the minimum hop count between every anchor node and every unknown node.
Step 2. Distance estimation between nodes. Equation (18) is used to calculate the average distance per hop: where for i = 1 to N 7: for j = 1 to N 8: if short_path(i, k)+short_path(k, j)<short_path(i, j); 9: short_path(i, j)=short_path(i, k)+short_path(k, j); 10: end 11: end 12: end 13: end 14: Calculate the average distance Hop-size of each hop using Equation (18); 15: Calculate the estimated distance from the anchor node to the unknown node using Equation (19); 16: Initialize the parameters at the population level of MAOA algorithm using (12)─(14); 17: for t = 1: Max_iter 18: Calculate TF using Equation (3)  Update acc t+1 i using Equation (6) and calculate X t+1 i using Equation (9); 25: end 26: Apply boundary constraints to X and calculate the fitness of X; 27: The optimal position of each object is selected and assigned to P, and the corresponding fitness is assigned toP best ; 28: Select the best fitness minimum value, the corresponding position X best ; 29: end 30: The best individual is the location of the unknown node. 31: end  (19) is used to calculate the estimated distance between the anchor node i and the unknown node u.
where h u,i denotes the value of minimum hop count between unknown node u and the anchor node i.
Step 3. It uses MAOA to search the optimal solution of fit- y u Þ represents the estimated location of unknown node u and ðx i , y i Þ represents the actual location of unknown node u. m is the number of the anchor node. The estimated position corresponding to the optimal solution is the localization of the unknown node.
The pseudocode of MAOADV-Hop is shown in Algorithm 1. 10 Journal of Sensors used to estimate the location of the unknown node. The simulation results are shown in Figure 1.

Experimental
In Figure 1, the red ' * ' represents the anchor node. The blue '○' represents the estimated location of the unknown nodes. The blue line connects the estimated location and the actual location of the same unknown node and its length is the localization error size. Only considered 2D coordinate planes, all experimental results were run independently for 100 times to calculate the average value. It uses the average localization error (ALE) to measure the localization accuracy.
where ðx ext u , y ext u Þ and ðx act u , y act u Þ represent the estimate location and the actual location of the unknown node u, n is the number of unknown nodes, and R is the communication radius between nodes. Experimental analysis is carried out under four different simulation conditions: square random deployment, square uniform deployment, C-shaped random steps, and Cshaped uniform deployment to prove the localization accuracy and convergence speed of the proposed algorithm. The experimental results are shown in Figures 2 and 3.
From Figures 2 and 3, the average localization error of MAOADV-Hop is 35% to 71% lower than DV-Hop and is 3% to 7% lower than BOA_DV-Hop. The convergence rate of MAOADV-Hop is faster than both DE-DV-Hop and BOA_DV-Hop. The localization error curve of MAOADV-Hop in the four scenarios is relatively smooth, tends to be horizontal after just several iterations, and has a good capability of global optimization. DE_DV-Hop fell into the local optimal value in a short period of time after 25 iterations. Therefore, the localization performance of MAOADV-Hop is better than the other three localization algorithms.

Effect of Node Density, Anchor Rate, and Communication Radius on ALE
(1) The effect of node density on ALE In this section, the experimental area is a 100 m × 100 m square area and the percentage of anchor nodes is 20%. The number of square topology deployment nodes is 80 to 200 and the communication radius is 20 m. Experimental results are shown in Figure 4.
From Figure 4, with the increasing in the number of deployed nodes, the ALES of four localization algorithms are all decreased. Because of the increase in the number of nodes, the connectivity of the network is enhanced, and the estimation distance error between unknown nodes and anchor nodes is reduced. Therefore, the localization accuracy is stronger.
(2) The effect of anchor rate on ALE In this section, the experimental area is a 100 m × 100 m square area and the percentage of anchor nodes is 15% to 35%. The number of square topology deployment nodes is 100, and the communication radius is 20 m. Experimental results are shown in Figure 5.
From Figure 5, with the increasing ratio of anchor nodes, the ALE of four localization algorithms is all decreased. Because of the increasing ratio of anchor nodes, the accuracy of the average distance per hop of the anchor nodes is higher. The estimated distances between the anchor nodes and the unknown nodes are closer to the real distance. And the increase of the number of anchors provides more conditions for the metaheuristic algorithm, so it can estimate the location of unknown nodes more accurately.
(3) The effect of communication radius on ALE In this section, the experimental area is a 100 m × 100 m square area and the percentage of anchor nodes is 20%. The number of the square topology deployment nodes is 100, and the communication radius is 15 m to 45 m. Experimental results are shown in Figure 6.         14 Journal of Sensors In Figure 6, with the increase of communication radius, the ALE of the four localization algorithms decreased. More nodes can communicate in a single-hop way, which reduces the hop value between unknown nodes and anchor points because of the bigger communication radius. The distance between the unknown node and the anchor point is estimated more accurately. And the estimated location of unknown nodes is more close real location. In addition, the localization

Timing of Localization.
In this section, we analyze the CPU time required of the four localization algorithms. The WSN parameter settings are shown in Table 9. DE_DV-Hop, BOA_DV-Hop, DV-Hop, and MAOADV-Hop are used to locate the unknown nodes. The CPU time required of each algorithm is shown in Figure 7.
From Figure 7, it is obvious that the time by DV-Hop is the shortest with 0.4793 seconds, followed by the time used by MAOADV-Hop, which is 0.9609 seconds. The time required by DE_DV-Hop and BOA_DV-Hop is longer, which is about 4 times of DV-Hop and twice of MAOADV-Hop. Although the time of DV-Hop is shorter than MAOADV-Hop, the localization accuracy of MAOADV-Hop is much higher than that of DV-Hop. Therefore, MAOADV-Hop is the best way to locate unknown nodes in the four localization algorithms.

Conclusions
(1) In this paper, a modified Archimedes optimization algorithm (MAOA) is proposed, and seven unimodal functions and six multimodal functions are used to test the convergence speed and the optimization ability of the algorithm. The test results show that the convergence and optimization ability of the MAOA is better than AOA, DE, BOA, PSO, and MPA (2) The paper proposes a localization algorithm based on MAOA and DV-Hop, called MAOADV-Hop.
The simulation results show that the localization effect of MAOADV-Hop is better than that of DE_ DV-Hop, BOA_DV-Hop, and DV-Hop, such as better localization accuracy and faster speed 5.2. Future Work. This paper only discusses the application of node localization based on the two-dimensional plane in WSNs. These factors associated with WSNs that need futuristic attention are listed as follows.
(1) More complex spaces: the future work will focus on the study of localization in the three-dimensional WSNs (2) Energy consumption: the future work should integrate the routing algorithm with localization in order to reduce the energy consumption, which is helpful of extending the lifetime of WSNs

Data Availability
The simulation program used to support the findings of this study have been deposited in the GitHub repository (https:// chengmang1.github.io/data2/).  Journal of Sensors