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

Authors: Mangmang Cheng; Tao Qin; Jing Yang
Journal: Journal of Sensors
 (2022)

---

## Abstract

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 DV-Hop 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.


---

## Body

## 1. 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 information 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 Section2, 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.


## 2. Literature Review

Node localization algorithms in WSNs are mainly divided into range-based localization algorithm and range-free localization algorithm [15]. The range-based localization algorithm mainly included RSSI [16], TOA [17], TDOA [18], and angle of arrival (AOA) [19]. The range-free localization algorithm included centroid [20], weighted centroid, DV-Hop, amorphous [21], and APIT localization algorithm [22]. The position accuracy of range-free localization algorithm can satisfy most of the needs, which is popular among users [23].The DV-Hop localization algorithm is one of the most famous range-free localization algorithms in WSNs [24–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.


## 3. AOA and MAOA

In this section, Section3.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(1)Xi=lbi+rand×ubi−lbi;i=1,2,⋯,N,acci=lbi+rand×ubi−lbi;i=1,2,⋯,N,deni=randN,D,voli=randN,D,
whereXi denotes the ith object in N population. N and D, respectively, denote population number and dimensions of the search space. ubi and lbi are the lower and upper bounds of the search space, respectively. voli,deni,andacci denote volume, density, and acceleration of the ith object, respectively. randN,D is a N×D dimensional matrix, which can be randomly calculated by the system function. Then, the individual Xbestwith the best fitness value and the corresponding accbest, denbest, and volbest were selected.Step 2.
Update the density and volume oft+1th iteration of ith object using
(2)denit+1=denit+rand×denbest−denit,volit+1=volit+rand×volbest−volit,
wheredenbestandvolbest, respectively, are the global optimal value of density and volume so far.Step 3.
Calculate the parameterTF and the density decline factor d, which are used to balance the local convergence ability and global convergence ability of MAOA.
(3)TF=expt−tmaxtmax,
wheretmax is max-iterations and t is the current iterations. TF increases with the number of iterations until TF=1.
(4)dt+1=exptmax−ttmax−ttmax,
whered decreases as the number of iterations increases, and the search is transferred to the bounded region that has been identified.Step 4.
IfTF≤0.5, the phase is exploration phase and collision between objects occurs. Update acceleration using
(5)accit+1=denmr+volmr×accmrdenit+1+volit+1,mr=rand,
whereaccit+1,denit+1,andvolit+1 denote the acceleration, density, and volume of the ith individual in the t+1th iteration, respectively. accmr,denmr,andvolmr denote the acceleration, density, and volume of random individuals, respectively.IfTF>0.5, the phase is exploitation phase and no collision between objects. Update acceleration using
(6)accit+1=denbest+volbest×accbestdenit+1+volit+1.Then, normalize the acceleration using(7)acci,normt+1=u×accit+1−minaccmaxacc−minacc+l,whereuandl are the range of normalization and set to 0.9 and 0.1, respectively. acci,normt+1 denotes the percentage of steps that each agent will change. If the object i is far away from global optimum, the acci,normt+1 value will be high which means that the object is in the exploration phase.Step 5.
IfTF≤0.5, update the population X position using
(8)Xit+1=Xit+C1×rand×acci,normt+1×d×Xrand−Xit,
whereC1 is a constant equal to 2. Otherwise, if TF>0.5, update the population X position using
(9)Xit+1=Xbestt+F×C2×rand×acci,normt+1×d×T×Xbest−Xit,
whereC1 is a constant equal to 6. T=C3×TF, T increases with time. F is a parameter that changes the direction of motion, calculated using
(10)P=2×rand−C4,F=+1,ifP≤0.5,−1,ifP>0.5,
whereC3andC4 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.


### 3.2. 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
(11)x1=rand,xi+1=xia,ifxi<a,xi1−a,ifxi≥a,i=1,2,⋯,D,wherea is the chaos factor, and a=0.7 in here. D is the dimension of population.


#### 3.2.2. 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(12)Xi=TentN.∗ubi−lbi+lbii=1,2,⋯,D,whereD is the dimension of population and N is the number of the population. The ubi and lbi are the lower and upper bounds of the search space, respectively.Initialize density (den), volume (vol), and acceleration (acc) for the ith object using
(13)deni=rand,voli=rand,acci=randN,D×ubi−lbi+lbi.Initialize the optimal position (Pi) and corresponding fitness (Pbesti) for the ith object using
(14)Pi=Xi,Pbesti=fitnessPi.Then,Pden and Pvol corresponding to P and Xbest,accbest,denbest,andvolbest are selected in the initialized population.Step 2: update the density and volume of population using(15)denit+1=denit+r1×rand×Pdeni−denit+r2×rand×denbest−denit,volit+1=volit+r1×rand×Pvoli−denit+r2×rand×volbest−volit,wheret is the current iteration and r1andr2 represent individual cognitive coefficients and social learning coefficient, respectively. If r1=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 Xnew is obtained.Step 6: evaluate each object using fitness of objective function and remember the best solution found so far. Update the current optimal positionP of each object and the corresponding Pbest,Pden,andPvol. Then, update the global optimal individual Xbest and corresponding accbest,denbest, and volbest.


### 3.3. 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 includingC1,C2,C3,C4,r1,andr2 need to be set. According to the analysis of AOA algorithm in reference [23], we choose C1=2,C2=6. The sensitivity of the other four parameters of MAOA is analyzed by unimodal function F5 and multimodal test function F12.Setting the parameterN=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 C3=1,C4=2,r1=1.8,andr1=0.5.Table 1
MAOA sensitivity analysis of parameters.
NumberParametersTest functionC3C4r1r2F5F1211110.52.89E−075.62E−09211112.89E−071.18E−083111.50.52.90E−077.86E−094111.512.90E−073.70E−085111.80.52.89E−075.84E−096111.812.89E−074.85E−0971210.52.89E−079.93E−09812112.89E−071.08E−089121.50.52.90E−076.80E−0910121.512.90E−072.88E−0811121.80.52.89E−073.96E−0912121.812.89E−076.78E−09132110.51.93E−032.39E−061421115.85E−033.20E−0715211.50.55.69E−031.25E−0616211.511.07E−022.96E−0717211.80.54.04E−035.24E−0718211.816.66E−032.54E−07192210.54.34E−032.37E−062022112.18E−036.35E−0721221.50.56.78E−031.73E−0622221.512.81E−031.40E−0723221.80.52.09E−011.81E−0724221.813.10E−032.33E−07


#### 3.3.2. MAOA Convergence Analysis

We compared the proposed algorithm with AOA, BOA, PSO, DE, and MPA through 13 test functions. The test functions are shown in Table2, including seven unimodal functions, F1−F7, and six multimodal functions, F8−F13. 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.Table 2
The test function.
TypeFunctionDimRangefminUnimodal functionF1x=∑i=1nxi230[-100,100]0F2x=∑i=1nxi+∏i=1nxi30[-10,10]0F3x=∑i=1n∑j−1ixj230[-100,100]0F4x=maxixi,1≤i≤n30[-100,100]0F5x=∑i=1n−1100×xi+1−xi22+xi−1230[-30,30]0F6x=∑i=1nxi+0.5230[-100,100]0F7x=ixi4+randm0,130[-128,128]Multimodal functionF8x=∑i=1n−xisinxi30[-500,500]12569.48F9x=∑i=1nxi2−10cos2πxi+1030[-5.12,5.12]0F10x=−20exp−0.21/n∑i=1nxi2−exp1/n∑i=1ncos2πxi+20+e30[-32,32]0F11x=1/4000∑i=1nxi2−∏i=1ncosxi/i+130[-600,600]0F12x=π/n10sinπy1+∑i=1n−1yi−121+sin2πyi+1+yn−12yi=1+x1+1/4,u=xi,a,k,m=kxi−am,xi>a,0,−a<xi<a,k−xi−am,xi<−a30[50,50]0F13x=0.1sin23πxi+∑i=1nxi−121+sin23πxi+1+xi−121+sin22πxi+1+∑i=1nuxi,5,100,430[50,50]0Table 3
Parameter settings of every algorithm.
IndexAlgorithmParameter1AOAN=30, C1=2, C2=6, C3=1, C4=2, Tmax=1002MAOAN=30, C1=2, C2=6, C3=1, C4=2, r1=1.8, r2=0.5, Tmax=1003BOAN=30, conversion probability p=0.6, initial value of a is 0.1, Tmax=1004PSON=30, w decreases linearly in [0.2, 0.9], c1=2, c2=2, Tmax=1005DEN=30, CR=0.1, Tmax=1006MPAN=30, FADs=0.2, P=0.5, Tmax=100Table 4
Test result statistics.
FunctionTypeAOAMAOABOAPSODEMPAF1Mean5.639E−055.492E−099.100E−032.073E+049.588E+034.648E+01Std1.143E−043.313E−082.000E−031.990E+031.692E+032.260E+01F2Mean9.569E−041.016E−053.980E−024.391E+004.021E+012.727E+00Std1.142E−033.098E−051.420E−021.275E+003.951E+005.867E−01F3Mean2.454E−029.931E−088.300E−037.217E+044.328E+042.205E+03Std4.674E−027.045E−071.900E−031.996E+046.230E+031.122E+03F4Mean6.146E−031.825E−051.129E−014.762E+016.458E+016.478E+01Std7.079E−033.676E−051.540E−021.112E+004.003E+004.294E+00F5Mean2.892E+012.891E+012.893E+011.891E+049.356E+068.748E+02Std1.032E−013.498E−023.510E−021.893E+043.099E+064.530E+02F6Mean5.511E+005.566E+005.743E+002.068E+049.574E+035.444E+01Std4.440E−016.852E−016.237E−011.771E+031.677E+032.251E+01F7Mean7.405E−036.257E−031.770E−029.554E−014.545E+002.341E−02Std6.505E−036.086E−037.300E−033.586E−011.402E+001.278E−02F8Mean−5.345E+03−4.129E+03−3.126E+03−2.435E+03−5.770E+03−6.046E+03Std3.835E+034.679E+023.422E+024.923E+023.927E+025.811E+02F9Mean2.497E+012.920E−075.846E+011.064E+022.156E+027.705E+01Std6.370E+011.854E−068.200E+012.240E+011.713E+012.900E+01F10Mean1.637E+014.345E−069.800E−027.056E+001.574E+013.071E+00Std7.670E+001.121E−051.690E−021.086E+006.888E−014.540E−01F11Mean2.150E−012.812E−081.238E−015.673E+028.788E+011.443E+00Std3.083E−012.632E−073.830E−024.728E+011.376E+011.730E−01F12Mean7.449E−016.732E−017.435E−011.580E+014.280E+061.069E+00Std1.868E−011.843E−011.464E−011.449E+013.028E+064.527E−01F13Mean2.958E+002.937E+003.086E+009.261E+032.033E+074.866E+00Std1.048E−011.079E−011.896E−011.508E+048.453E+061.489E+00In Table4, 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 F1,F2,F3,F4,F5,F7,F9,F10,F11,F12,andF13. 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.


#### 3.3.3. Complexity Analysis of Algorithm

(1)
Complexity analysis of AOAThe time complexity of AOA is given as follows: Assuming that the population size isn, the dimension of search space is d, and the maximum iteration is T. The population density, volume, acceleration, and initialization complexity are all Ond, the fitness value of calculation complexity is Ond. The exploration and exploitation phases update complexity are OT1+2n+2nlogn. To sum up, the time complexity of the whole algorithm is expressed as
(16)OAOA=5×Ond+OT1+2n+2nlogn.(2)
Complexity analysis of MAOAThe time complexity of MAOA is given as follows: the population, density, volume,P, and acceleration initialization complexity are all Ond, and the fitness value of calculation complexity is Ond. The exploration and exploitation phases update complexity are OT3+2n+2nlogn. To sum up, the time complexity of the whole algorithm is expressed as
(17)OMAOA=6×Ond+OT3+2n+2nlogn.From Equations (16) and (17), compared with the time complexity of AOA, the time complexity of MAOA only increases Ond+OT2.
(3)
Complexity contrast between AOA and MAOAAOA 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 Table5.Table 5
Comparison of execution time.
FunctionTime of AOATime of MAOATotalAverageTotalAverageF10.3851.283E−020.5031.677E−02F20.4581.527E−020.5511.837E−02F30.8432.810E−020.9613.203E−02F40.4231.410E−020.5251.750E−02F50.4781.593E−020.5921.973E−02F60.4131.377E−020.5341.780E−02F70.6682.227E−020.7752.583E−02F80.4981.660E−020.6122.040E−02F90.4631.543E−020.5801.933E−02F100.4681.560E−020.5971.990E−02F110.5151.717E−020.6322.107E−02F121.0913.637E−021.2174.057E−02F131.1123.707E−021.2344.113E−02In Table5, 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.


## 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(1)Xi=lbi+rand×ubi−lbi;i=1,2,⋯,N,acci=lbi+rand×ubi−lbi;i=1,2,⋯,N,deni=randN,D,voli=randN,D,
whereXi denotes the ith object in N population. N and D, respectively, denote population number and dimensions of the search space. ubi and lbi are the lower and upper bounds of the search space, respectively. voli,deni,andacci denote volume, density, and acceleration of the ith object, respectively. randN,D is a N×D dimensional matrix, which can be randomly calculated by the system function. Then, the individual Xbestwith the best fitness value and the corresponding accbest, denbest, and volbest were selected.Step 2.
Update the density and volume oft+1th iteration of ith object using
(2)denit+1=denit+rand×denbest−denit,volit+1=volit+rand×volbest−volit,
wheredenbestandvolbest, respectively, are the global optimal value of density and volume so far.Step 3.
Calculate the parameterTF and the density decline factor d, which are used to balance the local convergence ability and global convergence ability of MAOA.
(3)TF=expt−tmaxtmax,
wheretmax is max-iterations and t is the current iterations. TF increases with the number of iterations until TF=1.
(4)dt+1=exptmax−ttmax−ttmax,
whered decreases as the number of iterations increases, and the search is transferred to the bounded region that has been identified.Step 4.
IfTF≤0.5, the phase is exploration phase and collision between objects occurs. Update acceleration using
(5)accit+1=denmr+volmr×accmrdenit+1+volit+1,mr=rand,
whereaccit+1,denit+1,andvolit+1 denote the acceleration, density, and volume of the ith individual in the t+1th iteration, respectively. accmr,denmr,andvolmr denote the acceleration, density, and volume of random individuals, respectively.IfTF>0.5, the phase is exploitation phase and no collision between objects. Update acceleration using
(6)accit+1=denbest+volbest×accbestdenit+1+volit+1.Then, normalize the acceleration using(7)acci,normt+1=u×accit+1−minaccmaxacc−minacc+l,whereuandl are the range of normalization and set to 0.9 and 0.1, respectively. acci,normt+1 denotes the percentage of steps that each agent will change. If the object i is far away from global optimum, the acci,normt+1 value will be high which means that the object is in the exploration phase.Step 5.
IfTF≤0.5, update the population X position using
(8)Xit+1=Xit+C1×rand×acci,normt+1×d×Xrand−Xit,
whereC1 is a constant equal to 2. Otherwise, if TF>0.5, update the population X position using
(9)Xit+1=Xbestt+F×C2×rand×acci,normt+1×d×T×Xbest−Xit,
whereC1 is a constant equal to 6. T=C3×TF, T increases with time. F is a parameter that changes the direction of motion, calculated using
(10)P=2×rand−C4,F=+1,ifP≤0.5,−1,ifP>0.5,
whereC3andC4 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.


## 3.2. 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
(11)x1=rand,xi+1=xia,ifxi<a,xi1−a,ifxi≥a,i=1,2,⋯,D,wherea is the chaos factor, and a=0.7 in here. D is the dimension of population.


### 3.2.2. 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(12)Xi=TentN.∗ubi−lbi+lbii=1,2,⋯,D,whereD is the dimension of population and N is the number of the population. The ubi and lbi are the lower and upper bounds of the search space, respectively.Initialize density (den), volume (vol), and acceleration (acc) for the ith object using
(13)deni=rand,voli=rand,acci=randN,D×ubi−lbi+lbi.Initialize the optimal position (Pi) and corresponding fitness (Pbesti) for the ith object using
(14)Pi=Xi,Pbesti=fitnessPi.Then,Pden and Pvol corresponding to P and Xbest,accbest,denbest,andvolbest are selected in the initialized population.Step 2: update the density and volume of population using(15)denit+1=denit+r1×rand×Pdeni−denit+r2×rand×denbest−denit,volit+1=volit+r1×rand×Pvoli−denit+r2×rand×volbest−volit,wheret is the current iteration and r1andr2 represent individual cognitive coefficients and social learning coefficient, respectively. If r1=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 Xnew is obtained.Step 6: evaluate each object using fitness of objective function and remember the best solution found so far. Update the current optimal positionP of each object and the corresponding Pbest,Pden,andPvol. Then, update the global optimal individual Xbest and corresponding accbest,denbest, and volbest.


## 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
(11)x1=rand,xi+1=xia,ifxi<a,xi1−a,ifxi≥a,i=1,2,⋯,D,wherea is the chaos factor, and a=0.7 in here. D is the dimension of population.


## 3.2.2. 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(12)Xi=TentN.∗ubi−lbi+lbii=1,2,⋯,D,whereD is the dimension of population and N is the number of the population. The ubi and lbi are the lower and upper bounds of the search space, respectively.Initialize density (den), volume (vol), and acceleration (acc) for the ith object using
(13)deni=rand,voli=rand,acci=randN,D×ubi−lbi+lbi.Initialize the optimal position (Pi) and corresponding fitness (Pbesti) for the ith object using
(14)Pi=Xi,Pbesti=fitnessPi.Then,Pden and Pvol corresponding to P and Xbest,accbest,denbest,andvolbest are selected in the initialized population.Step 2: update the density and volume of population using(15)denit+1=denit+r1×rand×Pdeni−denit+r2×rand×denbest−denit,volit+1=volit+r1×rand×Pvoli−denit+r2×rand×volbest−volit,wheret is the current iteration and r1andr2 represent individual cognitive coefficients and social learning coefficient, respectively. If r1=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 Xnew is obtained.Step 6: evaluate each object using fitness of objective function and remember the best solution found so far. Update the current optimal positionP of each object and the corresponding Pbest,Pden,andPvol. Then, update the global optimal individual Xbest and corresponding accbest,denbest, and volbest.


## 3.3. 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 includingC1,C2,C3,C4,r1,andr2 need to be set. According to the analysis of AOA algorithm in reference [23], we choose C1=2,C2=6. The sensitivity of the other four parameters of MAOA is analyzed by unimodal function F5 and multimodal test function F12.Setting the parameterN=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 C3=1,C4=2,r1=1.8,andr1=0.5.Table 1
MAOA sensitivity analysis of parameters.
NumberParametersTest functionC3C4r1r2F5F1211110.52.89E−075.62E−09211112.89E−071.18E−083111.50.52.90E−077.86E−094111.512.90E−073.70E−085111.80.52.89E−075.84E−096111.812.89E−074.85E−0971210.52.89E−079.93E−09812112.89E−071.08E−089121.50.52.90E−076.80E−0910121.512.90E−072.88E−0811121.80.52.89E−073.96E−0912121.812.89E−076.78E−09132110.51.93E−032.39E−061421115.85E−033.20E−0715211.50.55.69E−031.25E−0616211.511.07E−022.96E−0717211.80.54.04E−035.24E−0718211.816.66E−032.54E−07192210.54.34E−032.37E−062022112.18E−036.35E−0721221.50.56.78E−031.73E−0622221.512.81E−031.40E−0723221.80.52.09E−011.81E−0724221.813.10E−032.33E−07


### 3.3.2. MAOA Convergence Analysis

We compared the proposed algorithm with AOA, BOA, PSO, DE, and MPA through 13 test functions. The test functions are shown in Table2, including seven unimodal functions, F1−F7, and six multimodal functions, F8−F13. 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.Table 2
The test function.
TypeFunctionDimRangefminUnimodal functionF1x=∑i=1nxi230[-100,100]0F2x=∑i=1nxi+∏i=1nxi30[-10,10]0F3x=∑i=1n∑j−1ixj230[-100,100]0F4x=maxixi,1≤i≤n30[-100,100]0F5x=∑i=1n−1100×xi+1−xi22+xi−1230[-30,30]0F6x=∑i=1nxi+0.5230[-100,100]0F7x=ixi4+randm0,130[-128,128]Multimodal functionF8x=∑i=1n−xisinxi30[-500,500]12569.48F9x=∑i=1nxi2−10cos2πxi+1030[-5.12,5.12]0F10x=−20exp−0.21/n∑i=1nxi2−exp1/n∑i=1ncos2πxi+20+e30[-32,32]0F11x=1/4000∑i=1nxi2−∏i=1ncosxi/i+130[-600,600]0F12x=π/n10sinπy1+∑i=1n−1yi−121+sin2πyi+1+yn−12yi=1+x1+1/4,u=xi,a,k,m=kxi−am,xi>a,0,−a<xi<a,k−xi−am,xi<−a30[50,50]0F13x=0.1sin23πxi+∑i=1nxi−121+sin23πxi+1+xi−121+sin22πxi+1+∑i=1nuxi,5,100,430[50,50]0Table 3
Parameter settings of every algorithm.
IndexAlgorithmParameter1AOAN=30, C1=2, C2=6, C3=1, C4=2, Tmax=1002MAOAN=30, C1=2, C2=6, C3=1, C4=2, r1=1.8, r2=0.5, Tmax=1003BOAN=30, conversion probability p=0.6, initial value of a is 0.1, Tmax=1004PSON=30, w decreases linearly in [0.2, 0.9], c1=2, c2=2, Tmax=1005DEN=30, CR=0.1, Tmax=1006MPAN=30, FADs=0.2, P=0.5, Tmax=100Table 4
Test result statistics.
FunctionTypeAOAMAOABOAPSODEMPAF1Mean5.639E−055.492E−099.100E−032.073E+049.588E+034.648E+01Std1.143E−043.313E−082.000E−031.990E+031.692E+032.260E+01F2Mean9.569E−041.016E−053.980E−024.391E+004.021E+012.727E+00Std1.142E−033.098E−051.420E−021.275E+003.951E+005.867E−01F3Mean2.454E−029.931E−088.300E−037.217E+044.328E+042.205E+03Std4.674E−027.045E−071.900E−031.996E+046.230E+031.122E+03F4Mean6.146E−031.825E−051.129E−014.762E+016.458E+016.478E+01Std7.079E−033.676E−051.540E−021.112E+004.003E+004.294E+00F5Mean2.892E+012.891E+012.893E+011.891E+049.356E+068.748E+02Std1.032E−013.498E−023.510E−021.893E+043.099E+064.530E+02F6Mean5.511E+005.566E+005.743E+002.068E+049.574E+035.444E+01Std4.440E−016.852E−016.237E−011.771E+031.677E+032.251E+01F7Mean7.405E−036.257E−031.770E−029.554E−014.545E+002.341E−02Std6.505E−036.086E−037.300E−033.586E−011.402E+001.278E−02F8Mean−5.345E+03−4.129E+03−3.126E+03−2.435E+03−5.770E+03−6.046E+03Std3.835E+034.679E+023.422E+024.923E+023.927E+025.811E+02F9Mean2.497E+012.920E−075.846E+011.064E+022.156E+027.705E+01Std6.370E+011.854E−068.200E+012.240E+011.713E+012.900E+01F10Mean1.637E+014.345E−069.800E−027.056E+001.574E+013.071E+00Std7.670E+001.121E−051.690E−021.086E+006.888E−014.540E−01F11Mean2.150E−012.812E−081.238E−015.673E+028.788E+011.443E+00Std3.083E−012.632E−073.830E−024.728E+011.376E+011.730E−01F12Mean7.449E−016.732E−017.435E−011.580E+014.280E+061.069E+00Std1.868E−011.843E−011.464E−011.449E+013.028E+064.527E−01F13Mean2.958E+002.937E+003.086E+009.261E+032.033E+074.866E+00Std1.048E−011.079E−011.896E−011.508E+048.453E+061.489E+00In Table4, 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 F1,F2,F3,F4,F5,F7,F9,F10,F11,F12,andF13. 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.


### 3.3.3. Complexity Analysis of Algorithm

(1)
Complexity analysis of AOAThe time complexity of AOA is given as follows: Assuming that the population size isn, the dimension of search space is d, and the maximum iteration is T. The population density, volume, acceleration, and initialization complexity are all Ond, the fitness value of calculation complexity is Ond. The exploration and exploitation phases update complexity are OT1+2n+2nlogn. To sum up, the time complexity of the whole algorithm is expressed as
(16)OAOA=5×Ond+OT1+2n+2nlogn.(2)
Complexity analysis of MAOAThe time complexity of MAOA is given as follows: the population, density, volume,P, and acceleration initialization complexity are all Ond, and the fitness value of calculation complexity is Ond. The exploration and exploitation phases update complexity are OT3+2n+2nlogn. To sum up, the time complexity of the whole algorithm is expressed as
(17)OMAOA=6×Ond+OT3+2n+2nlogn.From Equations (16) and (17), compared with the time complexity of AOA, the time complexity of MAOA only increases Ond+OT2.
(3)
Complexity contrast between AOA and MAOAAOA 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 Table5.Table 5
Comparison of execution time.
FunctionTime of AOATime of MAOATotalAverageTotalAverageF10.3851.283E−020.5031.677E−02F20.4581.527E−020.5511.837E−02F30.8432.810E−020.9613.203E−02F40.4231.410E−020.5251.750E−02F50.4781.593E−020.5921.973E−02F60.4131.377E−020.5341.780E−02F70.6682.227E−020.7752.583E−02F80.4981.660E−020.6122.040E−02F90.4631.543E−020.5801.933E−02F100.4681.560E−020.5971.990E−02F110.5151.717E−020.6322.107E−02F121.0913.637E−021.2174.057E−02F131.1123.707E−021.2344.113E−02In Table5, 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.


## 3.3.1. Parameter Setting of MAOA

In the improved algorithm, the parameters includingC1,C2,C3,C4,r1,andr2 need to be set. According to the analysis of AOA algorithm in reference [23], we choose C1=2,C2=6. The sensitivity of the other four parameters of MAOA is analyzed by unimodal function F5 and multimodal test function F12.Setting the parameterN=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 C3=1,C4=2,r1=1.8,andr1=0.5.Table 1
MAOA sensitivity analysis of parameters.
NumberParametersTest functionC3C4r1r2F5F1211110.52.89E−075.62E−09211112.89E−071.18E−083111.50.52.90E−077.86E−094111.512.90E−073.70E−085111.80.52.89E−075.84E−096111.812.89E−074.85E−0971210.52.89E−079.93E−09812112.89E−071.08E−089121.50.52.90E−076.80E−0910121.512.90E−072.88E−0811121.80.52.89E−073.96E−0912121.812.89E−076.78E−09132110.51.93E−032.39E−061421115.85E−033.20E−0715211.50.55.69E−031.25E−0616211.511.07E−022.96E−0717211.80.54.04E−035.24E−0718211.816.66E−032.54E−07192210.54.34E−032.37E−062022112.18E−036.35E−0721221.50.56.78E−031.73E−0622221.512.81E−031.40E−0723221.80.52.09E−011.81E−0724221.813.10E−032.33E−07


## 3.3.2. MAOA Convergence Analysis

We compared the proposed algorithm with AOA, BOA, PSO, DE, and MPA through 13 test functions. The test functions are shown in Table2, including seven unimodal functions, F1−F7, and six multimodal functions, F8−F13. 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.Table 2
The test function.
TypeFunctionDimRangefminUnimodal functionF1x=∑i=1nxi230[-100,100]0F2x=∑i=1nxi+∏i=1nxi30[-10,10]0F3x=∑i=1n∑j−1ixj230[-100,100]0F4x=maxixi,1≤i≤n30[-100,100]0F5x=∑i=1n−1100×xi+1−xi22+xi−1230[-30,30]0F6x=∑i=1nxi+0.5230[-100,100]0F7x=ixi4+randm0,130[-128,128]Multimodal functionF8x=∑i=1n−xisinxi30[-500,500]12569.48F9x=∑i=1nxi2−10cos2πxi+1030[-5.12,5.12]0F10x=−20exp−0.21/n∑i=1nxi2−exp1/n∑i=1ncos2πxi+20+e30[-32,32]0F11x=1/4000∑i=1nxi2−∏i=1ncosxi/i+130[-600,600]0F12x=π/n10sinπy1+∑i=1n−1yi−121+sin2πyi+1+yn−12yi=1+x1+1/4,u=xi,a,k,m=kxi−am,xi>a,0,−a<xi<a,k−xi−am,xi<−a30[50,50]0F13x=0.1sin23πxi+∑i=1nxi−121+sin23πxi+1+xi−121+sin22πxi+1+∑i=1nuxi,5,100,430[50,50]0Table 3
Parameter settings of every algorithm.
IndexAlgorithmParameter1AOAN=30, C1=2, C2=6, C3=1, C4=2, Tmax=1002MAOAN=30, C1=2, C2=6, C3=1, C4=2, r1=1.8, r2=0.5, Tmax=1003BOAN=30, conversion probability p=0.6, initial value of a is 0.1, Tmax=1004PSON=30, w decreases linearly in [0.2, 0.9], c1=2, c2=2, Tmax=1005DEN=30, CR=0.1, Tmax=1006MPAN=30, FADs=0.2, P=0.5, Tmax=100Table 4
Test result statistics.
FunctionTypeAOAMAOABOAPSODEMPAF1Mean5.639E−055.492E−099.100E−032.073E+049.588E+034.648E+01Std1.143E−043.313E−082.000E−031.990E+031.692E+032.260E+01F2Mean9.569E−041.016E−053.980E−024.391E+004.021E+012.727E+00Std1.142E−033.098E−051.420E−021.275E+003.951E+005.867E−01F3Mean2.454E−029.931E−088.300E−037.217E+044.328E+042.205E+03Std4.674E−027.045E−071.900E−031.996E+046.230E+031.122E+03F4Mean6.146E−031.825E−051.129E−014.762E+016.458E+016.478E+01Std7.079E−033.676E−051.540E−021.112E+004.003E+004.294E+00F5Mean2.892E+012.891E+012.893E+011.891E+049.356E+068.748E+02Std1.032E−013.498E−023.510E−021.893E+043.099E+064.530E+02F6Mean5.511E+005.566E+005.743E+002.068E+049.574E+035.444E+01Std4.440E−016.852E−016.237E−011.771E+031.677E+032.251E+01F7Mean7.405E−036.257E−031.770E−029.554E−014.545E+002.341E−02Std6.505E−036.086E−037.300E−033.586E−011.402E+001.278E−02F8Mean−5.345E+03−4.129E+03−3.126E+03−2.435E+03−5.770E+03−6.046E+03Std3.835E+034.679E+023.422E+024.923E+023.927E+025.811E+02F9Mean2.497E+012.920E−075.846E+011.064E+022.156E+027.705E+01Std6.370E+011.854E−068.200E+012.240E+011.713E+012.900E+01F10Mean1.637E+014.345E−069.800E−027.056E+001.574E+013.071E+00Std7.670E+001.121E−051.690E−021.086E+006.888E−014.540E−01F11Mean2.150E−012.812E−081.238E−015.673E+028.788E+011.443E+00Std3.083E−012.632E−073.830E−024.728E+011.376E+011.730E−01F12Mean7.449E−016.732E−017.435E−011.580E+014.280E+061.069E+00Std1.868E−011.843E−011.464E−011.449E+013.028E+064.527E−01F13Mean2.958E+002.937E+003.086E+009.261E+032.033E+074.866E+00Std1.048E−011.079E−011.896E−011.508E+048.453E+061.489E+00In Table4, 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 F1,F2,F3,F4,F5,F7,F9,F10,F11,F12,andF13. 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.


## 3.3.3. Complexity Analysis of Algorithm

(1)
Complexity analysis of AOAThe time complexity of AOA is given as follows: Assuming that the population size isn, the dimension of search space is d, and the maximum iteration is T. The population density, volume, acceleration, and initialization complexity are all Ond, the fitness value of calculation complexity is Ond. The exploration and exploitation phases update complexity are OT1+2n+2nlogn. To sum up, the time complexity of the whole algorithm is expressed as
(16)OAOA=5×Ond+OT1+2n+2nlogn.(2)
Complexity analysis of MAOAThe time complexity of MAOA is given as follows: the population, density, volume,P, and acceleration initialization complexity are all Ond, and the fitness value of calculation complexity is Ond. The exploration and exploitation phases update complexity are OT3+2n+2nlogn. To sum up, the time complexity of the whole algorithm is expressed as
(17)OMAOA=6×Ond+OT3+2n+2nlogn.From Equations (16) and (17), compared with the time complexity of AOA, the time complexity of MAOA only increases Ond+OT2.
(3)
Complexity contrast between AOA and MAOAAOA 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 Table5.Table 5
Comparison of execution time.
FunctionTime of AOATime of MAOATotalAverageTotalAverageF10.3851.283E−020.5031.677E−02F20.4581.527E−020.5511.837E−02F30.8432.810E−020.9613.203E−02F40.4231.410E−020.5251.750E−02F50.4781.593E−020.5921.973E−02F60.4131.377E−020.5341.780E−02F70.6682.227E−020.7752.583E−02F80.4981.660E−020.6122.040E−02F90.4631.543E−020.5801.933E−02F100.4681.560E−020.5971.990E−02F110.5151.717E−020.6322.107E−02F121.0913.637E−021.2174.057E−02F131.1123.707E−021.2344.113E−02In Table5, 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.


## 4. 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:
(18)HopSizei=∑i≠jdi,j∑i≠jhi,j,
wheredi,j=xi−xj2+yi−yj2, xi,yi and xj,yj are the location of anchor node i and j, respectively. hi,j denotes the value of minimum hop-count between anchor nodes i and j. Then, Equation (19) is used to calculate the estimated distance between the anchor node i and the unknown node u.
(19)du,i=HopSizei×hu,i,
wherehu,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 fitnessfxu=∑i=1mxu−xi2+yu−yi2−du,i, where xu,yu represents the estimated location of unknown node u and xi,yi 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 Algorithm1.Algorithm 1: The pseudocode of MAOADV-Hop.
1: Procedure MAOADV-Hop;2: Initialization: total number of nodesN, percentage p of anchor nodes, communication radius R;3: Network deployment nodes to generate simulatednetwork topology;4:  Calculate the hop-count valuehi,j according to the shortest path algorithm;5: fork=1 to N6:   fori=1 to N7:     forj=1 to N8:       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:             end11:            end12:          end13: end14:  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: fort=1: Max_iter18:  CalculateTF using Equation (3) and calculate density decline coefficient d using Equation (4);19:  fori=1:N20:   Updatedenit+1 and volit+1 using Equation (15);21:   ifTF<0.522:      Updateaccit+1 using Equation (5) and calculate Xit+1 using Equation (8);23:   else24:    Updateaccit+1 using Equation (6) and calculate Xit+1 using Equation (9);25:   end26: Apply boundary constraints toX and calculate the fitness of X;27: The optimal position of each object is selected and assigned toP, and the corresponding fitness is assigned toPbest;28:  Select the best fitness minimum value, the corresponding positionXbest;29: end30:  The best individual is the location of the unknown node.31: end


### 4.2. Experimental Results

In this section, the simulation is carried out in the square area and C-shaped area of100m×100m deploying sensor nodes by random or uniform. The C-shaped area is formed by digging out a rectangular area of 30m×70m in the square area. MAOADV-Hop is used to estimate the location of the unknown node. The simulation results are shown in Figure 1.Figure 1
Localization error diagram for (a) random deployment of square area, (b) uniform deployment of square area, (c) random deployment of C-shaped area, and (d) uniform deployment of C-shaped area.
(a)(b)(c)(d)In Figure1, 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.
(20)ALE=xuext−xuact2+yuext−yuact2n×R,wherexuext,yuext and xuact,yuact 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.


### 4.3. Localization Algorithm Analysis

#### 4.3.1. Compared with Different Algorithms

We compared the localization error with DV-Hop, DE_DV-Hop, BOA_DV-Hop, and MAOADV-Hop in order to measure the performance of the proposed localization algorithm. The parameter settings of MAOADV-Hop, DE_DV-Hop, and BOA_DV-Hop are shown in Tables6–8.Table 6
Parameter settings of DE_DV-Hop.
ParametersValueNP30Max-iteration200F00.5CR0.2Table 7
Parameter settings of BOA_DV-Hop.
ParametersValueNP30Max-iteration200Probability(p)0.6Initial value ofa,c0.1, 0.01Table 8
Parameter settings of MAOA_DV-Hop.
ParametersValueNP30Max-iteration200C1,C2,C3,C42, 6, 1, 2r1,r21.8, 0.5Experimental analysis is carried out under four different simulation conditions: square random deployment, square uniform deployment, C-shaped random steps, and C-shaped uniform deployment to prove the localization accuracy and convergence speed of the proposed algorithm. The experimental results are shown in Figures2 and 3.Figure 2
(a) Random deployment in square area. (b) Uniform deployment in square area. (c) Random deployment in C-shaped area. (d) Uniform deployment in C-shaped area.
(a)(b)(c)(d)Figure 3
The average value of ALE for the four topologies and algorithms.From Figures2 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.


#### 4.3.2. Effect of Node Density, Anchor Rate, and Communication Radius on ALE

(1)
The effect of node density on ALEIn this section, the experimental area is a100m×100m 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.Figure 4
The effect of node density on ALE.From Figure4, 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 ALEIn this section, the experimental area is a100m×100m 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.Figure 5
The effect of anchor rate on ALE.From Figure5, 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 ALEIn this section, the experimental area is a100m×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.Figure 6
The effect of communication radius on ALE.In Figure6, 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 error of MAOADV-Hop is the smallest in the four algorithms although communication radius is different.


#### 4.3.3. Timing of Localization

In this section, we analyze the CPU time required of the four localization algorithms. The WSN parameter settings are shown in Table9. 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.Table 9
The parameter settings of WSNs.
ParameterValueManner of deploymentRandom deploymentThe number of nodes100Anchor rate0.2Communication radius20Figure 7
The CPU time required of different algorithms.From Figure7, 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.


## 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:
(18)HopSizei=∑i≠jdi,j∑i≠jhi,j,
wheredi,j=xi−xj2+yi−yj2, xi,yi and xj,yj are the location of anchor node i and j, respectively. hi,j denotes the value of minimum hop-count between anchor nodes i and j. Then, Equation (19) is used to calculate the estimated distance between the anchor node i and the unknown node u.
(19)du,i=HopSizei×hu,i,
wherehu,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 fitnessfxu=∑i=1mxu−xi2+yu−yi2−du,i, where xu,yu represents the estimated location of unknown node u and xi,yi 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 Algorithm1.Algorithm 1: The pseudocode of MAOADV-Hop.
1: Procedure MAOADV-Hop;2: Initialization: total number of nodesN, percentage p of anchor nodes, communication radius R;3: Network deployment nodes to generate simulatednetwork topology;4:  Calculate the hop-count valuehi,j according to the shortest path algorithm;5: fork=1 to N6:   fori=1 to N7:     forj=1 to N8:       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:             end11:            end12:          end13: end14:  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: fort=1: Max_iter18:  CalculateTF using Equation (3) and calculate density decline coefficient d using Equation (4);19:  fori=1:N20:   Updatedenit+1 and volit+1 using Equation (15);21:   ifTF<0.522:      Updateaccit+1 using Equation (5) and calculate Xit+1 using Equation (8);23:   else24:    Updateaccit+1 using Equation (6) and calculate Xit+1 using Equation (9);25:   end26: Apply boundary constraints toX and calculate the fitness of X;27: The optimal position of each object is selected and assigned toP, and the corresponding fitness is assigned toPbest;28:  Select the best fitness minimum value, the corresponding positionXbest;29: end30:  The best individual is the location of the unknown node.31: end


## 4.2. Experimental Results

In this section, the simulation is carried out in the square area and C-shaped area of100m×100m deploying sensor nodes by random or uniform. The C-shaped area is formed by digging out a rectangular area of 30m×70m in the square area. MAOADV-Hop is used to estimate the location of the unknown node. The simulation results are shown in Figure 1.Figure 1
Localization error diagram for (a) random deployment of square area, (b) uniform deployment of square area, (c) random deployment of C-shaped area, and (d) uniform deployment of C-shaped area.
(a)(b)(c)(d)In Figure1, 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.
(20)ALE=xuext−xuact2+yuext−yuact2n×R,wherexuext,yuext and xuact,yuact 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.


## 4.3. Localization Algorithm Analysis

### 4.3.1. Compared with Different Algorithms

We compared the localization error with DV-Hop, DE_DV-Hop, BOA_DV-Hop, and MAOADV-Hop in order to measure the performance of the proposed localization algorithm. The parameter settings of MAOADV-Hop, DE_DV-Hop, and BOA_DV-Hop are shown in Tables6–8.Table 6
Parameter settings of DE_DV-Hop.
ParametersValueNP30Max-iteration200F00.5CR0.2Table 7
Parameter settings of BOA_DV-Hop.
ParametersValueNP30Max-iteration200Probability(p)0.6Initial value ofa,c0.1, 0.01Table 8
Parameter settings of MAOA_DV-Hop.
ParametersValueNP30Max-iteration200C1,C2,C3,C42, 6, 1, 2r1,r21.8, 0.5Experimental analysis is carried out under four different simulation conditions: square random deployment, square uniform deployment, C-shaped random steps, and C-shaped uniform deployment to prove the localization accuracy and convergence speed of the proposed algorithm. The experimental results are shown in Figures2 and 3.Figure 2
(a) Random deployment in square area. (b) Uniform deployment in square area. (c) Random deployment in C-shaped area. (d) Uniform deployment in C-shaped area.
(a)(b)(c)(d)Figure 3
The average value of ALE for the four topologies and algorithms.From Figures2 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.


### 4.3.2. Effect of Node Density, Anchor Rate, and Communication Radius on ALE

(1)
The effect of node density on ALEIn this section, the experimental area is a100m×100m 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.Figure 4
The effect of node density on ALE.From Figure4, 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 ALEIn this section, the experimental area is a100m×100m 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.Figure 5
The effect of anchor rate on ALE.From Figure5, 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 ALEIn this section, the experimental area is a100m×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.Figure 6
The effect of communication radius on ALE.In Figure6, 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 error of MAOADV-Hop is the smallest in the four algorithms although communication radius is different.


### 4.3.3. Timing of Localization

In this section, we analyze the CPU time required of the four localization algorithms. The WSN parameter settings are shown in Table9. 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.Table 9
The parameter settings of WSNs.
ParameterValueManner of deploymentRandom deploymentThe number of nodes100Anchor rate0.2Communication radius20Figure 7
The CPU time required of different algorithms.From Figure7, 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.


## 4.3.1. Compared with Different Algorithms

We compared the localization error with DV-Hop, DE_DV-Hop, BOA_DV-Hop, and MAOADV-Hop in order to measure the performance of the proposed localization algorithm. The parameter settings of MAOADV-Hop, DE_DV-Hop, and BOA_DV-Hop are shown in Tables6–8.Table 6
Parameter settings of DE_DV-Hop.
ParametersValueNP30Max-iteration200F00.5CR0.2Table 7
Parameter settings of BOA_DV-Hop.
ParametersValueNP30Max-iteration200Probability(p)0.6Initial value ofa,c0.1, 0.01Table 8
Parameter settings of MAOA_DV-Hop.
ParametersValueNP30Max-iteration200C1,C2,C3,C42, 6, 1, 2r1,r21.8, 0.5Experimental analysis is carried out under four different simulation conditions: square random deployment, square uniform deployment, C-shaped random steps, and C-shaped uniform deployment to prove the localization accuracy and convergence speed of the proposed algorithm. The experimental results are shown in Figures2 and 3.Figure 2
(a) Random deployment in square area. (b) Uniform deployment in square area. (c) Random deployment in C-shaped area. (d) Uniform deployment in C-shaped area.
(a)(b)(c)(d)Figure 3
The average value of ALE for the four topologies and algorithms.From Figures2 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.


## 4.3.2. Effect of Node Density, Anchor Rate, and Communication Radius on ALE

(1)
The effect of node density on ALEIn this section, the experimental area is a100m×100m 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.Figure 4
The effect of node density on ALE.From Figure4, 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 ALEIn this section, the experimental area is a100m×100m 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.Figure 5
The effect of anchor rate on ALE.From Figure5, 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 ALEIn this section, the experimental area is a100m×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.Figure 6
The effect of communication radius on ALE.In Figure6, 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 error of MAOADV-Hop is the smallest in the four algorithms although communication radius is different.


## 4.3.3. Timing of Localization

In this section, we analyze the CPU time required of the four localization algorithms. The WSN parameter settings are shown in Table9. 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.Table 9
The parameter settings of WSNs.
ParameterValueManner of deploymentRandom deploymentThe number of nodes100Anchor rate0.2Communication radius20Figure 7
The CPU time required of different algorithms.From Figure7, 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.


## 5. Conclusions and Future Work

### 5.1. 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


## 5.1. 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



---

*Source: 7026728-2022-06-07.xml*