A path planning method

By calculating the fitness based on the path length and number of turning points in the butterfly optimization algorithm and adjusting the switching probability, dynamically selecting the search strategy, the problem of insufficient accuracy in judging search types is solved, and the efficiency and accuracy of path planning are improved. .

CN117055551BActive Publication Date: 2024-12-24CHONGQING BITMAP INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310967463.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-31
Publication Date
2024-12-24
Estimated Expiration
2043-07-31

AI Technical Summary

Technical Problem

In the prior art, the butterfly optimization algorithm has poor accuracy when judging the global search or local search, resulting in a decrease in convergence speed and difficulty in jumping out of the local optimal.

Method used

By calculating the fitness based on the length of the path and the number of turning points, and nonlinear adjustments are made to the switching probability, random number judgment is generated for global search or local search, dynamically adjusting the selection probability to avoid falling into local optimality.

Benefits of technology

The convergence speed of the butterfly optimization algorithm is improved, ensuring that the solution is avoided when finding the optimal path, and at the same time, it can jump out of the local optimal solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117055551B_ABST
    Figure CN117055551B_ABST
Patent Text Reader

Abstract

The present invention discloses a path planning method, which comprises: creating a map according to an actual environment, presetting a butterfly population size as M and a total number of iterations, initializing M random paths on the map as initial values ​​of the M butterflies; obtaining the fitness of each butterfly according to the length and the number of turning points of each path; performing nonlinear adjustment on the fitness and the switching probability to obtain the selection probability; generating a random number, and judging whether to perform a global search or a local search according to the random number and the selection probability. The method solves the problem in the prior art that when the accuracy of judging whether to enter a global search or a local search is poor, the convergence speed of entering a global search will be reduced, and it is difficult to jump out of a local optimum after entering a local search.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a path planning method. Background Art

[0002] The purpose of path planning is to find a collision-free shortest transportation path from the starting point to the end point in a warehousing environment. The butterfly optimization algorithm is a search intelligence algorithm based on the foraging behavior of butterflies in the biological world. It is used to plan the shortest transportation path for robots.

[0003] In the butterfly algorithm, each butterfly will move toward the optimal butterfly individual because of the scent, which optimizes the position of the butterfly individual update to a certain extent. When entering the global search stage, the random number and selection probability determine the moving position of the next generation of butterflies. The randomly generated r makes the butterflies obtained by the algorithm more scattered, which will cause the next generation of butterfly individuals to not be able to move quickly to the position of the current optimal butterfly individual, resulting in a decrease in the convergence speed of the algorithm. When entering the local search stage, the butterfly cannot perceive the scent of the surrounding environment and will perform random searches near itself. However, due to the limited search range, the probability of the butterfly individual moving to the optimal butterfly individual is not high. At the same time, when the optimal value near itself is searched, it is difficult to jump out of the local optimum. Therefore, the accuracy of judging whether to enter the global search or the local search becomes particularly important.

[0004] It can be seen that in the prior art, when the accuracy of judging whether to enter global search or local search is poor, the convergence speed of entering global search will be reduced, and it will be difficult to jump out of the local optimum after entering local search. Summary of the invention

[0005] In view of the deficiencies in the prior art, the present invention provides a path planning method, which solves the problem in the prior art that when the accuracy of judging whether to enter a global search or a local search is poor, the convergence speed of entering the global search will be reduced, and it will be difficult to jump out of the local optimum after entering the local search.

[0006] The invention provides a path planning method, which comprises: creating a map according to an actual environment, presetting a butterfly population size as M and a total number of iterations, initializing M random paths on the map as initial values ​​of the M butterflies; obtaining the fitness of each butterfly according to the length and the number of turning points of each path; performing nonlinear adjustment on the fitness and the switching probability to obtain the selection probability; generating a random number, and judging whether to perform a global search or a local search according to the random number and the selection probability.

[0007] Optionally, the calculation formula for the selection probability is:

[0008]

[0009] Among them, p i represents the selection probability, p represents the switching probability, and fit i represents the fitness of the i-th butterfly.

[0010] Optionally, judging whether to enter a global search or a local search according to the random number and the selection probability includes: when the random number is smaller than the selection probability, performing a global search; when the random number is larger than the selection probability, performing a local search.

[0011] Optionally, the calculation formula for the global search is:

[0012]

[0013] in, represents the solution vector of the ith butterfly in the t+1th iteration, represents the solution vector of the i-th butterfly in the t-th iteration, and g* represents the optimal solution vector in the t-th iteration.

[0014] Optionally, the performing local search includes: calculating a dynamic variation probability factor of each butterfly; and obtaining local search results according to the dynamic variation probability factor.

[0015] Optionally, the calculation formula of the dynamic mutation probability factor is:

[0016]

