An Enhanced Flower Pollination Algorithm with Gaussian Perturbation for Node Location of a WSN

Localization is one of the essential problems in internet of things (IoT) and wireless sensor network (WSN) applications. However, most traditional range-free localization algorithms cannot fulfill the practical demand for high localization accuracy. Therefore, a localization algorithm based on an enhanced flower pollination algorithm (FPA) with Gaussian perturbation (EFPA-G) and the DV-Hop method is proposed.FPA is widely applied, but premature convergence still cannot be avoided. How to balance its global exploration and local exploitation capabilities still remains an outstanding problem. Therefore, the following improvement schemes are introduced. A search strategy based on Gaussian perturbation is proposed to solve the imbalance between the global exploration and local exploitation search capabilities. Meanwhile, to fully exploit the variability of population information, an enhanced strategy is proposed based on optimal individual and Lévy flight. Finally, in the experiments with 26 benchmark functions and WSN simulations, the former verifies that the proposed algorithm outperforms other state-of-the-art algorithms in terms of convergence and search capability. In the simulation experiment, the best value for the normalized mean squared error obtained by the most advanced algorithm, RACS, is 20.2650%, and the best value for the mean distance error is 5.07E+00. However, EFPA-G reached 19.5182% and 4.88E+00, respectively. It is superior to existing algorithms in terms of positioning, accuracy, and robustness.


Introduction
Over recent decades, as the technologies of the internet of things (IoT) have become more and more sophisticated, the intelligent perception and management of objects can be realized through the connection of things and people [1]. Wireless sensor networks (WSNs) have been playing an increasingly significant role in the IoT with their functions such as real-time sensing, collecting, and processing of information. The inherent characteristics of the node location make it an essential prerequisite for many functions. With the demand for location-based services developing rapidly, the accuracy of node localization affects numerous practical application areas, such as smart homes [2], city surveillance [3], fault diagnosis [4], etc.
The localization methods can be classified into range-based [5] and range-free [6] localization methods based on whether the actual measurement of the distance between nodes is necessary. The former achieves the estimation of the distance between nodes based on the angle of arrival [7], time of arrival [8], and time difference of arrival [9] of the signal or based on the received signal strength. Although this type of method has high positioning accuracy, it requires additional equipment to achieve the corresponding measurement, which is costly and not suitable for monitoring of large areas. The latter on Lévy flight is proposed to improve the search capability of the algorithm. An imbalance in the search capability exists between the global exploration and local exploitation of the traditional FPA, which results in the local exploitation struggling to contribute to a faster convergence speed of the algorithm during the iterations. Therefore, this paper proposes a Gaussian perturbation strategy for improving the search ability of the local exploitation. Extensive experimental results on the benchmark optimization problems show that the proposed EFPA-G algorithm outperforms other state-of-the-art improved metaheuristic optimization algorithms. Satisfactory localization accuracy is also achieved in the WSN simulation experiments.
The major contributions of this article are stated as follows: (1) A localization algorithm based on the enhanced flower pollination algorithm with Gaussian perturbation and the DV-Hop method is proposed. The superiority and robustness of the proposed algorithm are verified by extensive simulation experiments. The remainder of this paper is presented as follows: The FPA and the DV-Hop method are described in Section 2. The proposed EFPA-G algorithm is described in detail in Section 3. The simulation results and comparisons of the approaches are shown in Section 4. Finally, conclusions are presented in Section 5.

DV-Hop Method
The distance vector hop (DV-Hop) localization algorithm is based on the distance vector exchange protocol to obtain hop counts for node localization. The DV-Hop algorithm is widely used in WSN node localization because of its relatively simple implementation [30], which only requires the use of hop counts and distance vector estimates to calculate the nodes' positions. No additional hardware or measurement costs are necessary, making it easy to implement and apply in large-scale wireless sensor networks, including dense and sparse networks. Additionally, it can handle situations such as partial node failures compared to other algorithms. The algorithm uses hop counts and distance vector estimates to calculate the nodes' positions, which can be measured and transmitted by multiple nodes, thereby improving the measurement's reliability and accuracy. Combining the proposed algorithm with the DV-Hop algorithm increases the algorithm's robustness and improves its localization accuracy.

