Application of simulated annealing particle swarm optimization in complex three-dimensional path planning

Particle Swarm Optimization (PSO) has achieved good results in UAV path planning, but there is still the phenomenon of abandoning the global optimal path and choosing the local optimal one. In order to improve the ability of particle swarm in path planning, a simulated annealing particle swarm algorithm is proposed. First, tent reverse learning is used to initialize the population so that the algorithm is evenly distributed in space. Then annealing operation is performed after iteration once, which has better local path judgment ability and avoids the phenomenon of local optimum to some extent, so as to find a more satisfactory path. Simulated annealing particle swarms can find a clear and satisfactory path with high stability through the complex three-dimensional path planning simulation of UAV.


Introduction
The path planning of an unmanned aerial vehicle (UAV) is to find an optimal path from the starting point to the ending point under the constraints of terrain, circumvention of local radar weapons, and flight conditions. In other words, the planned route meets its own security requirements and avoids the dangers around it. Track planning is a spatial search algorithm, usually divided into heuristic and evolutionary algorithms. Heuristic algorithm is a computational search using points in space. The process is complex and computationally intensive, which can easily lead to combined blasting and other problems. Evolutionary algorithms mostly use swarm intelligence algorithms, such as Ant Colony Optimization, Grey Wolf Optimizer and Particle Swarm Optimization.
In recent years, route planning based on swarm intelligence algorithm has developed rapidly, among which Particle swarm optimization (PSO) is more popular in route planning. PSO has attracted much attention because of its fast operation speed and easy implementation, but it still has the drawbacks of being trapped in local optimum and strong randomness. Chen Tianpei et al. [1] learned from the idea of Ant Colony Optimization pheromone, added pheromone for each particle, and introduced the empirical criteria of fuzzy system to avoid the disadvantage that traditional particle swarm algorithm is prone to local optimization. Finally, the effectiveness of the improved algorithm is shown by the three-dimensional path planning. Chen Shiming et al. [2] propose a hybrid mutation particle swarm optimization algorithm, which further divides the feasible domain and search boundary by splitting dimension reduction, reduces the search scope of the shortest path solution, and then shrinks the solution space by using directional and random mutation operations. Finally, the feasibility and superiority of the algorithm in three-dimensional path planning are verified by simulation experiments.
In summary, each scholar has made their own improvements by studying the principle of particle swarm, and the feasibility has been verified in experiments. On this basis, a simulated annealing particle swarm optimization (SAPSO) is proposed, which uses tent mapping reverse learning to initialize the population, so that the individuals of the population are evenly distributed in space, and the search horizon of the algorithm is improved. Then, the simulated annealing algorithm is used to update the solution obtained each time, which has a better judgment ability and reduces the probability of the algorithm falling into the local solution. SAPSO has good convergence ability and can find a simple and satisfactory route through the three-dimensional path planning map of unmanned aerial vehicle complex terrain.

Particle swarm optimization
Particle swarm optimization (PSO) is an optimization algorithm extracted from a model of bird swarms searching for food. Each particle is the equivalent of a bird, with its own velocity and fitness value. Moreover, each particle iteratively updates its own location through individual extremum and global extremum. The steps to find the optimal solution are as follows: (1) Initialize the particle swarm; (2) All particles of the particle swarm are calculated circularly; (3) Calculate the particle fitness . Suppose that the best solution found by the particle itself is labeled , if , then ; (4) Select the particle with the best fitness value of all particles as ; (5) Calculate the particle velocity according to the following formula: 1 * (1) In the above formula, t represents the number of iterations, w is the inertial weight, c is the learning factor, r is a random number, and its value range is [0,1]; (6) Update the of the particle position according to the following formula: 1 ( 2 ) (7) If the maximum number of iterations is not reached or the accuracy requirement is not met, continue to perform steps (2) to (6).

Tent mapping reverse learning initialization population
The results show that initializing population with chaotic mapping is random, traversal and bounded, and can improve the search efficiency of the algorithm. Tent mapping has more homogeneous sequences than other mappings, so tent mapping is used to initialize particle swarms and to optimize the initial species through reverse learning strategies. By selecting good individuals for the next generation of learning, the search scope of the population is expanded, thus improving the search efficiency. The tent mapping mathematical expression is as follows: The definition of reverse solution is: a feasible solution , , … , in D-dimensional space, , , then the reverse solution is , , … , , where . The specific steps to initialize the population using tent mapping reverse learning are: (1) Using tent mapping to generate the location 1,2, . . . , ; 1,2. . . , of N particle swarms in a given space as initial population OP; (2) Generate reverse individual corresponding to each individual in OP as reverse population FP according to the principle of reverse solution; (3) Combining OP and FP, the fitness values of 2N individuals were sorted in ascending order, and the first N individual particles were selected as the initial population.

