Application of Improved Genetic Algorithm and Ant Colony Algorithm in Multi-objective Path Planning

Due to the shortcomings of GA in path planning, there are too many control variables and it is easy to fall into local areas. We introduce the idea of a gene bank and store the new chromosomes generated each time in the gene bank. The idea of linear regression is proposed to predict the probability of crossover and mutation of the next generation. At the same time, a method of increasing chromosome diversity is proposed, which avoids the problem that it is difficult to set the control variable parameters reasonably and fall into local optimum when the GA is applied in path planning. To overcome the shortcomings of ACO in path planning, an ACO with improved heuristic function and transition probability was proposed, and the method of the real-time environment was given. Through the traveling salesman problem, the improved GA and ACO are combined to apply to path planning. The experimental results show that the fusion of GA and ACO in this paper is superior to ordinary GA and ACO in all aspects of path planning.


Introduction
One of the important quality indicators of mobile robots is whether they can safely and quickly reach the target point in the unknown or known environment, that is, path planning. Domestic and foreign scholars have proposed various algorithms that can be applied to path planning. A-star algorithm and fast search random tree algorithm [1] are very mature. Researchers began to study the swarm intelligence algorithm to get a better path, such as GWO [2], AF swarm [3], BA [4], PSO [5], and bee swarm algorithms.
Genetic algorithms are easy to combine with other methods and the process is simple. But there are also some drawbacks, such as complex control variables. In [6], a map operator is proposed, which divides obstacles in a map into multiple regions and stores corresponding index values for each region. The species diversity operator is also proposed to achieve species diversity and avoids falling into local optimum conditions. In [7], the fast recall of genetic methods is improved by introducing crossover 2 methods and random interval mutation methods to reduce the risk of falling into local optima. In [8], combining image processing with genetic methods is proposed to obtain the best path and reduce code runtime.
In the 1990s, Dorigo and others studied ants' foraging behavior and proposed an intelligent ant group. With positive feedback, the ant group could constantly approach the best route and communicate with each other through the environment, which is also slow and locally optimal. In [9], several factors are put forward, such as the fluctuation factors of the information element, the feasible factors of the path, the information element, the expectation factor, the memory factors, the social phobia factors, the personality factors, and the emotional fluctuation factors, to speed up the restrain speed of the ant group. In [10], the features of A* and large and small ant groups are combined, and the inspired function of the ant group is improved through A star, to improve the overall performance of the ant group. In [11], an elite ant colony method is proposed to address the fact that traditional ant colony methods fall into the local optima with slow retreat speeds. In [12], angle-guiding factors and barrier-eliminating factors are introduced into the probability of transferring the ant group, and the evaporation factors are adjusted to balance the searching ability and the restraining ability.
This article mainly studies the problem of GA prone to local optima and complex control variable settings. Based on previous studies, the idea of a gene pool is proposed, which dynamically adjusts the probability of crossover mutation through the change of population type, and weakens the influence of selection probability. For the problem of slow convergence of ACO, the idea of using radar detection is proposed to monitor the surrounding environment in real-time, to improve the heuristic function and transition probability. Then, through TSP [13] blending GA and ACO, we aim to achieve path planning of eight target points in a two-dimensional environment.

Environment modeling
We use the grid method to create an mm×mm grid map and map each grid with a number. At the same time, the grid environment established has two states, in which the black area is used as the obstacle area, that is, it is not walkable and cannot be crossed. The white position is a non-obstacle area, as shown in Figure 1.

Path representation
In the grid diagram, we plan the complete path G from the starting target to the endpoint target for mobile device P k . The path is composed of a series of points, as shown in Formula 2. (2) where S (x s , y s ) is the start point of the BOT, G (x g , y g ) is the endpoint, X is the point at which the path passes, and L k is the distance from the initial point to the target point as shown in Formula 3.
In the process of path optimization, the mathematical model of the optimal path is realized by Formula 4.
= min ( ) ( ) = 0 (4) where P min is the path with the smallest median value in the path set, and C (Lk) means no collision with obstacles.