[0017] Among them, p c Dynamic mutation probability factor, b represents the weight coefficient of the mutation factor, t represents the current number of iterations, and MaxIterate represents the total number of iterations.

[0018] Optionally, the calculation formula for the local search is:

[0019]

[0020] represents the solution vector of the ith butterfly in the t+1th iteration, represents the solution vector of the ith butterfly in the tth iteration, represents the solution vector of the j-th butterfly in the t-th iteration, represents the solution vector of the k-th butterfly in the t-th iteration.

[0021] Optionally, the fitness calculation formula is:

[0022]

[0023] Among them, fit represents fitness, pathlenth Indicates the length of the path, node num Indicates the number of turning points of the route.

[0024] Optionally, after performing a global search or a local search based on the random number and the selection probability, the planning method further includes: updating the butterfly position based on the results of the global search and the results of the local search; updating the current number of iterations based on the number of global searches and the number of local searches; and determining whether the current number of iterations reaches a preset total number of iterations.

[0025] Optionally, the determining whether the current number of iterations reaches a preset total number of iterations includes: when the current number of iterations is less than the preset total number of iterations, re-obtaining the fitness of each butterfly based on the length and the number of turning points of each path; when the current number of iterations is equal to the preset total number of iterations, outputting multiple global search search results or local search search results; and outputting the optimal path based on multiple global search search results or local search search results.

[0026] Compared with the prior art, the present invention has the following beneficial effects:

[0027] The fitness of each butterfly is obtained according to the length of each path and the number of turning points; the fitness and the switching probability are adjusted nonlinearly to obtain the selection probability; a random number is generated, and a global search or a local search is performed according to the random number and the selection probability. By performing nonlinear adjustment, the selection probability can be dynamically adjusted, that is, the butterfly with the best fragrance can be dynamically selected, and the local search is performed for the butterfly with a high fitness value, and the global search is performed for the butterfly with a disadvantageous fitness value. This can avoid destroying the optimal solution and avoid falling into the local optimum and being unable to get out. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A flow chart of a path planning method provided by an embodiment of the present invention;

[0029] Figure 2 A grid map of a storage environment provided by an embodiment of the present invention;

[0030] Figure 3 A flow chart of another path planning method provided by an embodiment of the present invention;

[0031] Figure 4 The path planning result diagram of different algorithms in an environment with an obstacle coverage rate of 10% provided by the embodiment of the present invention;

[0032] Figure 5 A comparison chart of the convergence of different algorithms provided in the embodiments of the present invention. DETAILED DESCRIPTION

[0033] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0034] Figure 1 A flow chart of a path planning method provided by an embodiment of the present invention is as follows: Figure 1 As shown, the planning method comprises the following steps:

[0035] Step S100: creating a map according to the actual environment, presetting the butterfly population size as M and the total number of iterations, and initializing M random paths on the map as the initial values ​​of M butterflies;

[0036] In step S100, a map is created according to the actual environment. Figure 2 A grid map of a storage environment provided by an embodiment of the present invention, such as Figure 2 As shown, for example, in a warehouse environment, a 20*20 grid map is established according to the warehouse environment and the location information of the obstacle area. The black squares represent obstacles, and the white squares represent the passable areas. M paths are created on the grid map, and the M random paths are initialized by the insertion method as the initial values ​​of the M butterflies.

[0037] Step S200: Obtaining the fitness of each butterfly according to the length and the number of turning points of each path;

[0038] In step S200, the calculation formula of the fitness is:

[0039]

[0040] Among them, fit represents fitness, path lenth Indicates the length of the path, node num Indicates the number of turning points of the route.

[0041] Step S300: nonlinearly adjusting the fitness and the switching probability to obtain the selection probability;

[0042] In step S300, the calculation formula of the selection probability is:

[0043]

[0044] Among them, p i represents the selection probability, p represents the switching probability, and fit i It represents the fitness of the i-th butterfly, that is, the fragrance value of the i-th butterfly.

[0045] Step S400: Generate a random number, and perform a global search or a local search based on the random number and the selection probability.

[0046] In step S400, the generated random number belongs to (0, 1), and the global search or local search is determined by comparing the generated random number with the selection probability.

[0047] In this implementation, the fitness of each butterfly is obtained according to the length of each path and the number of turning points; the fitness and the switching probability are nonlinearly adjusted to obtain the selection probability; a random number is generated, and a global search or a local search is performed based on the random number and the selection probability. By performing nonlinear adjustment, the selection probability can be dynamically adjusted, that is, the butterfly with the best scent can be dynamically selected, and the butterfly with a high fitness value is searched locally, while the butterfly with a low fitness value is searched globally. This can avoid destroying the optimal solution and avoid falling into the local optimum and being unable to get out.

[0048] In another embodiment of the present invention, the determination of entering into a global search or a local search based on the random number and the selection probability includes: when the random number is less than the selection probability, step S410: performing a global search; when the random number is greater than the selection probability, step S420: performing a local search.