Calculating the Minimum Number of Hops
The anchor node broadcasts its own packet to the whole network by flooding, and the packet contains the anchor node's location information and hop value. The unknown node receives the packet from the anchor node and updates its hop count information, adds 1 to the packet's hop value and saves it. To ensure that all nodes in the network have access to the minimum hop count h ui information of each anchor node, the node receiving the packet only needs to keep the packet with the smaller hop count.

Estimating the Distance between Anchor Nodes and Unknown Nodes
After each anchor node receives the coordinates of other anchor nodes and the minimum number of hops, it calculates its average hop distance according to Equation (1).
where (x, y) represents the coordinates of the anchor nodes, h ij represents the number of hops between anchor nodes i and j, and Hopsize i represents the average hop distance of anchor node i.

Estimating Unknown Node Coordinates
The estimated distance d ui is calculated using Equation (1), and then combined with the least squares method to estimate the position of the unknown node, as shown in Equation (2).
where (x, y) denotes the coordinates of the unknown node and d denotes the distance between the unknown node and the anchor node. By subtracting the first term from the previous term and splitting it, the form AX = B is obtained, where A, B, and X are shown in Equations (3)∼(5), respectively.
Finally, the estimated coordinates of the unknown nodes are obtained by Equation (6).

Flower Pollination Algorithm
The flower pollination algorithm (FPA) is a metaheuristic optimization algorithm based on the pollination process in nature. The FPA uses adaptive parameters and adaptive operators, which can dynamically adjust parameters according to the characteristics of the problem and the search process, thereby improving the robustness and adaptability of the algorithm. It is highly robust, and can handle noisy data and complex problems with multiple variables and constraints by using probabilistic methods to explore different regions of the search space. It can quickly converge to a satisfactory solution, reducing calculation time and cost. Because its implementation is relatively simple and can be quickly applied to the solution of various practical problems, it is widely used in various fields such as optimization, classification, and clustering. It mainly consists of global pollination and self-pollination, which can also be called global exploration and local exploitation.

Global Pollination
Global pollination, that is, cross-pollination, is usually based on biology. Pollen is spread over long distances by pollinators such as birds, insects, bees, or bats. Its spread can be modeled using the Lévy distribution, as shown in Equation (7).
where x best represents the optimal solution, x t i represents the i-th solution of the t-th generation, and lévy represents the Lévy flight step length, as shown in Equation (8).
where Γ(λ) represents the standard gamma function, λ = 1.5, parameter s is calculated using Equation (9), and µ and v are random numbers subject to Gaussian distribution. µ is the distribution with the mean zero variance of σ 2 . The parameter σ is calculated using Equation (10).

Local Pollination
Local pollination, that is, self-pollination, is pollination by abiotic and other factors, so the spread range is small, and pollination is often completed around itself, as shown in Equation (11).
where x t j and x t k are pollen from different flowers of similar flowering plants, i.e., two solutions randomly selected from the population, and ε is a random variable that follows a uniform distribution.

Transition Probability
The algorithm randomly switches between the two processes of exploitation and exploration by transition probability P to determine the type of flower pollination (i.e., global or local search process) to ensure the quality of the search. When the random probability is less than the transition probability, self-pollination is performed, otherwise the cross-pollination process is performed.

Proposed EFPA-G Approach
An enhanced flower pollination algorithm with Gaussian perturbation (EFPA-G) is proposed to avoid premature convergence of the FPA algorithm and to improve the performance of the FPA algorithm on complex optimization problems.

Enhanced Strategy
In traditional FPAs, global exploration relies only on Levy flights to carry out global optimization, but the search capability is not sufficient to accomplish high-precision optimization in late iterations. In addition, the Lévy flight only exploits the difference between the optimal solution and the candidate solution, without utilizing the global search information of the population as a whole, resulting in a waste of information. Therefore, an enhanced strategy based on Lévy flight is proposed in this paper to accommodate the requirements of the algorithm for high-precision search optimization in the late iterations, as shown in Equation (12).
where δ represents the iteration-based weights, as shown in Equation (13), and lévystep is the leap distance based on the Lévy flight, as shown in Equation (14).
where t and Iter denote the current iteration number and the maximum iteration number, respectively. α is a constant, and α = 0.05, x t k represents the randomly selected individuals in the t-th generation.

