Path planning method based on improved genetic-ant colony algorithm

Through the improved genetic-ant colony algorithm, combined with pheromone update and genetic operations, the problem of insufficient efficiency and adaptability in the planning of traditional path planning methods in dynamic environment and complex path planning has achieved more efficient and accurate path planning.

CN119356322APending Publication Date: 2025-01-24HEBEI UNIV OF SCI & TECH +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411474075.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Traditional path planning methods are inefficient and adaptable when dealing with dynamically changing environments or needing to consider multiple constraints and optimization goals. Especially in large-scale or complex path planning problems, ant colony algorithms are prone to fall into local optimization.

Method used

Adopt the improved genetic-ant colony algorithm, through the population scale and pheromone matrix of the genetic algorithm and the ant colony algorithm, combine the pheromone update mechanism and the cross and mutant operation of the genetic algorithm of the ant colony algorithm, dynamically adjust the pheromone concentration, improve Path search for pertinence and efficiency.

Benefits of technology

It improves the efficiency and accuracy of path planning, enhances the global search ability and convergence speed of the algorithm, effectively avoids the diversity of local optimal solutions and maintains understanding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356322A_ABST
    Figure CN119356322A_ABST
Patent Text Reader

Abstract

The invention discloses a path planning method based on an improved genetic-ant colony algorithm, and belongs to the technical field of path planning. The method comprises the following steps: firstly, initializing a pheromone matrix of an ant colony algorithm by utilizing a genetic algorithm, then executing the ant colony algorithm, updating the pheromone matrix again, selecting an ant path with the maximum fitness value as an optimal path of the iteration, then generating a next-generation population, iterating in this way, and finally calculating the fitness value of the optimal path of each iteration. And selecting the path with the maximum fitness value as a final planned path. According to the method, the pheromone matrix of the ant colony algorithm is initialized by using the genetic algorithm, the quality of an initial solution is improved, and the algorithm convergence speed is accelerated; according to the fitness value, the ant colony algorithm population executing the genetic operation is classified, the understanding stability is further improved, the time loss and the path loss during path planning are reduced, and the efficiency and the accuracy of path planning are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of path planning, and in particular relates to a path planning method based on an improved genetic-ant colony algorithm. Background Art

[0002] Path planning is a critical issue in many industries and applications, which involves selecting the optimal path from one point to another. It has a wide range of applications in logistics, autonomous vehicles, robot navigation, network data transmission, etc. Although traditional path planning methods such as Dijkstra algorithm and A* algorithm are effective in static environments, their efficiency and adaptability are often limited when faced with dynamically changing environments or when multiple constraints and optimization objectives need to be considered.

[0003] With the development of technology, the ant colony algorithm, as a heuristic algorithm that simulates the natural ant colony to find food paths, has attracted attention for its high efficiency in path optimization problems. The algorithm simulates the release of pheromones by ants to mark the path and guide the behavior of later ones, and uses group intelligence to find the optimal path. However, when dealing with large-scale or complex path planning problems, the traditional ant colony algorithm still has the problems of slow convergence and easy to fall into local optimality.

[0004] In order to overcome these problems, researchers have proposed a variety of improved ant colony algorithms, introducing hierarchical strategies and hybrid algorithm strategies. The hierarchical strategy divides ants into different levels and adopts different search strategies for ants at different levels, thereby balancing exploration and utilization and increasing the global search capability and adaptability of the algorithm. The hybrid algorithm strategy usually combines the ant colony algorithm with other optimization algorithms such as genetic algorithms and particle swarm optimization, and takes advantage of the advantages of each algorithm to improve the quality of the solution and the convergence speed of the algorithm. Although these improvements have enhanced the performance of the ant colony algorithm, how to more effectively combine these strategies in the algorithm to adapt to more complex and changeable path planning needs is still an urgent problem to be solved. Summary of the invention

[0005] In view of this, the present invention provides a path planning method based on an improved genetic-ant colony algorithm to improve the efficiency and accuracy of path planning.

[0006] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0007] A path planning method based on an improved genetic-ant colony algorithm is used to plan an optimal path traversing N cities, comprising the following steps:

