The benchmark functions of the optimization experiment were the CEC function from [
17,
18], which includes a total of 23 functions, of which F1 to F7 are unimodal functions, F8 to F13 are multimodal functions, and F14 to F23 are fixed-dimensional functions; the corresponding categories are U, M, and Fixed, respectively. Detailed descriptions of all 23 functions are provided in
Table 2. The experimental environment was a Windows 10 system with an Intel(R) Core (TM) i5-10210U CPU @2.11 GHz, 16 GB memory, and the Matlab 2018a platform.
5.2. Analysis of Benchmark Function Results
The 2D optimization process of the BBO algorithm for certain test functions (TF1, TF4, TF10, and TF23) was described through a visual experiment. The main aim was to qualitatively observe the behavior of the BBO. The shape of the test function, the search history, and the convergence curves of individuals are shown in
Figure 3. The search history presents the location history of individual butterflies during an optimized search process. The convergence curve shows the target value of the optimal obtained in each iteration.
The individuals’ search history position in
Figure 3 shows that there is a gradual approach to the optimal position during the optimization process. This ensures that the BBO continues to explore and exploit the search space, eventually converging to an optimal point. Compared with the convergence curves for the ABO and BOA in
Figure 3, the BBO enhances the initial random population on the test function and ideally improves the accuracy of the approximate optimal value during the iterative process.
Table 4 shows the optimization results of eight comparison algorithms, including a statistical analysis of the Best, Mean, and Ranking of the comparison methods via the statistical results. Here, Best reflects the optimal searchability of BBO for solving numerical optimization problems; the closer the search value is to the value in theory, the better the search performance of the considered approach. The optimization results of the four high-dimensional test functions that reach the theoretical optimal value are TF1, TF3, TF9, and TF11. From the Mean in
Table 4, it can be seen that the results of BBO on eight test functions are better than those of the other algorithms, while on nine test functions the optimization results of BBO have the same optimal value as the comparison algorithms. Moreover, the Std objectively shows the stability of the compared methods for solving numerical optimization problems. The results indicate that BBO has high stability and strong generalization ability for numerical optimization problems. From the statistical results of the Friedman test in
Table 4, the order of the eight comparison algorithms for the 23 CEC functions is
.
Notably, the optimization results for the BOA on test functions TF8, TF16, TF19, and TF20 are marked NAN. The reason for this is due to the insufficient design of the BOA. The odor perception value of actual butterflies is positive, and the BOA does not take this into account. It is worth noting that this is a crucial motivation behind our proposed BBO algorithm. In the proposed BBO, the individual’s smell perception value is positive; thus, there is no NAN in the optimization result value.
5.3. Analysis of the NLO Problem Results
The BBO algorithm was used to optimize DV-Hop to address the deficiency of the least squares method for the WSN NLO problem. The BBO-DV-Hop localization optimization method obtained better localization accuracy of an unknown node. The anchor nodes were deployed first, then BBO-DV-Hop was utilized to locate the unknown node’s position based on the known coordinates of the anchor nodes. The pseudo-code of the NLO problem via the BBO-DV-Hop algorithm is provided in Algorithm 2.
Algorithm 2: Pseudo-code of BBO-DV-Hop |
|
The Average Location Error (ALE) evaluation criteria can be expressed as
where
and
represent the estimated and actual position coordinates, respectively, of unknown node
u,
R denotes the communication radius of the nodes, and
n represents the number of unknown nodes.
Aiming at the NLO problem in WSNs, the parameters used in this simulation experiment are presented in
Table 6. The positions of all nodes are obtained by continuous optimization of the BBO. The deployment area is a 100 m × 100 m square area with 100 nodes, including 20 anchor nodes and 80 unknown nodes, for a rate of anchor nodes to total nodes of 20%. In addition, the communication radius
of the anchor nodes is set to 30 m and the communication radius
of the unknown nodes is set to 20 m.
Figure 4 shows the simulation results for the initial nodes, with a red “∆” denoting an anchor node and a blue “o” indicating an unknown node. Five comparison algorithms were used to demonstrate the effectiveness of the proposed BBO on the NLO problem in WSNs: PSO, GWO, ABO, BOA, and BBO. Notably, ABO, BOA, and BBO are all inspired by the behaviors of butterflies. The parameters of the comparison methods are shown in
Table 3. The maximum iteration
for solving the NLO problem was set to 200.
From
Figure 4, the positions of unknown nodes can be calculated from the known positions of the anchor nodes. The initial anchor node positions directly affect the positioning of the entire node structure, with uniform anchor node positions resulting in a uniform deployment network. In
Figure 4a, it can be seen that the network is affected by anchor nodes; local nodes are stacked or located too close together, leading to redundant nodes during the networking process. Although the network nodes in
Figure 4b have good connectivity, there are a small number of local nodes. In the upper right corner of
Figure 4b only two nodes are connected, leading to the loss of node information. Therefore, in node localization the positions of the initial anchor nodes need to be fully considered; certain movable nodes can be deployed among the unknown nodes for greater robustness, thereby improving the overall life and anti-interference ability of the WSN.
From
Figure 5, it can be seen that in terms of the convergence and speed of the compared localization algorithm the order is
. The location error curve of BBO-DV-Hop in the region is relatively smooth after about twenty iterations, which suggests that the proposed BBO-DV-Hop is not likely to fall into local optimal values and has good global convergence ability. On the other hand, the location errors of the PSO and GWO algorithms are relatively high, and gradually become stable after 20 iterations, which indicates that the performance of the proposed BBO-DV-Hop needs to be further modified. The BOA shows large fluctuations before 100 iterations, which suggests that the stability of the BOA needs to be enhanced. In general, while the use of SI algorithms to optimize the NCO problem is a research direction that has received much attention, not all of these algorithms are effective. In actual node positioning deployment, the relocation and the second positioning of mobile nodes could be considered, and design and research could be carried out in combination with optimization algorithms.
In addition, considering the effects on the location of unknown nodes of the number of deployed nodes, rate of anchor nodes, and communication radius, three sets of experiments were designed to compare BBO to PSO, GWO, ABO, and BOA.
Figure 6 shows the results of the three experimental parameter settings.
In
Figure 6a shows the experimental results for an anchor node rate of 20%, communication radius
of 30 m, and total number of nodes of 80, 100, 120, 140, 180, and 200. The results show that the trend of LE curves for the compared algorithms is essentially the same. The results obtained with the PSO algorithm fluctuate greatly when the number of nodes is 120 or 140; on the other hand, the BBO algorithm proposed in this study has stable performance, and its LE is the smallest among the compared algorithms.
From
Figure 6b, it can be seen that when the number of nodes is 100 and the communication radius
is 30 m, the anchor point rates are 15%, 20%, 25%, 30%, 35%, 40%, and 45%, respectively, in the node localization optimization simulation experiment. The results show that the LE curves of the compared algorithms are essentially the same. The LE decreases with an increasing anchor node rate, demonstrating that a higher number of anchor nodes allows for more accurate positioning of the unknown nodes. Among the compared algorithms, the location error of PSO is essentially unchanged for anchor node rates of 20%, 25%, and 30%. The proposed BBO algorithm has stable performance, and its location error is the smallest among the compared algorithms.
Figure 6c shows the results of the simulated node localization optimization experiments when the number of nodes is 100, the anchor node rate is 20%, and the communication radius
is 20 m, 25 m, 30 m, 35 m, 40 m, 45 m, and 50 m. These results show that the LE curves of the compared algorithms are essentially the same. The location error decreases with the increase in the anchor node communication radius when
is less than or equal to 30 m. Moreover, the location error shows an overall upward trend when
exceeds 30 m. Again, the proposed BBO algorithm has stable performance and its LE is the smallest among the comparison algorithms.
5.4. Analysis of the NCO Problem Results
To verify the effectiveness of the BBO with the parameter
for solving the NCO problem, we used a deployment area of 100 m × 100 m in the simulation experiments and we performed the following experiments: (1) by randomly deploying 40 and 45 nodes with sensing radius
m and communication radius
m, we analyzed the coverage optimization performance of BBO over different numbers of iterations using both the time and coverage; (2) BBO’s performance when deploying a different number of nodes was analyzed using random deployment of nodes with sensing radius
m and communication radius
m over 100 iterations; (3) through random deployment, BBO’s performance with a different communication radius was analyzed with 20 nodes over 100 iterations. The pseudo-code of the NCO problem based on the BBO algorithm can be seen in Algorithm 3.
Algorithm 3: Pseudo-code of BBO for the NCO problem |
|
From
Table 7, when the number of nodes is 40 and the sensing radius is 10 m, the coverage results based on the BBO algorithm corresponding to 100, 150, 200, and 500 iterations are 95.79%, 96.62%, 96.67%, and 96.99%, respectively. The time consumption of the best position of the output node is 17.17 s, 24.48 s, 31.50 s, and 79.56 s, respectively. The coverage and time consumption of nodes show an increasing trend. The coverage of the points increases by 0.82%, 0.05%, and 0.32%, respectively, year-on-year, while the year-on-year time consumption increases by 7.32 s, 7.01 s, and 48.06 s, respectively. When the number of nodes is 45 and the sensing radius is 10 m, the coverage optimization results based on the BBO algorithm corresponding to 100, 150, 200, and 500 iterations are 97.76%, 98.50%, 98.56%, and 98.82%, respectively. The time consumption of the best position of the output node is 21.87 s, 28.38 s, 37.29 s, and 86.35 s, respectively. The coverage and time consumption of nodes show an increasing trend. The year-on-year coverage of the points increases by 0.75%, 0.06%, and 0.26%, respectively, while the year-on-year time consumption increases by 6.51 s, 8.91 s, and 49.06 s, respectively. Based on the two scenarios with the same number of iterations, when the number of nodes increases, the node coverage optimization of BBO is significantly improved, although the time consumption is increased.
From
Table 8, it can be seen that when the sensing radius is 10 m and the deployment area is 100 m × 100 m, the coverage optimization results based on the BBO algorithm correspond to a node coverage of 95.79%, 97.76%, and 98.29% for 40, 45, and 50 nodes, respectively. The time consumption of the best node position is 17.17 s, 21.87 s, and 25.83 s, respectively. The coverage is 1.96 percentage points higher with 45 nodes than with 40 nodes, and is 0.54 percentage points higher with 50 nodes than with 45 nodes. The year-on-year time consumption increased by 4.70 s and 3.96 s, respectively. In addition, these results show that the optimized coverage is significantly improved when the number of deployment nodes is increased within a certain range. The coverage growth is slow until saturation when the number of nodes is increased in transition.
Table 9 shows that when the deployment area is 100 m × 100 m with 20 deployment nodes, the coverage rates obtained with BBO corresponding to a sensing radius of 13 m, 14 m, and 15 m are 91.67%, 97.15%, and 99.38%, respectively. The time consumption of the best position of the output node is 6.07 s, 6.13 s, and 5.67 s, respectively. The year-on-year node coverage of the points increases by 6.48% and 2.23%, respectively. The time consumption of the BBO algorithm for node position optimization is less sensitive to the change in the sensing radius, especially when the perception radius is 15 m, and the simulation time consumption decreases by 0.46 s year-on-year. In addition, these experimental results show that when the number of nodes is fixed, an increase in the sensor radius increases coverage and decreases time consumption. Thus, when the deployment area is the same and the sensing radius is excessively large, the number of deployment nodes should be reduced.
To assess the superiority of the proposed BBO algorithm for solving the NCO problem, we selected four SI algorithms as comparison methods namely, PSO, GWO, ABO, and BOA, as well as DSA [
29] and two improved butterfly optimization algorithms, HPSBA [
51] and FBA [
19]. The simulation parameters for the node coverage optimization problem were as follows: the deployment area was 100 m × 100 m, the number of deployment nodes was 20, and the number of iterations was set to 100. The results on the NCO problem with a changing sensing radius (13 m, 14 m, 15 m) are shown in
Table 10.
Table 10 shows that for a sensing radius of 14 m, the results with the proposed BBO are significantly better than with the compared methods. The coverage rate of BBO is 91.67%; when the sensing radius is 13 m or 15 m, the coverage rate for the NCO problem achieved with BBO is higher than that achieved with the other algorithms. The performance of BBO in solving the NCO problems is significantly modified, which indicates that it has high application significance. Compared with the BOA, the node coverage rate of BBO with a sensing radius
of 13 m, 14 m, and 15 m increased by 13.40 percentage points, 12.11 percentage points, and 8.18 percentage points, respectively. In addition,
Figure 7 and
Figure 8 show the coverage curves for node coverage optimization achieved by the compared algorithms (PSO, GWO, ABO, BOA, DSA, HPSBA, FBA, and BBO).