Gaussian Perturbation
The enhanced strategy based on Levy flight further improves the search capability of the FPA's global exploration, but cannot satisfy the needs of large-scale optimization problems, and further increases the imbalance between global exploration and the local development search capability. Therefore, how to enhance the search capability of local exploitation becomes particularly more significant.
In Equation (11), x performs a modification of its own information based only on the information difference with the other two candidate solutions in the population. In addition, the Gaussian distribution alters its curve according to the variation in the mean and variance, which indicates the stability while being random. Therefore, employing a Gaussian distribution in the iteration to achieve perturbation of the population is practicable. In this paper, an optimal search strategy based on Gaussian perturbation is proposed, as shown in Equation (15).
where x t best represents the t-th generation optimal solution and ζ is defined by Equation (17).
where x best represents the global optimal solution. With respect to the designed Gaussian perturbation, it is designed to maintain stability throughout the iterations while further perturbing x over a large range, thus permitting the algorithm to leap out of local extremes.

Objective Function
For the proposed EFPA-G algorithm to be more applicable to WSN node localization, the localization problem is transformed into the problem of minimizing the difference between the estimated and actual locations, i.e., the localization error minimization problem, as shown in Equation (18).
where N a is the number of anchor nodes, and a is the reciprocal of the minimum number of hops between the estimated unknown (x, y) and the anchor node (x i , y i ). d 2 i denotes the actual distance between the unknown node and the anchor node.

EFPA-G Algorithm
According to the previous theory, this section focuses on detailing the framework of the proposed enhanced flower pollination algorithm with Gaussian perturbation, as shown in Algorithm 1.

Complexity Analysis
This section focuses on the complexity analysis in two parts, the DV-Hop method and the EFPA-G algorithm. In the DV-Hop method, the total number of nodes is n and the number of anchor nodes is m. The complexity of the minimum hop count estimation between nodes is O n 3 , the complexity of the actual distance calculation between nodes is O(n × m), the complexity of the distance between unknown nodes and anchor nodes is N, and the complexity of the likelihood estimation method is O (n − m) 4 . In the EFPA-G algorithm, the dimension of the objective function is D. The complexity of the proposed algorithm is O(Iter × N × D). By replacing the likelihood estimation method in DV-Hop by the proposed EFPA-G algorithm, the complexity of the final WSN node localization

Numerical Results and Discussions
The performance of the proposed algorithm is verified using 26 well-known benchmark functions, and the superiority of the proposed algorithm is confirmed by comparison with other state-of-the-art metaheuristic optimization algorithms. In addition, the performance of the EFPA-G algorithm is tested in a WSN simulation for real optimization problems.

Parameters Settings
In this section, we discuss the performance of the proposed EFPA-G and other stateof-the-art optimization algorithms as follows.
For the sake of fairness, the mentioned algorithms are all run 30 times independently with the same population size N = 50 and the termination condition is the maximum number of iterations. The maximum number of iterations is set to 1000 for the numerical experiments and to 200 for the WSN simulation experiments.