[0049] In this embodiment, the calculation formula of the global search is:

[0050]

[0051] in, represents the solution vector of the ith butterfly in the t+1th iteration, represents the solution vector of the i-th butterfly in the t-th iteration, and g* represents the optimal solution vector in the t-th iteration.

[0052] In the global search phase, the improved butterfly selection operator p is used i The global search formula is improved, which effectively improves the convergence speed of the butterfly optimization algorithm.

[0053] In another embodiment of the present invention, performing a local search includes:

[0054] Step S421: Calculate the dynamic mutation probability factor of each butterfly;

[0055] Step S422: Obtain local search results according to the dynamic mutation probability factor.

[0056] In this embodiment, the calculation formula of the dynamic mutation probability factor is:

[0057]

[0058] Among them, p cDynamic mutation probability factor, b represents the weight coefficient of the mutation factor, t represents the current number of iterations, and MaxIterate represents the total number of iterations.

[0059] The calculation formula of the local search is:

[0060]

[0061] represents the solution vector of the ith butterfly in the t+1th iteration, represents the solution vector of the ith butterfly in the tth iteration, represents the solution vector of the j-th butterfly in the t-th iteration, represents the solution vector of the k-th butterfly in the t-th iteration.

[0062] By obtaining local search results through dynamic mutation probability factors, the probability of individual butterflies moving to the optimal butterfly position can be improved.

[0063] Figure 3 A flow chart of another path planning method provided by an embodiment of the present invention, such as Figure 3 As shown, after performing a global search or a local search based on the random number and the selection probability, the planning method further includes:

[0064] Step S500: updating the butterfly position according to the global search result and the local search result;

[0065] In step S500, after each global search or local search, the position of the butterfly is updated.

[0066] Step S600: updating the current iteration number according to the global search number and the local search number;

[0067] In step S600, each time a global search or a local search is performed, the optimal butterfly in the iteration can be found, and the position of the butterfly is a point on the final path.

[0068] Step S700: Determine whether the current number of iterations reaches the preset total number of iterations.

[0069] In step S700, specifically, Figure 3As shown, when the current number of iterations is less than the preset total number of iterations, return to step S200 to obtain the fitness of each butterfly according to the length and turning points of each path; when the current number of iterations is equal to the preset total number of iterations, it also includes S800: output multiple global search search results or local search search results; output the optimal path according to multiple global search search results or local search search results. After judging whether the current number of iterations reaches the preset total number of iterations, the positions of all optimal butterflies can be obtained, that is, all points of the optimal path are obtained, and all points are connected to obtain the optimal path.

[0070] It should be noted that the comparison between the improved butterfly optimization algorithm and the genetic algorithm and the butterfly optimization algorithm shows that the improved butterfly optimization algorithm has obvious advantages. The genetic algorithm parameters are set as follows: crossover probability is 0.7, mutation probability is 0.006, and the number of iterations is 200. For the butterfly optimization algorithm: perception state c = 0.8, response intensity a = 0.2, switching probability p = 0.8, and the number of iterations is 200. For the improved butterfly optimization algorithm: c = 0.8, a = 0.2, p = 0.5, weight coefficient b in the mutation factor = 0.1, and the number of iterations is 200.

[0071] When the environmental map is the same, the genetic algorithm, butterfly optimization algorithm and improved butterfly optimization algorithm are used for path planning respectively. In the 20×20 grid map with an obstacle coverage rate of 10%, the starting point coordinates are set to (1,20) and the end point coordinates are set to (20,1).

[0072] Figure 4 The embodiment of the present invention provides a path planning result diagram of different algorithms in an environment with an obstacle coverage rate of 10%, such as Figure 4 As shown in the figure, the genetic algorithm, the butterfly optimization algorithm and the improved butterfly optimization algorithm can all plan a complete path to avoid obstacles. The genetic algorithm has 11 inflection points, all of which are obtuse inflection points. Compared with acute inflection points, the route of obtuse inflection points is smoother; the butterfly optimization algorithm has 10 inflection points, one of which is a right-angle inflection point; the improved butterfly optimization algorithm has 11 inflection points, all of which are obtuse inflection points. Therefore, it can be seen that the improved butterfly optimization algorithm is smoother than the other two algorithms.