[0008] S1: Initialize the population size M, pheromone importance factor α, heuristic information importance factor β, and pheromone volatility factor ρ of the genetic algorithm and ant colony algorithm;

[0009] S2: Generate the pheromone matrix τ, the element τ in the i-th row and j-th column of the pheromone matrix τ ij represents the pheromone concentration from city i to city j, i, j = 1, 2, ..., N, and each element in the pheromone matrix τ is set to an initial value, which is less than 1;

[0010] S3: Generate an initial population, which contains M individuals, and the individuals are a randomly sorted sequence of N cities;

[0011] S4: Calculate the fitness value of each individual in the population. The fitness value is the total distance from the starting city in the sequence, visiting all the cities in the sequence in turn, and then returning to the starting city;

[0012] S5: Calculate pheromone increment based on fitness value

[0013]

[0014] In the formula, the superscript m represents the mth individual, i and j are the starting and ending cities of the mth individual, represents the pheromone increment from city i to city j obtained by the mth individual, Q is the pheromone intensity constant, L m is the fitness value of the mth individual;

[0015] S6: adding the pheromone increments of each individual in the population to the corresponding positions of the pheromone matrix τ to update the pheromone matrix τ;

[0016] S7: Execute the ant colony algorithm. The number of ants in the ant colony is M. Each ant is randomly placed in a city. The ants transfer between cities under the guidance of pheromone according to the pheromone matrix τ, forming M ant paths. Among them, the kth ant in the current city i is based on the transfer probability Select the next city j, The calculation formula is:

[0017]

[0018] Where η ij is the heuristic function value from city i to city j, d ij is the distance from city i to city j, allowed k is the set of cities that the kth ant has not visited;

[0019] S8: Update the pheromone matrix τ according to the M ant paths, and update the element τ in the i-th row and j-th column ij (t+1) is:

[0020]

[0021] In the formula, τ ij (t) is the pheromone concentration from city i to city j before updating, represents the sum of pheromone deposition of all ants on edge (i, j);

[0022] S9: Calculate the fitness value of each ant path, and select the ant path with the largest fitness value as the optimal path for this iteration;

[0023] S10: Perform genetic operations on the population to obtain a new generation of population;

[0024] S11: Return to step S4 until the preset number of iterations is reached;

[0025] S12: Calculate the fitness value of the optimal path of each iteration, and select the path with the largest fitness value as the final planning path.

[0026] Furthermore, the specific method of step S10 is:

[0027] S1001: Sort all individuals in the population in descending order of fitness value. The top 10% of individuals with the highest fitness value are classified as the elite population, the next 20% of individuals are classified as the superior population, the next 44% of individuals are classified as the medium population, and the remaining 26% of individuals are classified as the inferior population.

[0028] S1002: Perform a crossover operation on the superior population, randomly select two individuals each time to perform partial matching crossover, retain the new individual generated after the crossover, delete the two individuals involved in the crossover, and repeat this process until a final individual is obtained;

[0029] S1003: First, a crossover operation is performed on the medium population. Two individuals are randomly selected each time for partial matching crossover. After the crossover, the new individual generated is retained, and the two individuals involved in the crossover are deleted. This process is repeated until a final individual is obtained. Then, the final individual obtained by the crossover of the medium population is merged with the medium population before the crossover, and each individual in the merged population is mutated to obtain a mutated medium population. The mutation method is to exchange the positions of two random cities in the individual.

[0030] S1004: Merge the final individuals obtained by crossing the elite population, the superior population, and the mutated medium population to obtain a new generation population.

[0031] The beneficial effects of the present invention are:

[0032] 1. When initializing the pheromone matrix, the genetic algorithm is used for multiple iterations to gradually optimize the path quality of the initial population, thereby obtaining a better initial pheromone matrix. This method can improve the quality of the initial solution of the algorithm and accelerate the convergence speed;

[0033] 2. The present invention combines the advantages of ant colony algorithm and genetic algorithm, uses the pheromone update mechanism in ant colony algorithm to guide the search direction of the solution, and uses the crossover and mutation operations in genetic algorithm to accelerate the convergence speed of the solution. This hybrid algorithm can utilize the global search capability of genetic algorithm and the local optimization capability of ant colony algorithm to improve the solution effect of the algorithm;

