An optimization method of ant colony algorithm
By introducing the corner heuristic function and improving the distance heuristic function of the ant colony algorithm, optimizing the transfer probability formula and designing a pheromone update strategy, the problems of slow convergence and easy falling into local optimality in path planning of the ant colony algorithm are solved, and the effect of shorter paths and faster convergence is achieved.
Patent Information
- Application Number
- CN202310497601.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2023-04-27
- Filing Date
- 2023-05-05
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-05-05
AI Technical Summary
The existing ant colony algorithm has problems in mobile robot path planning, such as slow convergence, too many corner turns, and easy falling into local optimality.
The corner heuristic function is introduced, the distance heuristic function is improved, the transition probability formula is optimized, and a pheromone differential update strategy is designed. The pheromone threshold is set to avoid local optimality.
The path length and running time are significantly shortened, the convergence speed is improved, the number of turns is reduced, and the robustness and optimization ability of the algorithm are enhanced.
Smart Images

Figure CN116449846B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of AGV path planning, and in particular to an optimization method of an ant colony algorithm. Background Art
[0002] An Automated Guided Vehicle (AGV) is an unmanned transport vehicle. Due to its high degree of automation, stable and reliable system operation, and flexible operation, it is widely used in the field of warehousing and logistics. Compared with traditional warehousing and logistics transportation, it greatly saves labor costs and improves work efficiency. Therefore, how to efficiently plan AGV paths has become an important research topic. Path planning refers to the process of a mobile robot planning an optimal path from a starting point to a destination, and being able to avoid obstacles in the environment, avoid collisions, and prevent danger. Domestic and foreign scholars have conducted extensive research on AGV path planning and have developed a number of mature planning methods, including intelligent path planning methods such as genetic algorithms, simulated annealing algorithms, particle swarm algorithms, and ant colony algorithms. Ant Colony Optimization (ACO) is a positive feedback swarm intelligence optimization algorithm with the characteristics of parallelism, strong robustness, adaptability, and easy integration with other algorithms. The ACO was originally applied to solve the TSP problem and was later applied to other combinatorial optimization problems, such as assignment problems and vehicle routing problems. However, when solving paths, it has disadvantages such as low search efficiency, a large number of parameters, and the algorithm is prone to stagnation and falling into local optimal solutions. Therefore, many scholars have optimized and improved the original ACO:
[0003] Ren Hongge, Hu Hongchang, and Shi Tao proposed a global path planning method for mobile robots based on an improved ant colony algorithm. Their time-space-based pheromone update strategy applies both path information and the number of iterations to the information volatility coefficient ρ, dynamically adjusting ρ to ensure that the pheromone meets the ant colony's value requirements at different times and in different areas, effectively avoiding interference from inferior solutions.
[0004] Zhang Tianrui, Wu Baoku, and Zhou Fuqiang proposed an improved ant colony algorithm for global robot path planning. They also proposed an adaptive update strategy for pheromone volatilization factors, which expanded the algorithm's search range and improved convergence speed, but also increased the running time.
[0005] Although many scholars have optimized and improved the original ant colony algorithm, the existing ant colony algorithm has problems in mobile robot path planning, such as slow convergence, too many corner turns, and easy falling into local optimality. Summary of the Invention
[0006] The purpose of the present invention is to propose an optimization method of ant colony algorithm in response to the problems existing in the background technology.
[0007] The technical solution of the present invention is an optimization method of an ant colony algorithm, comprising the following specific steps:
[0008] S1. Create a grid map, initialize parameters, and select M ants;
[0009] S2. Sort the M ants by number, defining them as ant K1, ant K2, ... ant Km;
[0010] S3, ant K selects the next node using the transition probability formula;
[0011] S4, determine whether ant K is in deadlock,
[0012] If so, abandon ant K and select the next ant K to continue executing S3;
[0013] If not, continue to execute S5;
[0014] S5, determine whether ant K has reached the end point,
[0015] If not, abandon ant K and select the next ant K to continue executing S3;
[0016] If so, record the path that ant K walked and continue to determine whether ant K is the Mth ant;
[0017] If yes, continue to execute S6;
[0018] If not, abandon ant K and select the next ant K to continue executing S3;
[0019] S6. Sort all the obtained path lengths from small to large, update them according to the pheromone update mechanism, and increase the number of iterations by 1;
[0020] S7, determining whether the number of iterations has reached the maximum number of iterations;
[0021] If yes, continue to execute S8;
[0022] If not, reselect M ants and continue to execute S2;
[0023] S8. Output the optimal path.
[0024] Preferably, the parameters initialized in S1 include the total number of ants M, pheromone concentration factor α, heuristic information strength factor β, pheromone initial strength value Q, pheromone volatility coefficient ρ, the proportion of ants that need to update pheromones u and the maximum number of iterations Kmax.
[0025] Preferably, the transition probability formula is:
[0026] Where q is a random number taken from the set (0, 1); is an adaptive dynamic variable;
[0027] j1 is the next node selected randomly, and j2 is the next node selected using formula B. Formula B is:
[0028] Among them, A is the set of next optional nodes for ants; represents the probability of the kth ant choosing the next node j when it is at node i;
[0029] τ ij (t) is the pheromone concentration from node i to j at time t;
[0030] η ij (t) represents the distance heuristic function:
[0031]
[0032] Among them, d ij is the Euclidean distance between node i and node j; d jD is the Euclidean distance between node j and the target point;
[0033] Where θ is the angle between the straight line between the current node i and the next node j and the straight line between the current node i and the previous node.
[0034] Preferably, the calculation formula of the pheromone update mechanism is:
[0035] τ ij (t+1)=(1-ρ)τ ij (t)+Δτ ij ;
[0036]
[0037]
[0038] Z = μM;
[0039] Where Δτ ij represents the sum of pheromones released by ants on two nodes; Indicates the pheromone increment between two nodes; L k represents the length of the path that ant kn passes through; Q is a constant, representing the initial value of the pheromone intensity; L g is the optimal path length of this iteration, K rank is the sequence number of the knth ant after sorting, Z is the number of ants that need to perform secondary pheromone updates; u represents the proportion of ants that perform secondary pheromone updates, and its value is (0, 1).
[0040] Compared with the prior art, the above technical solution of the present invention has the following beneficial technical effects:
[0041] The optimization method of the ant colony algorithm provided by the present invention introduces a corner heuristic function, which increases the directionality of path selection and effectively shortens the unnecessary time of the robot in the turning process; the distance heuristic function of the ant colony algorithm is re-improved, which effectively shortens the running time of the algorithm and the distance of the optimal moving path; the transfer probability formula is improved, the search space is increased in the early stage of iteration, and the convergence speed is accelerated in the later stage of iteration; a differentiated update strategy for pheromones is formulated to speed up the optimization speed; a pheromone threshold is set to prevent the algorithm from falling into a local optimum; the optimization method of the ant colony algorithm provided by the present invention can show obvious advantages in terms of the shortest path length, the number of inflection points and the convergence speed, and can maintain an extremely high convergence speed in environments with different complexities. The algorithm provided by the present invention is obviously superior and robust. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A perspective view of an embodiment of the present invention.
[0043] Figure 2 This is a schematic diagram of the direction of the corner in an embodiment of the present invention.
[0044] Figure 3 This is the path planning diagram of the four algorithms in Experiment 1.
[0045] Figure 4 This is the iterative convergence curve of the four algorithms in Experiment 1.
[0046] Figure 5 This is the path planning diagram of the four algorithms in Experiment 2.
[0047] Figure 6 This is the iterative convergence curve of the four algorithms in Experiment 2. DETAILED DESCRIPTION
[0048] In existing ant colony algorithms, ants emit a volatile hormone, called pheromone, as they travel along the path. This hormone allows them to communicate, but pheromones gradually evaporate over time. Ants tend to choose paths with higher levels of pheromones. Ants that find the shortest path are always the first to return to their nests, leaving more pheromones on the path. Furthermore, because more pheromones accumulate along the shortest path, more and more ants choose this path, and eventually all ants tend to choose it. The ant colony algorithm, based on this ant behavior, has three key characteristics: group cooperation, positive feedback selection, and parallel computing.
[0049] When an ant selects the next node to move to, it will select the next node based on the pheromone concentration of different paths and the path heuristic function. The probability formula for ant K moving from node i to node j is:
[0050] Among them, α is the pheromone factor, which reflects the relative importance of the amount of pheromone accumulated on the path during the ant movement in guiding the ant colony search; β is the heuristic function factor, which reflects the relative importance of heuristic information in guiding the ant colony search; A is the set of the next optional node of the ant; τ ij (t) is the pheromone concentration from node i to node j at time t; η ij (t) represents the distance heuristic function;
[0051]
[0052]
[0053] In the ant colony algorithm, ants select mobile nodes based on pheromones and leave pheromones along their paths. These pheromones evaporate over time. After completing an iteration, the global pheromone is updated in the following manner:
[0054] τ ij (t+1)=(1-ρ)τ ij (t)+Δτ ij
[0055]
[0056]
[0057] Where ρ is the pheromone volatilization coefficient, which reflects the disappearance level of pheromone. The larger the value, the faster the pheromone evaporates. Δτ ij represents the sum of pheromones released by ants on two nodes; Indicates the pheromone increment between two nodes; L k represents the length of the path that ant k passes through, Q is a constant, and represents the initial value of the pheromone intensity;
[0058] However, in the existing ant colony algorithm, if the initial pheromone value of each path is the same, the ants tend to randomly select the next node, so it takes a long time for the positive feedback to play a role, resulting in a slow initial convergence speed of the algorithm. At the same time, the heuristic function in the algorithm only considers the distance between the current node and the next node. From a global perspective, the heuristic function is not very inspiring and is prone to falling into local optimality. To this end, the present invention proposes the following technical solutions:
[0059] Example 1
[0060] like Figure 1As shown, the optimization method of an ant colony algorithm proposed in the present invention includes the following specific steps:
[0061] S1. Create a grid map, initialize parameters, and select M ants;
[0062] The initialization parameters include the total number of ants M, pheromone concentration factor α, heuristic information intensity factor β, pheromone initial intensity value Q, pheromone volatility coefficient ρ, the proportion of ants that need to update pheromones u and the maximum number of iterations Kmax;
[0063] Among them, the pheromone concentration factor α reflects the relative importance of the amount of pheromone accumulated on the path during the ant movement in guiding the ant colony search;
[0064] The heuristic information strength factor β reflects the relative importance of heuristic information in guiding ant colony search;
[0065] S2. Sort the M ants by number and define them as ant K1, ant K2, ..., ant Km. The value of m is the same as the value of M, and the M ants are all the same. The definition of ant K1, ant K2, ..., ant Km is only for the convenience of understanding and explanation. Among the M ants, ant K1, ant K2, ..., ant Km first performs the following operations on ant K1. After abandoning ant K1, continue to select ant K2. After abandoning ant K2, continue to select ant K3, and so on until ant Km is selected and abandoned.
[0066] S3, Ant K (i.e., Ant K1, Ant K2, ..., Ant Km) selects the next node in turn using the transition probability formula;
[0067] S4, determine whether ant K is in deadlock,
[0068] If so, abandon ant K and select the next ant K to continue executing S3;
[0069] If not, continue to execute S5;
[0070] S5, determine whether ant K has reached the end point,
[0071] If not, abandon ant K and select the next ant K to continue executing S3;
[0072] If so, record the path that ant K walked and continue to determine whether ant K is the Mth ant;
[0073] If yes, continue to execute S6;
[0074] If not, abandon ant K and select the next ant K to continue executing S3;
[0075] S6. Sort all the obtained path lengths from small to large, update them according to the pheromone update mechanism, and increase the number of iterations by 1;
[0076] S7, determining whether the number of iterations has reached the maximum number of iterations;
[0077] If yes, continue to execute S8;
[0078] If not, reselect M ants and continue to execute S2; perform a new round of iterations, and repeat this process until the number of iterations reaches the specified maximum number, then the algorithm terminates and outputs the optimal path;
[0079] S8. Output the optimal path.
[0080] Example 2
[0081] The existing ant colony algorithm uses a roulette wheel method to select the next node, which can easily cause ants to quickly concentrate on a path, but this path is not the global optimal situation. To solve the above technical problems, the present invention proposes an optimization method for the ant colony algorithm. Compared with the first embodiment, this embodiment describes the transition probability formula in detail.
[0082] The transition probability formula is:
[0083] Where q is a random number taken from the set (0, 1); is an adaptive dynamic variable;
[0084] j1 is the next node selected randomly, and j2 is the next node selected using formula B. Formula B is:
[0085] Among them, A is the set of next optional nodes for ants; represents the probability of the kth ant choosing the next node j when it is at node i;
[0086] τ ij (t) is the pheromone concentration from node i to j at time t; Indicates the degree of influence of this concentration on the probability of node selection, so a weight α is assigned; similarly Too;
[0087] η ij (t) represents the distance heuristic function:
[0088]
[0089] Among them, d ij is the Euclidean distance between node i and node j; d jD is the Euclidean distance between node j and the target point;
[0090] The distance heuristic function can increase the inspiration of the target node, guide the ants to move towards the target node, and reduce the probability of the algorithm falling into the local optimum. This can solve the technical problem that the existing ant colony algorithm uses the inverse of the distance from the current node to the candidate node as the only inspiration factor, and the inspiration of the target node is not strong.
[0091] Where θ is the angle between the straight line between the current node i and the next node j and the straight line between the current node i and the previous node. The larger the angle, the smaller the AGV turning angle, and the more likely the AGV is to choose this path. Figure 2 As shown, the above function is improved to define the corner heuristic function as follows. By introducing the corner heuristic function, the problem of the existing ant colony algorithm being too large and having too many corners is solved, which increases the path length and may cause the transported goods to fall off in the actual environment, resulting in unnecessary losses.
[0092] The existing ant colony algorithm updates all ants that reach the destination in a generation. Longer paths can be determined to be non-optimal paths. Updating pheromones for these paths increases the difficulty of finding the optimal solution and affects the convergence speed. To address the above technical issues, this technical solution designs a pheromone update mechanism that first sorts the paths of all ants that have found the destination from smallest to largest. Based on the original pheromone ranking, a certain proportion of ants are subjected to a secondary update. This mechanism increases the pheromone difference to quickly determine the optimal solution:
[0093] The calculation formula of the pheromone renewal mechanism is:
[0094] τ ij (t+1)=(1-ρ)τ ij (t)+Δτ ij ;
[0095]
[0096]
[0097] Z = μM;
[0098] Where Δτ ij represents the sum of pheromones released by ants on two nodes; represents the pheromone increment between two nodes; Lk represents the length of the path passed by ant kn; Q is a constant, representing the initial value of pheromone intensity; Lg is the optimal path length of this iteration, K rank is the sequence number of the knth ant after sorting, Z is the number of ants that need to perform secondary pheromone updates; u represents the proportion of ants that perform secondary pheromone updates, and its value is (0, 1).
[0099] In order to further verify the feasibility, stability and superiority of the optimization method of the ant colony algorithm proposed in this invention, a simulation experiment was carried out on MATLAB 2022b, and the operating environment was: WiN10 (64bit) operating system, Core TM i5-6200U processor, 8GB RAM;
[0100] The parameters of the optimized ant colony algorithm are set as follows: α = 1.5, β = 10, ρ = 0.9, Q = 1, M = 100, K max =400;
[0101] To verify the effectiveness of the proposed algorithm in robot path planning, two comparison files (D1 and D2) were selected as comparison algorithms. Simulation comparison experiments were conducted in two different environment maps (20×20 and 30×30) respectively.
[0102] D1: Ren Hongge, Hu Hongchang, Shi Tao. Global path planning of mobile robots based on improved ant colony algorithm[J]. Journal of North China University of Technology (Natural Science Edition), 2021, 43(02): 102-109.
[0103] D2: Zhang Tianrui, Wu Baoku, Zhou Fuqiang. Research on improved ant colony algorithm for robot global path planning[J]. Computer Engineering and Applications, 2022, 58(01): 282-291.
[0104] Experiment 1: Simulation comparison experiment in a 20×20 environment map
[0105] A simulation experiment was conducted in a 20×20 grid map, and the robot's moving path was planned using the optimization methods of ACO, D1, D2 and the ant colony algorithm proposed in this invention. Figure 3 and Figure 4 ;
[0106] Table 1 Comparison of simulation results of four ant colony algorithms on a 20×20 grid map
[0107]
[0108] As can be seen from Table 1, the results of the four algorithms are as follows: the shortest path length obtained by the optimization method of the ant colony algorithm proposed in the present invention is shortened by 17.3%, 12.8%, and 3.4% compared with the shortest path lengths obtained by applying the ACO algorithm, the algorithm described in D1, and the algorithm described in D2, respectively. The number of iterations of the optimal path is reduced by 90.1%, 89.6%, and 82.1%, respectively. The number of inflection points in the optimal path is reduced by 58.8% and 30% compared with the algorithms described in ACO and D1, respectively.
[0109] The above results show that in this simple environment, the optimal solution found by the optimization method of the ant colony algorithm proposed in this paper is better than other algorithms while the convergence speed is also greatly improved. In addition, the robot's walking path has fewer turning points and a smoother path. Therefore, the IACO algorithm proposed in this paper has a stronger optimization ability in robot path planning.
[0110] Experiment 2: Simulation comparison experiment in a 30×30 environment map
[0111] To verify the robot path planning capability of the optimization algorithm proposed in this paper under complex conditions, a robot path planning simulation was conducted in a 30×30 grid map. Due to the more complex terrain, in order to maintain the reliability of the algorithm, the number of ants was set to 100, the maximum number of iterations of the algorithm was set to 150, and other parameters remained unchanged. Figure 5 and Figure 6 ;
[0112] Table 2 Comparison of simulation results of four ant colony algorithms on a 30×30 grid map
[0113]
[0114]
[0115] As shown in Table 2, the shortest path obtained by applying the algorithm in this paper is shorter than that of the algorithms described in ACO, D1, and D2 by 17.8%, 4.6%, and 2%, respectively. The number of shortest path iterations is reduced by 93.2% and 88.9%, and the number of inflection points is reduced by 38.1% and 23.5%, respectively.
[0116] In complex environments, the ACO algorithm has a slow search speed, a long search path, and difficulty finding the optimal solution. The algorithms described in D1 and D2 have a certain degree of blindness in the early stages of their search, and their convergence is slow. However, the algorithm provided by the present invention has fewer inflection points and a smoother path, ensuring a high convergence speed in both environments, demonstrating its robustness.
[0117] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited thereto. Various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of the present invention.
Claims
1. An optimization method of ant colony algorithm, characterized in that: The specific steps include: S1. Create a grid map, initialize parameters, and select M ants. The initialized parameters include the total number of ants M, pheromone concentration factor α, heuristic information intensity factor β, initial pheromone intensity value Q, pheromone volatility coefficient ρ, the proportion of ants that need to update pheromones u, and the maximum number of iterations Kmax. S2. Sort the M ants by number, defining them as ant K1, ant K2, ... ant Km; S3, ant K selects the next node using the transition probability formula; S4, determine whether ant K is in deadlock, If so, abandon ant K and select the next ant K to continue executing S3; If not, continue to execute S5; S5, determine whether ant K has reached the end point, If not, abandon ant K and select the next ant K to continue executing S3; If so, record the path that ant K walked and continue to determine whether ant K is the Mth ant; If yes, continue to execute S6; If not, abandon ant K and select the next ant K to continue executing S3; S6. Sort all the obtained path lengths from small to large, update them according to the pheromone update mechanism, and increase the number of iterations by 1; S7, determining whether the number of iterations has reached the maximum number of iterations; If yes, continue to execute S8; If not, reselect M ants and continue to execute S2; S8, output the optimal path; The transition probability formula is: Where q is a random number taken from the set (0, 1); is an adaptive dynamic variable; j1 is the next node selected randomly, and j2 is the next node selected using formula B. Formula B is: Among them, A is the set of next optional nodes for ants; represents the probability of the kth ant choosing the next node j when it is at node i; τ ij (t) is the pheromone concentration from node i to j at time t; η ij (t) represents the distance heuristic function: Among them, d ij is the Euclidean distance between node i and node j; d jD is the Euclidean distance between node j and the target point; Where θ is the angle between the straight line between the current node i and the next node j and the straight line between the current node i and the previous node; The calculation formula of the pheromone renewal mechanism is: t ij (t+1)=(1-ρ)τ ij (t)+Δτ ij ; Z = μM; Where Δτ ij represents the sum of pheromones released by ants on two nodes; Indicates the pheromone increment between two nodes; L k represents the length of the path that ant kn passes through; Q is a constant, representing the initial value of the pheromone intensity; L g is the optimal path length of this iteration, K rank is the sequence number of the knth ant after sorting, Z is the number of ants that need to perform secondary pheromone updates; u represents the proportion of ants that perform secondary pheromone updates, and its value is (0, 1).
Citation Information
Patent Citations
Path optimization method based on ant colony algorithm and water surface garbage collection path planning
CN114721400A
Parking path planning method and system based on improved ant colony algorithm
CN114721402A