In this paper, a lens learning sparrow search algorithm (LLSSA) is proposed to improve the defects of the new sparrow search algorithm, which is random and easy to fall into local optimum. The algorithm has achieved good results in function optimization and has planned a safer and less costly path to the three-dimensional UAV path planning. In the discoverer stage, the algorithm introduces the reverse learning strategy based on the lens principle to improve the search range of sparrow individuals and then proposes a variable spiral search strategy to make the follower's search more detailed and flexible. Finally, it combines the simulated annealing algorithm to judge and obtain the optimal solution. Through 15 standard test functions, it is verified that the improved algorithm has strong search ability and mining ability. At the same time, the improved algorithm is applied to the path planning of 3D complex terrain, and a clear, simple, and safe route is found, which verifies the effectiveness and practicability of the improved algorithm.

In recent decades, swarm intelligence algorithms have been gradually explored by researchers. The main principles of these algorithms are mostly to solve some optimization problems by simulating or revealing some natural phenomena or processes, such as Particle Swarm optimization (PSO) [

Currently, research on sparrow search algorithm has been proposed successively, but the proposed algorithms lack a global improvement mechanism. Although the mapping mechanism is uniform, it is not stable under the sparrow search algorithm with good global results, and it increases the workload of the population. Therefore, a search mechanism with global vision and flexibility is needed to improve the search ability of the sparrow search algorithm. For the above analysis, a lens learning sparrow search algorithm (LLSSA) is proposed. This algorithm uses a reverse learning strategy based on lens learning strategy in the discoverer location update formula to improve the algorithm's vision in the optimal space. A variable spiral search strategy is proposed to enable followers to search in more detail and flexibility. Finally, the current solution is refined by fusing simulated annealing algorithm to find a higher quality solution. Through 15 standard test functions, the effectiveness of LLSSA is verified, and a distinct, simple, and satisfying route is found in the complex three-dimensional path planning.

During the food search process, the sparrow population is divided into two roles: discoverer and follower, which conduct behavioral strategies separately. Discoverers are generally 0.2 of the population size and are the guides of the individual population, leading other individuals in the search for things, so the role of the discoverer is crucial in the population. They have a wide search range. The location update formula for the discoverer is as follows:

In formula (

To obtain good quality food, the followers would closely follow the discoverers. Some of these followers oversee the discoverers and those discoverers with high rates of predation for food, thus increasing their own nutrition. The positional update for the followers is described below:

In (

In (

It is because of the broad search range and flexible search methods that discoverers can lead the group to find good food. Once the discoverer is trapped in the local optimum, the performance of the overall algorithm will be degraded, so improving the search horizon of the discoverer is particularly important. General learning strategies have achieved good results in some optimization algorithms, but have little effect on the performance of the algorithm, because the general learning strategies carry out reverse solutions in local space, which enriches the diversity of the population, but the search scope is narrow and loses flexibility. In order to improve the searching ability of the discoverer, a reverse learning strategy based on lens imaging [

(reverse point). Set

(base point). Suppose there are several points

Using one-dimensional space as an example, assume that an individual

As shown in Figure

Let

It follows that when

Form (

In (

Lens schematic diagram.

While it is convenient for followers to follow the discoverer in updating their location, it is easy for followers to search blindly and singularly. Inspired by the rotation of the whale algorithm, this paper introduces a variable spiral location update strategy, which allows followers to have a variety of search paths to better update the location, while balancing the global and local search of the algorithm. The spiral search diagram is shown in Figure

Schematic diagram of spiral search.

In the follower location update process, the helix parameter

The parameter

Simulated annealing algorithm, derived from the principle of solid annealing, is a probability-based algorithm and a stochastic global optimization algorithm proposed by Metropolis et al. [

Sparrow search algorithm has deficiencies in the case of multidimensional complex functions. Therefore, this paper presents a lens learning sparrow search algorithm. This algorithm applies the reverse learning strategy based on the principle of lenses to the discoverer stage of sparrow search, improving the diversity of the population and expanding the search range of individual sparrows. In the follower search phase, a variable spiral search strategy is introduced, which makes the follower search more detailed and flexible. Finally, this algorithm is combined with the simulated annealing algorithm, and the previously found solutions are filtered again to obtain the optimal solution. The algorithm works as follows.

Initialize the population location, number, and number of iterations.

Calculate the fitness function of each group to get the corresponding maximum and minimum values to determine the best and worst position.

Calculate the alert value and update the location of the discoverer based on the alert value.

Use Levy flight to update the location of the discoverer.

Update the position of followers.

Perform another sine-cosine search of the follower's location and update the location.

Update the locations of sparrows that are aware of danger.

Perform simulated annealing operation, as follows:

Determine the

Determine a new global optimal value

Determine whether the termination condition is met or not; if not, return to step (2). If so, proceed to the next step.

Output best position and minimum cost. The specific pseudocode is as follows (Algorithm

Input

PD: the number of producers

SD: the number of sparrows who perceive the danger

_{2}: the alarm value

Initialize a population of

Output:

Initialize the population according to equation (

While (

Rank the fitness values and find the current best individual and the current worst individual.

_{2} = rand(1)

For

Using equation (

End for

For

Using equation (

End for

For

Updating the position of a sparrow individual who is aware of danger according to equation (

End for

Perform simulated annealing

Get the current new location;

If the new location is better than before, update it.

End while

Return:

In order to better see the advantages of the improved strategy, the SPHEREFUNCTION function is taken as an example to analyze the effectiveness of the strategy of the LLSSA algorithm. Let the number of populations and the number of iterations be 50 and 10, respectively, and the individual distribution map after 10 iterations of each algorithm is obtained. The specific distribution maps are shown in Figures

Distribution of individuals in LLSSA.

Distribution of individuals in SSA.

It can be seen from Figures

For an algorithm, time complexity is an important consideration, and it is also an important means of judging the amount of calculations of an algorithm. Suppose the population size of the algorithm is P, the maximum number of iterations is

From a micropoint of view, suppose the ratio of discoverers is _{1}, the calculation time of the variable spiral search strategy is _{2}, and the calculation time of using the simulated annealing algorithm to update the optimal solution is _{3}. It can be seen from the pseudocode of the algorithm that the LLSSA algorithm adds

In order to further verify the feasibility and effectiveness of the improved sparrow search algorithm, this paper selects 15 standard test functions to verify its optimization performance. The specific information is shown in Table _{1} = _{2} = 2,

Test function table.

Function | DIM | Section | MIN |
---|---|---|---|

30 | [−100, 100] | 0 | |

30 | [−10, 10] | 0 | |

30 | [−100, 100] | 0 | |

30 | [−100, 100] | 0 | |

30 | [−30, 30] | 0 | |

30 | [−5, 10] | 0 | |

30 | [−100, 100]d | 0 | |

30 | [−1.28, 1.28] | 0 | |

30 | [−500, 500] | −418.9829n | |

30 | [−500, 500] | 0 | |

30 | [−50, 50] | 0 | |

2 | [−10, 10] | 0 | |

2 | [−4.5, 4.5] | 0 | |

4 | [−10, 10] | 0 | |

2 | [−65.536. 65.536] | 0.998 |

At the same time, in order to exclude the contingency of each algorithm and enhance persuasion, the three indexes of optimal value, average value, and standard deviation of each algorithm's search result are counted, and the three indexes are used to judge the optimization ability and stability of each algorithm.

As can be seen from Table _{1–7}, _{10-11}, _{15} and has better search ability than other algorithms. In the _{9} function, BSO is the best. In _{13-14}, BSO can find the best one, but its stability is poor, and the optimization results on other functions are extremely poor. Therefore, BSO has some limitations in function optimization. LLSSA achieves good results on many function problems. It is inferior only to BSO in _{9}, which shows that LLSSA has strong optimization ability. Other algorithms have achieved poor optimization results. Therefore, the introduction and fusion of simulated annealing make the sparrow search algorithm have strong local judgment ability, balance the local and global search, and improve the search ability of the algorithm.

Table of optimization results of each algorithm.

Function | Algorithm | Best | Ave | Std |
---|---|---|---|---|

_{1}( | LLSSA | 0 | 0 | 0 |

BSO | 8.15851 | 26.3851 | 14.9876 | |

CSSA | 0 | 0 | 0 | |

SSA | 0 | 5.192 | 0 | |

GWO | 1.5739 | 4.5232 | 7.3785 | |

PSO | 3.8599 | 3.0697 | 2.7076 | |

_{2}( | LLSSA | 0 | 0 | 0 |

BSO | 0.212219 | 1.8836 | 2.13278 | |

CSSA | 0 | 3.8973 | 2.1346 | |

SSA | 0 | 2.2022 | 8.4437 | |

GWO | 1.6295 | 2.9050 | 4.4358 | |

PSO | 8.9056 | 2.5055 | 1.4584 | |

_{3}( | LLSSA | 0 | 0 | 0 |

BSO | 0.0004945 | 15.1459 | 34.9405 | |

CSSA | 0 | 4.2858 | 0 | |

SSA | 0 | 7.7137 | 0 | |

GWO | 2.2250 | 0.029431 | 0.070791 | |

PSO | 22.2592 | 49.9596 | 18.1286 | |

_{4}( | LLSSA | 0 | 1.008 | 0 |

BSO | 0.01503 | 0.015026 | 1.40522 | |

CSSA | 0 | 4.1077 | 2.2499 | |

SSA | 4.0636 | 1.9036 | 2.9266 | |

GWO | 2.4178 | 6.4757 | 2.1850 | |

PSO | 8.1218 | 6.9044 | 7.0838 | |

_{5}( | LLSSA | 2.2981 | 2.3943 | 3.8273 |

BSO | 553.7041 | 2543.2161 | 1657.5282 | |

CSSA | 1.3357 | 2.6062 | 0.0015114 | |

SSA | 4.7653 | 0.00028325 | 0.00049636 | |

GWO | 45.8565 | 47.3855 | 0.89355 | |

PSO | 89.4507 | 234.8606 | 104.6002 | |

_{6}( | LLSSA | 0 | 0 | 0 |

BSO | 10.9679 | 76.8897 | 44.1926 | |

CSSA | 0 | 2.6949 | 1.476 | |

SSA | 0 | 6.9176 | 3.7889 | |

GWO | 1.1787 | 2.2057 | 2.7228 | |

PSO | 30.8725 | 58.7189 | 18.8337 | |

_{7}( | LLSSA | 0 | 0 | 0 |

BSO | 7.8221 | 2.0384 | 3.2288 | |

CSSA | 0 | 6.07 | 3.3246 | |

SSA | 0 | 8.7599 | 4.798 | |

GWO | 0 | 9.7069 | 0 | |

PSO | 1.6341 | 6.6714 | 1.2043 | |

_{8}( | LLSSA | 8.0687 | 0.0001561 | 0.00012633 |

BSO | 0.0038813 | 0.009674457 | 0.004701 | |

CSSA | 9.9226 | 0.00026062 | 0.00016246 | |

SSA | 5.318 | 0.00029582 | 0.00025735 | |

GWO | 0.00040374 | 0.0020252 | 0.89355 | |

PSO | 0.010201 | 0.030015 | 0.00096086 | |

_{9}( | LLSSA | −12554.58326 | −10931.8556 | 1203.7127 |

BSO | −12569.4418 | −11820.3055 | 973.8153 | |

CSSA | −9859.7543 | −8700.9989 | 615.6127 | |

SSA | −9374.4498 | −8208.1416 | 501.1037 | |

GWO | −9055.703 | −6452.354 | 1033.4608 | |

PSO | −8405.1316 | −6176.2342 | 793.1086 | |

_{10}( | LLSSA | 0.000382023 | 1467.5173 | 1296.1624 |

BSO | 0.03331 | 848.2818 | 1061.7445 | |

CSSA | 2529.3974 | 3661.9962 | 725.5963 | |

SSA | 3471.670439 | 4292.617883 | 529.1990723 | |

GWO | 4866.1835 | 6134.3633 | 604.5177 | |

PSO | 5205.7803 | 7638.9387 | 1024.9673 | |

_{11}( | LLSSA | 1.04486 | 4.06779 | 9.93488 |

BSO | 0.140491 | 1.053227 | 0.53947 | |

CSSA | 1.09657 | 1.93721 | 3.43612 | |

SSA | 2.36977 | 2.78963 | 5.17661 | |

GWO | 9.22011 | 0.019838839 | 0.013634913 | |

PSO | 2.35982 | 0.041670227 | 0.078731524 | |

_{12}( | LLSSA | 1.3498 | 1.3498 | 0 |

BSO | 1.3498 | 1.3498 | 0 | |

CSSA | 1.4730 | 2.3043 | 3.9261 | |

SSA | 1.3498 | 3.9049 | 5.2232 | |

GWO | 1.0606 | 8.9305 | 7.8567 | |

PSO | 1.30489 | 4.7707 | 6.0171 | |

_{13}( | LLSSA | 6.2457 | 1.1032 | 3.5156 |

BSO | 0 | 0.2540 | 0.3592 | |

CSSA | 4.3789 | 3.2277 | 1.5937 | |

SSA | 2.7959 | 1.2661 | 2.7684 | |

GWO | 1.2267 | 4.0761 | 4.2024 | |

PSO | 1.1013 | 8.1661 | 1.7949 | |

_{14}( | LLSSA | 6.47687 | 9.70058 | 1.93534 |

BSO | 0 | 2.17439 | 2.93539 | |

CSSA | 1.2546 | 5.2214 | 1.3653 | |

SSA | 9.50199 | 1.02709 | 2.50633 | |

GWO | 0.00022591 | 1.142301517 | 2.11174329 | |

PSO | 0.022667333 | 0.026019705 | 0.001130521 | |

_{15}( | ALSSA | 0.998 | 0.998 | 0 |

BSO | 0.998 | 1.0311 | 0.17843 | |

CSSA | 0.998 | 2.1068 | 2.9273 | |

SSA | 0.998 | 2.5594 | 3.6421 | |

GWO | 0.998 | 2.8013 | 2.8092 | |

PSO | 0.998 | 1.1968 | 0.3976 |

To describe the convergence of each algorithm in each function, the average convergence of each algorithm in each function is counted, and the specific convergence effect is shown in Figure

Convergence effect diagram of each algorithm. (a) _{1}, (b) _{2} (c) _{3}, (d) _{4}, (e) _{5}, (f) _{6}, (g) _{7}, (h) _{8}, (i) _{9}, (j) _{10}, (k) _{11}, (l) _{12}, (m) _{13}, (n) _{14}, (o) _{15}.

Comparing algorithms based on mean and standard deviation alone is not enough. To be more persuasive, statistical tests are needed to verify that the proposed improved algorithm has significant improvement advantages over other existing algorithms. To determine whether each result of LLSSA is statistically significantly different from the best results of other algorithms, the Wilcoxon rank sum test was used at the 5% significance level. The

Wilcoxon rank sum test

BSO | CSSA | SSA | PSO | GWO | |
---|---|---|---|---|---|

_{1} ( | 3.0731e − 13 | N/A | N/A | 3.0731 | 3.0731 |

_{2} ( | 3.0229 | 5.0460 | 0.0033 | 6.6628 | 3.0229 |

_{3} ( | 3.0731 | N/A | N/A | 3.0731 | 5.0518 |

_{4} ( | 3.0229 | 5.3855 | 1.9198 | 6.6628 | 6.6628 |

_{5} ( | 3.0229 | 3.6614 | 0.0029 | 6.6628 | 6.6628 |

_{6} ( | 5.6836 | 0.0178 | 4.1170 | 9.8825 | 9.8825 |

_{7} ( | 3.0731 | 2.5775 | 1.0038 | 5.0518 | 6.9262 |

_{8} ( | 3.0229 | 0.0050 | 0.0023 | 6.6628 | 8.0397 |

_{9} ( | 8.1616 | 2.6075 | 6.3487 | 1.2362 | 1.4748 |

_{10} ( | N/A | 3.2490 | 3.2972 | 6.6628 | 6.6628 |

_{11} ( | 3.0229 | 2.2047 | 0.0071 | 3.0229 | 3.0229 |

_{12} ( | N/A | 4.1939 | 2.1521 | 4.2371 | 7.1756 |

_{13} ( | 0.0244 | 2.8131 | 1.8152 | 6.4913 | 6.6628 |

_{14} ( | 1.1648 | 1.9492 | 6.3524 | 3.0229 | 3.0229 |

_{15} ( | 3.5009 | 0.0068 | 0.0232 | 0.0193 | 4.9256 |

From Table

The proposal and improvement of an algorithm are ultimately to be implemented in the actual project. Since the development of intelligent optimization algorithms, the improvement of multiple algorithms has been successfully applied to specific applications; for example: literature [

In recent years, the problem of UAV path planning has been widely favored by researchers. UAV path planning is also one of the problems of automatic control. Common path planning methods include genetic algorithm [

Cost function is an indispensable part of route planning. The more reasonable the cost function is set, the closer it is to the real demand. The cost function designed in this paper is as follows:

The cost function can be used to evaluate the quality of the generated path, which is the basis of iterative evolution of algorithm population. The performance of cost function determines the efficiency and quality of algorithm implementation, and it is also the performance index of path planning. In order to better evaluate the path quality, this paper constructs the fitness function [

Path length is one of the most important indicators to evaluate the quality of a path. The shorter the path is, the less energy and time consumption the UAV will take to fly. The cost of introducing path length is as follows:

The stable flight height of the UAV is also an important part of the UAV track planning process. For most aircraft, the flight height should not change much. Stable flight height helps to reduce the burden on the control system and save more fuel. Therefore, the cost of introducing track elevation is

When an UAV is making a turn, it needs to consume some energy due to the air resistance and at the same time exerts some pressure on the body. The smaller the turning angle, the greater the pressure generated and the more energy consumed, making the flight inefficient. Therefore, the smoothness of flight is also a key factor in the cost of flight.

In order to verify the feasibility and practicability of the fusion algorithm to optimize the effect of UAV, it is compared with SAPSO, PSO, SSA, and CSSA. The parameters of each algorithm are set as follows: the number of population is 100, the number of iterations is 400, the initial temperature

Experimental environment parameter table.

Name | Coordinate | Height (radius) |
---|---|---|

Start point | (5, 90) | — |

End point | (45, 15) | 8 |

Obstacle 1 | (15, 70) | 4 |

Obstacle 2 | (20, 60) | 3 |

Obstacle 3 | (30, 30) | 4 |

Obstacle 4 | (40, 45) | 3 |

Optimal route planning for each algorithm. (a) LLSSA, (b) SAPSO, (c) CSSA, (d) SSA, and (e) PSO.

Route statistics of each algorithm.

Algorithm | MIN | AVER | Worst value |
---|---|---|---|

LLSSA | 43.0889 | 43.1057 | 43.1205 |

CSSA | 46.3648 | 48.5135 | 50.1908 |

SSA | 50.1908 | 51.4657 | 53.3881 |

SAPSO | 43.1159 | 44.0132 | 46.0752 |

PSO | 48.5228 | 49.3312 | 50.8184 |

Average cost convergence graph of each algorithm.

As you can see from Figures

Table of rank sum test.

Algorithm | LLSSA | SAPSO | CSSA | SSA | PSO |
---|---|---|---|---|---|

LLSSA | N/A | 0.0022 | 1.5540 | 1.5540 | 1.5540 |

SAPSO | 0.0022 | N/A | 9.3240 | 1.5540 | 1.5540 |

CSSA | 1.5540 | 9.3240 | N/A | 0.0042 | N/A |

SSA | 1.5540 | 1.5540 | 0.0042 | N/A | 9.3240 |

PSO | 1.5540 | 1.5540 | N/A | 9.3240 | N/A |

Similarly, in order to further verify the feasibility and significance of the algorithm on the UAV route, Wilcoxon test as described above is conducted among the algorithms, and the rank sum test results are shown in Table

It can be seen from Table

In this paper, aiming at the problem that the sparrow search algorithm falls into the local optimum and depends on the initial population in the optimization process, the reverse learning strategy based on the lens principle and the variable cosine search strategy are introduced, which are applied to the stage of discoverer and follower, respectively, making the search method more flexible and careful. Then the simulated annealing algorithm is fused to extract the optimal solution. Through the test of standard test function, it can be seen that LLSSA has good optimization ability and convergence effect. It is applied to the path planning of UAV in three-dimensional complex terrain. Through the comparison of CSSA, SSA, SAPSO, and PSO optimization UAV route planning, it shows that LLSSA optimization UAV path is the simplest and clearest, and the cost is the least. Through the planning route index table and the average cost function convergence diagram, it shows that LLSSA has good stability, so its application in UAV path planning has high reliability. It can be seen that in the process of sparrow optimization, if the leading discoverer is limited, the whole algorithm will be paralyzed, and the solution found each time is not necessarily reliable. Therefore, it is extremely important to effectively improve the discoverer's search mechanism and judgment ability. It can be seen from the above experiments that LLSSA relies on the judgment ability of simulated annealing algorithm in complex terrain path planning problems. Although this method can improve the quality of route optimization, it does not necessarily have a good effect in simple path planning problems, and it increases the calculation time, which is still a challenge in multiple complex environments. In the next step, we apply it to the path planning of multimission UAV.

The data used to support the findings of this study are available from the corresponding author upon request.

The authors declare that they have no conflicts of interest.

This work was financially supported by the Regional Foundation of the National Natural Science Foundation of China (no. 61561024).