[0034] 3. The present invention can dynamically adjust the concentration of pheromones to make the path search more targeted. This dynamic update mechanism enables the algorithm to converge to the optimal solution more quickly;

[0035] 4. The present invention divides the ant population into elite population, superior population, medium population and inferior population. The elite population retains the optimal solution, the superior population and the medium population are optimized through crossover and mutation operations, and the inferior population increases the diversity of the population through random initialization. This method can effectively maintain the diversity of solutions and ensure that good genes can be passed on to the next generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0037] Figure 1 are the two-dimensional coordinates of the cities of the six data sets provided by the present invention;

[0038] Figure 2 It is a schematic diagram of different types of populations performing different operations provided by the present invention;

[0039] Figure 3 This is a path visualization comparison diagram of the method provided by the present invention and other four intelligent optimization algorithms in the att48 data set;

[0040] Figure 4 is a normalized path loss comparison diagram provided by the present invention;

[0041] Figure 5 It is a normalized time loss comparison diagram provided by the present invention. DETAILED DESCRIPTION

[0042] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0043] A path planning method based on an improved genetic-ant colony algorithm is used to plan the optimal path traversing N cities. In this embodiment, six classic traveling salesman problem data sets (danzig, five_d, fri26, gr17, p01, att48) are selected as experimental objects. The two-dimensional positions of the cities in the six problems are as follows: Figure 1 The method comprises the following steps:

[0044] S1: Initialize the population size M, pheromone importance factor α, heuristic information importance factor β, and pheromone volatility factor ρ of the genetic algorithm and ant colony algorithm; among them, the pheromone importance factor α is used to determine the influence of pheromone concentration on ant path selection, the heuristic information importance factor β is used to control the influence of heuristic information on ant decision-making, and the pheromone volatility factor ρ is used to adjust the volatility speed of pheromone;

[0045] In this embodiment, the ant colony size M is set to 50. The pheromone importance factor α is set to 1 to control the influence of pheromone on the ant decision-making process. The heuristic pheromone importance factor β is set to 5 to make the ants choose shorter paths during the search process. The pheromone volatility factor is set to 0.1 to avoid the algorithm from converging too early to obtain a local optimal solution.

[0046] S2: Generate the pheromone matrix τ, the element τ in the i-th row and j-th column of the pheromone matrix τ ij represents the pheromone concentration from city i to city j, i, j = 1, 2, ..., N, and each element in the pheromone matrix τ is set to an initial value, which is less than 1;

[0047] S3: Generate an initial population, which contains M individuals, and the individuals are a randomly sorted sequence of N cities;

[0048] S4: Calculate the fitness value of each individual in the population. The fitness value is the total distance from the starting city in the sequence, visiting all the cities in the sequence in turn, and then returning to the starting city;

[0049] S5: Calculate pheromone increment based on fitness value

[0050]

[0051] In the formula, the superscript m represents the mth individual, i and j are the starting and ending cities of the mth individual, represents the pheromone increment from city i to city j obtained by the mth individual, Q is the pheromone intensity constant, L m is the fitness value of the mth individual;

[0052] S6: adding the pheromone increments of each individual in the population to the corresponding positions of the pheromone matrix τ to update the pheromone matrix τ;

[0053] S7: Execute the ant colony algorithm. The number of ants in the ant colony is M. Each ant is randomly placed in a city. The ants transfer between cities under the guidance of pheromone according to the pheromone matrix τ, forming M ant paths. Among them, the kth ant in the current city i is based on the transfer probability Select the next city j, The calculation formula is:

[0054]

[0055] Where η ij is the heuristic function value from city i to city j, d ij is the distance from city i to city j, allowed k is the set of cities that the kth ant has not visited;

[0056] S8: Update the pheromone matrix τ according to the M ant paths, and update the element τ in the i-th row and j-th column ij (t+1) is:

[0057]

[0058] In the formula, τ ij (t) is the pheromone concentration from city i to city j before updating, represents the sum of pheromone deposition of all ants on edge (i, j);

[0059] S9: Calculate the fitness value of each ant path, and select the ant path with the largest fitness value as the optimal path for this iteration;