Benchmark Test
To test the proposed EFPA-G apporach, 26 benchmark functions are available which are divided into unimodal functions ( f 1 ∼ f 12 ) and multimodal functions ( f 13 ∼ f 26 ). The former reveals the exploitation performance of the algorithm, while the latter challenges the exploration capability of the algorithm. Details of the benchmark functions are shown in Table 1. In addition, to test the optimization performance of the proposed algorithm for benchmark functions of different dimensions, experiments are conducted using D = 30 and D = 50. Step Generalized penalized function 1 10,100,4) [−50, 50] 0 Generalized penalized function 2 5,100,4) [−50, 50] 0 Periodic Xin-She Yang 2 Styblinski-Tank To highlight the superiority and robustness of the proposed EFPA-G algorithm, this section compares the convergence curves and search accuracy of the algorithm from two aspects. The computational accuracy results of the proposed EFPA-G algorithm and the compared algorithms are shown in Table 2. The mean and standard deviation are compared to reflect the robustness of the algorithms. Lower values of the mean and standard deviation indicate better robustness. The optimal results are highlighted in bold and marked. The convergence curves are shown in Figures 1 and 2. Bold values indicate that the function is optimal in experimental comparisons.  Based on the results from the 12 unimodal functions in Table 2, it is observed that the proposed EFPA-G algorithm can match 0.00E+00 (the optimal values) for all the six unimodal functions tested ( f 1 , f 3 , f 6 , f 8 , f 9 , and f 11 ). The other functions ( f 2 , f 4 , f 7 ) are ahead of the other comparison algorithms even though they do not achieve the optimal values. However, in the f 10 function, the optimal values are obtained for the MPSO, MPA, and RACS algorithms, The mean reached −5.00E+00, and the standard deviations were 0.00E+00, 1.77E-12, and 6.26E-10, respectively. The presence of a large number of local extremes in the multimodal functions provides a better evaluation of the search performance of the proposed EFPA-G algorithm. From the experimental results of the 14 multimodal functions ( f 13 ∼ f 26 ) in Table 2, the performance of the proposed EFPA-G algorithm outperforms the other comparison algorithms obviously. For the five multimodal functions ( f 14 ∼ f 16 , f 19 , and f 22 ), the proposed EFPA-G algorithm is able to obtain the optimal values. The proposed EFPA-G algorithm obtains the first rank in both average and standard deviation for all the nine multimodal functions ( f 13 ∼ f 16 , f 19 , f 20 , and f 22 ∼ f 24 ). Therefore, in the testing of 26 benchmark functions, the mean and standard deviation of EFPA-G in 30 experiments were mostly optimal. This indicates that EFPA-G has superior robustness compared to the compared algorithms.
The convergence curves of the 10 unimodal functions in Figures 1 and 2 show that the proposed EFPA-G algorithm outperforms the other compared algorithms in terms of convergence speed. The proposed EFPA-G algorithm converges much more quickly than the other compared algorithms in the seven unimodal functions ( f 1 ∼ f 4 , f 6 , f 8 , and f 9 ). In the six multimodal functions ( f 14 ∼ f 16 , f 19 , f 23 , and f 24 ), the convergence speed of the proposed EFPA-G algorithm obtains the first rank. In the other benchmark functions, the proposed EFPA-G algorithm obtained a satisfactory ranking.
From Table 2 and Figures 1 and 2, it can be observed that the proposed EFPA-G algorithm exerts the exploitation capability in dealing with single-peaked functions and the exploration capability in dealing with multi-peaked functions.

D = 50
To test the sensitivity of the proposed EFPA-G algorithm in solving the same problem with different dimensions, this paper modifies the dimension D to 50 for the experiment, and the corresponding experimental results are shown in Table 3. Comparing the experimental results in Tables 2 and 3.
For  Bold values indicate that the function is optimal in experimental comparison results.
Overall, the proposed algorithm EFPA-G still has stable performance and the best robustness in development and exploration with dimension D = 50.

Simulation for WSN
In this section, two different WSN models of general-shape networks and O-shape networks are adopted to test the sensitivity of the proposed EFPA-G localization algorithm to different node distributions, as shown in Figure 3, both with 100 nodes in a 100 m × 100 m square area. Firstly, the localization accuracy and robustness of the proposed EFPA-G algorithm are demonstrated by a general simulation. Then, the localization accuracy of the proposed algorithm is tested for different anchor node proportions and node communication radii. The normalized root mean square error (NRMSE) and the mean distance error (MDE) are considered as metrics to evaluate the performance of the proposed algorithm, as shown in Equations (19) and (20).
where (x i , y i ) and (x i ,ŷ i ) denote the real and estimated coordinates of regular node i, respectively. R and N r denote the communication radius and the number of unknown nodes, respectively.
where d ki andd ki are the real distance and estimated distance between anchor node k and unknown node i, respectively. N a denotes the number of anchor nodes.