Genetic algorithm
GA is a swarm optimization intelligent algorithm that simulates natural selection and swarms the genetic behavior of natural organisms. The specific implementation steps are as follows: (1) The parameters of the genetic algorithm are initialized and the fitness of the individual corresponding to each chromosome is assessed and recorded; (2) In the process of chromosome selection, the greater the fitness is, the greater the probability of being selected. Forward propagation is guaranteed; (3) We select the chromosomes of both parents to cross with a certain probability to produce offspring; (4) The offspring are mutated according to a certain probability; (5) Steps 2, 3, and 4 are repeated; (6) The loop exits when the number of iterations is reached; (7) Binary encoding is set. One of the binaries represents information in both states and binaries long enough to represent all the features of a chromosome.

Ant colony
The basic principle of the ACO is that each ant will release a pheromone when walking a certain path to point out a certain direction for subsequent ants. Therefore, after some time, there will be a phenomenon that the information concentration of the shorter path is significantly higher than that of longer paths, so more and more ants choose this shorter path. The key to the successful application of the ACO in path planning lies in the pheromone update and transfer rules to the next location. The transfer rule is shown in Formula 5, and the calculation method of the heuristic information is shown in Formula 6.
where represents the likelihood of ant m going from node i to node j, ( ) represents the pheromone content at position (i, j) in stage t, is the heuristic for the position (i, j), α and β are expected heuristic factors, and is the set of next optional positions. The update method of pheromone is as Formulas 7, 8, and 9. ( where Δ ( ) represents the size of the pheromone released by the kth ant at i and j, and ∆ ( ) is the sum of all pheromone concentrations.

Improved genetic algorithm
The population offspring of the traditional GA is directly inherited from the parents according to the selection, crossover, and mutation. This method may lead to the elimination of the excellent population. At the same time, this method is also very prone to the central effect, that is, it is difficult to produce more excellent offspring after two excellent parents cross. Therefore, to avoid this situation, the concept of a biological gene pool is introduced, that is, all the generated populations are recorded, as shown in Formula 10, providing data support for future improvements. Formula 11 is the population of the kth iteration, and it is sorted according to the fitness value from small to large.
where g is all the populations generated after t iterations, and the populations in the gene pool are sorted according to the fitness from the largest to the smallest.
The best population diversity and superiority in fewer iterations are achieved. We divide the iterative process of the genetic algorithm into two areas, that is, the population diversity generation area α and the population superior convergence area β, which is shown in Formula 12. Genadai is always the total number of iterations, trunc is rounded down, and gen is the population number of each generation. In the population diversity generation area, the first 10% of the gene pool is used to replace the last 10% of the iteration parent. That is, the population with the worst fitness in the gene pool is just used to replace the best population in the current iteration parent. This process is in the process of change, that is, each time the gene pool replaces the corresponding superior to the inferior population in the iteration parent with 10% non-repetition and linear optimal selection. When the superior convergence region of the population is entered, the optimal 20% of the gene pool has been used to replace the corresponding inferior population in the parent generation. At the same time, this method indirectly adjusts the selection probability.
= ( /( ( ÷ 10))) = − The probability of crossover and mutation is adjusted by the gene pool, that is, the gene crossover sub-pool Q is set up as Formula 13 and the gene mutation sub-pool V is set up as Formula 14. The gene crossover sub-pool is used to store the cumulative population generated by each generation of population crossover, and the gene mutation sub-pool is used to store the cumulative population generated by each generation of mutation.
where pc is the crossover probability, pa is the mutation probability, o t is the number of new crossspecies produced by the t iteration, and v t is the number of new populations of variation produced for the t time.
In the formula, (x i , y i ) and (x goal , y goal ) are the next position and target position, where the function y is the linear relationship between the next node and the target node. The floor is the downward rounding, and (x j , y j ) is the point set between (x i , y i ) and (x goal , y goal ). The count is the counting formula, num is the number of obstacles in the point set, and finally, the reciprocal of the Euclidean distance and the number of obstacles are fused by weight. We make the overall direction of the ant the target point and consider that there are fewer obstacles in the direction of the ant, which reduces the number of large corners and the occurrence of invalid searches.
When the path is planned, it should be simple and smooth with few corners. The prediction number is proposed, that is, the ants refer to the sub-nodes when the next node is selected. We further adjust the transfer method according to the obstacles around the sub-nodes. Each direction will generate 0 to 9  Figure 4, the number of obstacles is shown in Formula 19, and the improved transition probability is shown in Formula 21. .
where i and j are the x and y differences of the optional child nodes minus the parent node, and G is the grid map information. We calculate the number of obstacles as n, and the number of all obstacles on the map is N.
To improve the transfer mode of the next node, the traditional ant colony algorithm generally uses roulette, which has certain limitations. For example, to reduce the convergence speed, an improved method is proposed, that is, when the number of obstacles of the current parent node is zero, the point with the maximum probability is directly used as the child node, to realize the dynamic combination of roulette and the transfer of the child node with the maximum probability.

Algorithm fusion process
The detailed steps of multi-objective path planning are as follows: Step 1: We encode multiple target points by integer arrangement; Step 2: We initialize the population after completing the chromosome coding to obtain the initial solution; Step 3: We evaluate the fitness of the generated population; Step 4: We select the crossover mutation operation for the population; Step 5: We repeat steps 2, 3, and 4 to get the optimal target point set; Step 6: We use the obtained set of target points as the starting point and the endpoint in turn; Step 7: We initialize the parameters of the improved ACO, such as the number of iterations, ant colony size, heuristic information; Step 8: We initialize the tabu list and find the selectable grid points around the current grid point; Step 9: We combines the roulette wheel method and the direct maximum probability point adaptively to the next optional node; Step 10: We update the path, path length, and taboo list of the ants. After reaching the target point, we compare and update the path and pheromone.

Experiment preparation
All algorithms in this paper are realized by MATLAB R2018b simulation. The operating system for the experiment is Windows 11, the processor is AMD Ryzen 5 5600 H with Radeon Graphics, and the machine is equipped with RAM16.0 GB. To make the experimental simulation data more reliable, we run the path planning code 30 times respectively, calculate the average value of the obtained data, and use the grid method to build a 20 × 20 model of the environment map.

Comparison of algorithm performance
The experimental results of GA improved GA and PSO algorithms in solving TSP problems, which are shown in Figure 5 and Table 1.  Figure 5 (c) respectively represent the optimal path combinations of the ordinary GA, the improved GA, and the improved particle PSO algorithm in 8 target points. The red, blue, and yellow in Figure 5 (d) are the changing process of optimal fitness values of the genetic algorithm, the GA algorithm, and the improved PSO algorithm respectively. Table 1 shows that the path length of the improved GA in this paper is reduced by 5% and 20% respectively compared with the ordinary GA and the improved PSO. The improved GA reduces the number of stable iterations by 69%. When the improved GA in this paper reaches the optimal path, the algorithm only needs a few iterations to achieve stability. The other two algorithms are unstable and tend to fall into local optima during the iteration process. Therefore, considering all aspects of the algorithm, the algorithm in this paper has obvious advantages in path planning The comparison between the ACO and the improved ACO is shown in Table 2.  Figure 6 (a) and 6 (b) and Table 3, it can be seen that the length of the ACO in this paper is 4.9% lower than that of the ordinary ACO, the number of bending times is reduced by 39%, and the program running time is increased by 27%. The minimum distance of the generation is smaller than the shortest distance of the ordinary ACO. In summary, the improved ACO in this paper is superior to the ordinary ACO.
Through Chapter 4.3, the GA of this paper and the ACO of this paper are fused, and the final experimental results are shown in Figure 6   The improved GA and ACO are used to realize the multi-objective path planning in the grid map, as shown in Table 4. The shortest distance without obstacles is 76.9426, the shortest distance in the grid map is 90.87, and the program running time is 10.76 seconds.

Conclusion
This article uses a genetic algorithm to establish a gene bank and uses the information of the gene bank to improve population diversity and linear prediction of mutation probability crossover probability, improving the fast convergence of GA and achieving the best performance of the genetic algorithm. Functions and transition probability methods realize the overall performance improvement of the ant colony algorithm. This article achieves path planning for eight target points through the fusion of GA and ACO algorithms, and the path planning effect is good. In future research work, other algorithms will be introduced to achieve path planning for safer paths.