[0060] S10: Perform genetic operations on the population, such as Figure 2 As shown, the specific method is:

[0061] S1001: Sort all individuals in the population in descending order of fitness value. The top 10% of individuals with the highest fitness value are classified as the elite population, the next 20% of individuals are classified as the superior population, the next 44% of individuals are classified as the medium population, and the remaining 26% of individuals are classified as the inferior population.

[0062] In this embodiment, in order to make the algorithm produce better results, according to the proportion allocated to each population, the number of elite populations is calculated to be 5, the number of superior populations is 10, the number of medium populations is 22, and the number of inferior populations is 13.

[0063] S1002: Perform a crossover operation on the superior population, randomly select two individuals each time to perform partial matching crossover, retain the new individual generated after the crossover, delete the two individuals involved in the crossover, and repeat this process until a final individual is obtained;

[0064] S1003: First, a crossover operation is performed on the medium population. Two individuals are randomly selected each time for partial matching crossover. After the crossover, the new individual generated is retained, and the two individuals involved in the crossover are deleted. This process is repeated until a final individual is obtained. Then, the final individual obtained by the crossover of the medium population is merged with the medium population before the crossover, and each individual in the merged population is mutated to obtain a mutated medium population. The mutation method is to exchange the positions of two random cities in the individual.

[0065] The principle of partially matched crossover (PMX) is as follows:

[0066] Let the two parent paths be P A ={a1,a2,…,a N}, P B ={b1,b2,…,b N}, where a i and b i Represents the city number in the path, and generates the corresponding child path P C , P D . Randomly select a crossover interval [k1,k2], where 1≤k1≤k2≤N.

[0067] Offspring P D Generation method: For the elements in the exchange interval, directly from P A Inherited from P D , at this time the offspring P D Some elements of are determined, and other positions are temporarily empty. For elements outside the intersection interval, fill P according to the following steps D :

[0068] If b i Not in the crossover zone In the i Put in P D If b i In the crossover zone In the interval, we need to find i The same element a j In the parent sequence PB The element b corresponding to the position in j , so that b i =b j , b i Put in P D If b j Also in the intersection interval, repeat the above steps until an element that is not in the interval is found. C The generation method is the same as above.

[0069] S1004: Merge the final individuals obtained by crossover of the elite population and the superior population and the mutated medium population to obtain a new generation population;

[0070] S11: Return to step S4 until the preset number of iterations is reached;

[0071] S12: Calculate the fitness value of the optimal path of each iteration, and select the path with the largest fitness value as the final planning path.

[0072] In order to fully evaluate the performance of this method in path planning, a path visualization diagram is generated in the MATLAB simulation software, and a comparison diagram of normalized path loss and time loss is drawn. In order to obtain experimental results that are closer to reality, the number of experimental iterations is set to 500. After the iteration is completed, the loss function is selected to view the path loss and time loss after the iteration. After each iteration, the training data and parameters are saved. When the number of iterations reaches 500, the iteration is stopped and the optimal path is output.

[0073] In order to better illustrate the technical effect of the present invention, the method proposed in the present invention is compared with the ant colony algorithm (Ant Colony Algorithm, ACA), genetic algorithm (Genetic Algorithm, GA), particle swarm optimization (Particle Swarm Optimization, PSO), and hybrid ant colony algorithm (Ant Colony Algorithm-Genetic Algorithm, ACA-GA) for experiments. Figure 3 This is a path visualization comparison chart of this method and the above four intelligent algorithms in the classic dataset att48, which is the most complex and representative traveling salesman problem. Figure 3 It can be seen that after traversing each city, this method has the least repeated paths. Figure 4 and Figure 5 The following are the comparison diagrams of normalized path loss and time loss of the method proposed in this invention and four intelligent algorithms in six data sets. Figure 4 As shown in FIG. 1 , the path loss of the method proposed in the present invention is always kept to a minimum compared with other methods. In terms of time loss, Figure 5As shown in the figure, it is the smallest in the five datasets, the second in the po1 and dantzig42 datasets, and the third in the other datasets. Based on the comprehensive analysis of path loss, time loss, and path visualization, this method has a faster convergence speed and the smallest path loss, which effectively improves the efficiency and accuracy of path planning.