General Simulation
In this subsection, the proportion of anchor nodes is set to 30%, the number of unknown nodes is 70, and the node communication radius is 25 m. The experimental results are shown in Table 4, and the optimal solutions are marked in bold. The comparison results between the proposed EFPA-G and other comparison algorithms for the localization error of each unknown node are shown in Figures 4 and 5.
From the experimental results in Table 4, it can be seen that under different node distribution conditions, the NRMSE and MDE obtained by the traditional DV-Hop positioning method achieved the worst positioning accuracy, of 31.2086% and 7.80E+00, respectively, which indicates that the performance of the metaheuristic optimization algorithm is better than the least squares method. For networks of different shapes, the EFPA-G algorithm obtains the first rank of mean and optimal values on NRMSE and MDE, with the lowest reaching 19.5182% and 4.88E+00. The "std" values of MPA and RACS are smaller than EFPA-G, which means that the former is more stable in 30 experiments. However, the proposed algorithm for node location pays more attention to positioning ac-curacy. Figures 4 and 5 also intuitively observe that the EFPA-G algorithm has the smallest positioning error, especially at low anchor ratios.

Effect of the Proportion of Anchor Nodes
In this subsection, the performance of the proposed algorithm is tested by gradually changing the proportion of anchor nodes (10%, 20%, 30%, and 40%) without changing the WSN model and the communication radius of the nodes. The experimental results are shown in Table 5. As the proportion of anchor nodes increases, the NRMSE of WSN node localization decreases, but this does not necessarily mean that a higher number of anchor nodes in the WSN model will result in higher localization accuracy. For example, in a general-shaped network, the NRMSE of the DV-Hop method increases from 30.12% to 30.48% as the proportion increases from 30% to 40%. In an O-shaped network, the NRMSE values of all metaheuristic localization methods first decrease and then increase as the proportion of anchor nodes increases. Overall, the proposed EFPA-G algorithm performs better in terms of overall performance for different networks when the proportion of anchor nodes is 30%.

Effect of Node Communication Radius
The sensitivity of the proposed EFPA-G algorithm to different communication radii is tested by gradually changing the communication radius of the nodes (15 m, 20 m, 25 m, and 30 m) without changing the WSN model and the proportion of anchor nodes. Table 6 shows the experimental results for different communication radii. As the communication radius of the nodes increases, the NRMSE values generally decrease in a general-shaped network. In an O-shaped network, the NRMSE values first decrease and then increase, indicating that blindly increasing the communication radius cannot guarantee an improvement in node localization accuracy. Instead, it places higher demands on hardware equipment and leads to wastage of resources. However, for both a generalshaped network and O-shaped network, the other compared methods obtain very close NRMSE values. This indicates that the FPA, CMFPA, MPA, and RACS algorithms have similar local exploitation capabilities in solving real optimization problems. The NRMSE obtained by the proposed EFPA-G algorithm ranked first with the changing radius of node communication, which suggests that the algorithm has superior performance in solving practical problems. Overall, EFPA-G outperforms state-of-the-art algorithms in terms of accuracy and robustness against network anisotropy. Bold values indicate that the algorithm achieves the best in the experimental comparison results.

Conclusions
This paper proposed a localization algorithm based on an enhanced flower pollination algorithm with Gaussian perturbation (EFPA-G) and the DV-Hop method. Firstly, the highly adaptive and parallel computing capabilities, and ease of implementation and application of the flower pollination algorithm were utilized to achieve sensor node localization. Subsequently, an enhanced strategy based on Lévy flight was proposed to address the problems of the difficulty in escaping from local extreme values, sensitivity to initial values, and possible over-exploration in the later iterations. By leveraging the diversity of the Lévy flight step length and the ability to avoid the influence of noisy data by jumping over long distances, the robustness of the flower pollination algorithm was improved. Then, a Gaussian perturbation strategy was proposed to address the critical imbalance between global exploration and local exploitation search capabilities of the flower pollination algorithm. The Gaussian distribution alters its curve according to the variation in the mean and variance, to improve the search capability, a large-scale population perturbation was implemented. Benchmark function experiments and WSN simulation experiments were conducted. The benchmark function experiments demonstrated that the proposed algorithm can achieve good search accuracy and convergence speed in different modes of benchmark functions. In the WSN simulation experiments, the proposed EFPA-G algorithm achieved lower localization error compared to similar algorithms such as PACS and MPA, which have been used in recent years, indicating better robustness. The main drawback of the proposed algorithm is that it depends on multiple complicated calculations, which may increase the overheads and power costs. Therefore, the proposed algorithm is more suitable for applications where there is little restriction of power consumption and overheads.