Simulated annealing algorithm
The simulated annealing algorithm was proposed by N. Metropolis in the mid-20th century. The main content is based on the fact that when a solid is heated, the particles in the solid will get a large amount of energy and move irregularly; when the heating ends and the solid is cooled, the particles in the solid can move regularly, and their energy reaches the equilibrium state at that temperature. Simulated annealing algorithm is often used to solve global optimal problems. The main ideas for finding the optimal solution are as follows: (1) The initial temperature T is large enough, the initial solution is x, the current iteration number is k = 0, and the iteration number of each temperature T is ; (2) Make 1,2, … , , loop execution step (3), (4); (3) The solution is , and the energy difference ∆ .If ∆ 0, then is accepted as the new solution, that is, ; otherwise, ∆ ⁄ is calculated to make the probability of p; (4) Terminate the loop if the condition is met. The condition for loop termination is that consecutive is not accepted; (5) According to the cooling formula , a new temperature is obtained, and steps (2) to (5) are executed in a cycle until the Metropolis criterion is met.

Simulated annealing particle swarm optimization
Although the particle swarm optimization algorithm can search for the best location, it lacks the dynamic adjustment of speed and is prone to fall into local optimum because of poor handling of discrete optimization problems. Therefore, the combination of simulated annealing algorithm and particle swarm optimization algorithm makes up for a certain degree of deficiency, and can jump out of the current solution and continue to search for high-quality solutions. The main ideas of the simulated annealing particle swarm optimization algorithm are as follows: (1) Particle swarms are initialized using the tent reverse learning mechanism described above; (2) All particles of the particle swarm are calculated circularly; (3) Calculate the particle fitness . Suppose that the best solution found by the particle itself is labeled , if , then ; (4) Select the particle with the best fitness value of all particles as ; (5) Initialize the temperature to be large enough, set the particle symbol to , and cool the temperature according to the following formula: 5 ⁄ ( 4 ) ( 5 ) Where is the attenuation parameter; (6) Determine the fitness value of particle at temperature T according to the following formula: ⁄ ∑ ⁄ (6) (7) Select a particle from all particles to determine its global optimal substitution value ', and update the particle speed and position according to the formula (1) and (2); (8) Determine the final value of the particle, update the individual extreme and global extreme ; (9) Perform annealing operations; (10) If the termination operation is not reached, proceed to step (6)~ (9); otherwise, output the result.

Environmental modeling
This paper studies the global path planning for unmanned aerial vehicles in known environments and establishes a three-dimensional digital elevation map model to simulate complex mountainous A cylinder is used to simulate the no-pass zone, which makes the optimization environment more complex. A straight line from the start to the end must pass through the no-pass zone. Therefore, it is our research institute to plan a least-cost route that does not cross the prohibited traffic zones.

Cost function design
Where 0 ∑ 1 , represents the total cost of a path, and , , and represent the total cost of length, height, and smoothness, respectively. , and are the corresponding weights.
When each algorithm is used for path planning, the cost function is used to evaluate the quality of the generated path, which is also the basis for the iterative evolution of the algorithm population. The cost function determines the efficiency and quality of algorithm execution, and it is also a performance indicator of path planning. In order to better assess the quality of the route, this paper constructs a fitness function by considering the path's height cost, length cost and deflection angle size. Assume that each path consists of n points.

Path length cost
Route length is one of the most important indexes to evaluate the quality of a route. Aircraft carry limited fuel and power. The shorter the path, the less energy and time it takes to fly. The cost of introducing path length is as follows:

Path high cost
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:

Smoothness cost
When an unmanned aerial vehicle is making a turn, it needs some energy because of the air resistance. At the same time, this kind of operation also exerts some pressure on the body, the smaller the angle, the greater the pressure; moreover, the more energy consumption, the lower the flight efficiency. Therefore, the smoothness of flight is also a key factor in the cost of flight.
, ,  Figure 1 shows the 3-D aircraft charts before and after improvement. In order to eliminate the occurrence of accidental events, each algorithm runs independently 10 times, and the average value of each optimization result is calculated. The average convergence route is shown in Figure 2.  Figure 1, it can be seen that the route planned by SAPSO is simple and safe, and the PSO optimal route works equally well. However, from Figure 2, it can be seen that the convergence effect of PSO is poor and precocious phenomena occur. These results show that PSO is random and easy to fall into the local optimal state. On the contrary, SAPSO has a good convergence curve and strong stability.

Concluding remarks
A simulated annealing particle swarm optimization algorithm is proposed for the poor convergence and strong randomness of particle swarm optimization algorithm. First, tent mapping reverse learning is used to initialize the population, then simulated annealing algorithm is used to refine the optimal solution and enhance the optimization ability of the algorithm. From the results of three-dimensional route planning for complex terrain, SAPSO has strong route planning ability and good stability.