[0074] In summary, the present invention uses a genetic algorithm to initialize the pheromone matrix of the ant colony algorithm, which improves the quality of the initial solution and accelerates the convergence speed of the algorithm; the ant colony algorithm population that performs genetic operations is classified according to the fitness value, which further improves the stability of the solution, reduces the time loss and path loss during path planning, and improves the efficiency and accuracy of path planning.

Claims

1. A path planning method based on an improved genetic-ant colony algorithm, characterized in that: The optimal path for planning traversal of N cities includes the following steps: S1: Initialize the population size M, pheromone importance factor α, heuristic information importance factor β, and pheromone volatility factor ρ of the genetic algorithm and ant colony algorithm; S2: Generate the pheromone matrix τ, the element τ in the i-th row and j-th column of the pheromone matrix τ ij represents the pheromone concentration from city i to city j, i, j = 1, 2, ..., N, and each element in the pheromone matrix τ is set to an initial value, which is less than 1; S3: Generate an initial population, which contains M individuals, and the individuals are a randomly sorted sequence of N cities; S4: Calculate the fitness value of each individual in the population. The fitness value is the total distance from the starting city in the sequence, visiting all the cities in the sequence in turn, and then returning to the starting city; S5: Calculate pheromone increment based on fitness value In the formula, the superscript m represents the mth individual, i and j are the starting and ending cities of the mth individual, represents the pheromone increment from city i to city j obtained by the mth individual, Q is the pheromone intensity constant, L m is the fitness value of the mth individual; S6: adding the pheromone increments of each individual in the population to the corresponding positions of the pheromone matrix τ to update the pheromone matrix τ; S7: Execute the ant colony algorithm. The number of ants in the ant colony is M. Each ant is randomly placed in a city. The ants transfer between cities under the guidance of pheromone according to the pheromone matrix τ, forming M ant paths. Among them, the kth ant in the current city i is based on the transfer probability Select the next city j, The calculation formula is: Where η ij is the heuristic function value from city i to city j, d ij is the distance from city i to city j, allowed k is the set of cities that the kth ant has not visited; S8: Update the pheromone matrix τ according to the M ant paths, and update the element τ in the i-th row and j-th column ij (t+1) is: In the formula, τ ij (t) is the pheromone concentration from city i to city j before updating, represents the sum of pheromone deposition of all ants on edge (i, j); S9: Calculate the fitness value of each ant path, and select the ant path with the largest fitness value as the optimal path for this iteration; S10: Perform genetic operations on the population to obtain a new generation of population; S11: Return to step S4 until the preset number of iterations is reached; S12: Calculate the fitness value of the optimal path of each iteration, and select the path with the largest fitness value as the final planning path.

2. The path planning method based on improved genetic-ant colony algorithm according to claim 1, characterized in that: The specific method of step S10 is: S1001: Sort all individuals in the population in descending order of fitness value. The top 10% of individuals with the highest fitness value are classified as the elite population, the next 20% of individuals are classified as the superior population, the next 44% of individuals are classified as the medium population, and the remaining 26% of individuals are classified as the inferior population. S1002: Perform a crossover operation on the superior population, randomly select two individuals each time to perform partial matching crossover, retain the new individual generated after the crossover, delete the two individuals involved in the crossover, and repeat this process until a final individual is obtained; S1003: First, a crossover operation is performed on the medium population. Two individuals are randomly selected each time for partial matching crossover. After the crossover, the new individual generated is retained, and the two individuals involved in the crossover are deleted. This process is repeated until a final individual is obtained. Then, the final individual obtained by the crossover of the medium population is merged with the medium population before the crossover, and each individual in the merged population is mutated to obtain a mutated medium population. The mutation method is to exchange the positions of two random cities in the individual; S1004: Merge the final individuals obtained by crossing the elite population, the superior population, and the mutated medium population to obtain a new generation population.

Citation Information

Cited By

  • Path optimization method and system without special communication channel based on intelligent collaborative path optimization algorithm

    CN120317466A

  • Intelligent collaborative path optimization algorithm-based path optimization method and system without dedicated communication channel

    CN120317466B

  • Continuous sampling measurement path optimization method for three-dimensional scanner and related equipment

    CN120651141A