[0073] The effectiveness and superiority of the improved butterfly optimization algorithm are reflected by changing the size of the environment and the coverage rate of obstacles. Table 1 shows the test data of the genetic algorithm, butterfly optimization algorithm and improved butterfly optimization algorithm in different grid environments. The length unit in the table is meter. It can be seen from Table 1 that in the same simulation environment, compared with the improved butterfly optimization algorithm, the path length planned by the other two algorithms is longer. By comparing the genetic algorithm, butterfly optimization algorithm and improved butterfly optimization algorithm, it can be seen that in an environment with a grid map size of 20×20 and a coverage rate of 10%, the path length of the butterfly optimization algorithm is 40.516, and the path length of the improved butterfly optimization algorithm is 36.2843, which is 12.98% shorter than that of the genetic algorithm; in an environment with a grid map size of 20×20 and a coverage rate of 30%, the path length planned by the improved butterfly optimization algorithm is 11.54% less than that of the genetic algorithm. In the environment where the grid map size is 35×35 and the coverage rate is 10%, the path length planned by the improved butterfly optimization algorithm is reduced by 14.19%; in the environment where the grid map size is 35×35 and the coverage rate is 30%, the path length planned by the improved butterfly optimization algorithm is reduced by 14.92%. In the environment where the grid map size is 50×50 and the coverage rate is 10%, the path length planned by the improved butterfly optimization algorithm is reduced by 19.82%; in the environment where the grid map size is 50×50 and the coverage rate is 30%, the path length planned by the improved butterfly optimization algorithm is reduced by 22.30%. It can be seen that the path length planned by the improved butterfly optimization algorithm is the shortest and the path is smooth. Figure 5 The following is a comparison chart of the convergence of different algorithms provided by the embodiment of the present invention, such as Figure 5 As shown in the figure, the convergence of the improved butterfly optimization algorithm is better than that of the genetic algorithm and the butterfly optimization algorithm.

[0074] Table 1 Comparison of experimental results in different environments

[0075]

[0076]

[0077] In the present invention, the butterfly selection operator p is dynamically adjusted according to the individual fitness value. i Instead of the random fixed switching probability p, it is used to decide whether the butterfly position update enters the global search or the local search; in the global search stage of the algorithm, the improved butterfly selection operator p is used i The global search formula is improved to effectively improve the convergence speed of the butterfly optimization algorithm. In order to prevent the butterfly optimization algorithm from falling into the global optimum, a dynamic mutation factor p is introduced in the local search stage of the algorithm. c , in order to increase the probability of individual butterflies moving to the optimal butterfly position.

[0078] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.

Claims

1. A path planning method, characterized in that: The planning method includes: A map is created according to the actual environment, the butterfly population size is preset to M and the total number of iterations, and M random paths are initialized on the map as the initial value of M butterflies; The fitness of each butterfly is obtained according to the length and number of turning points of each path; The fitness and switching probability are adjusted nonlinearly to obtain the selection probability; The calculation formula of the selection probability is: in, represents the probability of selection, represents the switching probability, Indicates The fitness of a butterfly; A random number is generated, and a global search or a local search is performed based on the random number and the selection probability.

2. A path planning method according to claim 1, characterized in that: The step of determining whether to enter a global search or a local search according to the random number and the selection probability comprises: When the random number is less than the selection probability, a global search is performed; When the random number is greater than the selection probability, a local search is performed.

3. A path planning method as claimed in claim 2, characterized in that: The calculation formula of the global search is: in, Indicates A butterfly in the The solution vector in the iteration, Indicates A butterfly in the The solution vector in the iteration, g* represents the The optimal solution vector in iterations.

4. A path planning method as claimed in claim 2, characterized in that: The local search comprises: Calculate the dynamic mutation probability factor of each butterfly; A local search result is obtained according to the dynamic mutation probability factor.

5. A path planning method as claimed in claim 4, characterized in that: The calculation formula of the dynamic mutation probability factor is: in, Dynamic mutation probability factor, represents the weight coefficient of the variation factor, Indicates the current iteration number, Indicates the total number of iterations.

6. A path planning method as claimed in claim 5, characterized in that: The calculation formula of the local search is: Indicates A butterfly in the The solution vector in the iteration, Indicates A butterfly in the The solution vector in the iteration, Indicates A butterfly in the The solution vector in the iteration, Indicates A butterfly in the The solution vector at iteration .

7. A path planning method as claimed in claim 1, characterized in that: The calculation formula of the fitness is: in, represents fitness, represents the length of the path, Indicates the number of turning points in the route.

8. A path planning method as claimed in claim 1, characterized in that: After performing a global search or a local search according to the random number and the selection probability, the planning method further includes: Update the butterfly position according to the results of global search and local search; Update the current number of iterations according to the global search number and the local search number; Determine whether the current number of iterations reaches the preset total number of iterations.

9. A path planning method as claimed in claim 8, characterized in that: The step of determining whether the current number of iterations reaches the preset total number of iterations includes: When the current number of iterations is less than the preset total number of iterations, the fitness of each butterfly is obtained again according to the length and the number of turning points of each path; When the current number of iterations is equal to the preset total number of iterations, outputting a plurality of global search search results or local search search results; An optimal path is output according to the search results of multiple global searches or the search results of local searches.