Robot path planning method based on sparrow search algorithm
By introducing standard normal distribution initialization, adjustment factor ωm update location and mixed mutation strategy into the sparrow search algorithm, and reinforcing learning to adjust the proportion of discoverers, the slow convergence of the sparrow search algorithm and easy to fall into local extreme value problems are solved, and more efficient path planning is achieved.
Patent Information
- Application Number
- CN202510520545.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-01
AI Technical Summary
The existing sparrow search algorithm has the problems of slow convergence and easy to fall into local extreme values in path planning, which limits its practical application.
The sparrow position is initialized by standard normal distribution, combined with the regulation factor ωm, and a mixed variation strategy and reinforcement learning are proposed to dynamically adjust the proportion of discoverers to improve the sparrow search algorithm.
It improves the search capability and convergence speed of the sparrow search algorithm, and can find high-quality path planning solutions faster, reducing the number of iterations and path length.
Smart Images

Figure CN120406443A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of robot navigation, and particularly to a robot path planning method based on a sparrow search algorithm. Background Art
[0002] Robot path planning is to find an effective path from the starting point to the target point for the robot within a given motion space. With the continuous development of intelligent algorithms, many intelligent algorithms have been widely applied in the field of path planning, such as AGV (Automated Guided Vehicle), driverless vehicles, and warehousing logistics, etc., to improve the navigation efficiency of the robot. The existing common intelligent algorithms include ant colony algorithm, A* algorithm, artificial potential field method, genetic algorithm, particle swarm algorithm, etc.
[0003] The sparrow search algorithm is one of the intelligent algorithms. This method mimics the foraging behavior of sparrows in nature and has a certain global optimization ability, and can be applied to complex optimization problems. This method adopts various strategies such as following, chasing, and cooperation, making it have strong adaptability and can be dynamically adjusted according to the actual situation. However, currently, this method has deficiencies such as slow convergence and easy to fall into local extrema, thus restricting the practical application of this method. Summary of the Invention
[0004] The present invention provides a robot path planning method based on a sparrow search algorithm to solve the above technical problems.
[0005] To solve the above technical problems, the present invention provides a robot path planning method based on a sparrow search algorithm, including the following steps:
[0006] Step 1: Initialize the population;
[0007] Step 2: Determine the initial proportion of discoverers and joiners in the entire population;
[0008] Step 3: Determine the current position of the discoverer, and update the position of the discoverer based on the mutation strategy and the adjustment factor ω m Update the position of the discoverer;
[0009] Step 4: Update the position of the joiner;
[0010] Step 5: Update the position of the vigilant;
[0011] Step 6: Calculate the individual optimal fitness, and dynamically adjust the proportion of discoverers using reinforcement learning;
[0012] Step 7: Substitute the adjusted proportion of discoverers into the program for position update, and determine whether the updated position is better than the previous position. If so, use the new position; if not, re-perform position update;
[0013] Step 8: Output the optimal position and optimal fitness value of the sparrow individuals.
[0014] Preferably, the grid method is used for the environmental modeling of the robot.
[0015] Preferably, in Step 1, the position is initialized by perturbing with a standard normal distribution.
[0016] Preferably, the initialization equation is:
[0017] X i,j = X rand + ε
[0018] where X i,j is the initialized position, X rand is a random position, and ε is a random number following a standard normal distribution.
[0019] Preferably, for the first Nu individuals, the position of the discoverer is updated based on the mutant individuals; for the remaining individuals, the position of the discoverer is updated using the position update method with the adjustment factor ω m .
[0020] Preferably, in Step 3, the mutation strategy is a hybrid mutation strategy based on Gaussian mutation and Cauchy mutation.
[0021] Preferably, the position of the mutant individual is calculated as:
[0022]
[0023] where is the individual with mutation at iteration t, Gauss(0,1) is a random variable with a Gaussian distribution having a mean of 0 and a variance of 1, Gauchy(0,1) is a random variable with a Cauchy distribution having a mean of 0 and a variance of 1, and C1 and C2 are the mutation ranges respectively.
[0024] Preferably, C1 and C2 are respectively:
[0025]
[0026] where k1 and k2 are random numbers, t is the current iteration number, and t max represents the global maximum iteration number.
[0027] Preferably, in Step 3, the adjustment factor ω m is:
[0028]
[0029] where m0 is the control factor of the search range, t is the current iteration number, and tmax Represents the global maximum number of iterations.
[0030] Preferably, in step 6, the steps of the reinforcement learning include:
[0031] Step 61: Design the state, and the state equation is:
[0032]
[0033] where, is the current global optimal fitness, is the global optimal fitness of the previous generation;
[0034] Step 62: Design the action, including: Select an action a according to the current state, where a represents the selected discoverer ratio;
[0035] Step 63: Design the reward and punishment function r,
[0036] r = -(f g - min(f))
[0037] where, min(f) is the minimum fitness in the current population.
[0038] Compared with the prior art, the robot path planning method based on the sparrow search algorithm provided by the present invention has the following advantages:
[0039] 1. By establishing a regulation factor, the present invention can adaptively update the position of the discoverer, expanding the search range of the discoverer; in addition, on the basis of traditional Gaussian mutation and Cauchy mutation, a hybrid mutation strategy is proposed, enabling the algorithm to avoid falling into local optimum in the initial stage of iteration and accelerating the convergence speed in the middle and late stages of iteration;
[0040] 2. The present invention uses reinforcement learning to dynamically adjust the proportion of discoverers, which can improve the search ability of the algorithm and effectively discover high-quality path planning solutions;
[0041] 3. The method provided by the present invention uses the standard normal distribution function to initialize the sparrow positions, which not only increases the diversity of the search but also introduces a wider range of randomness in the search space. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flowchart of the robot path planning method based on the sparrow search algorithm in a specific embodiment of the present invention;
[0043] Figure 2 is a schematic diagram of a grid map;
[0044] Figure 3 is a schematic diagram of the robot movement direction;
[0045] Figure 4a and 4b are respectively the schematic diagrams of the simulation experiment results of path planning by the traditional sparrow search algorithm and the method proposed in this application in a 20×20 grid map;
[0046] Figure 5 is the comparison chart of the convergence curves of the traditional sparrow search algorithm and the method proposed in this application (20×20 grid map);
[0047] Figure 6a and 6b are respectively the schematic diagrams of the simulation experiment results of path planning by the traditional sparrow search algorithm and the method proposed in this application in a 30×30 grid map;
[0048] Figure 7 is the comparison chart of the convergence curves of the traditional sparrow search algorithm and the method proposed in this application (30×30 grid map). Detailed implementation manner
[0049] In order to more elaborately describe the technical solutions of the above invention, specific embodiments are listed below to prove the technical effects; it should be emphasized that these embodiments are used to illustrate the present invention and not to limit the scope of the present invention.
[0050] The robot path planning method based on the sparrow search algorithm provided by the present invention, as Figure 1 shown, includes the following steps:
[0051] Step 1: Initialize the population;
[0052] Step 2: Obtain the current population state and determine the initial proportion of discoverers and joiners in the entire population;
[0053] Step 3: Determine the current position of the discoverer and update the position of the discoverer based on the mutation strategy and the adjustment factor ω m ;
[0054] Step 4: Update the position of the joiner;
[0055] Step 5: Update the position of the vigilant;
[0056] Step 6: Calculate the individual optimal fitness and dynamically adjust the proportion of discoverers by using reinforcement learning;
[0057] Step 7: Substitute the adjusted proportion of discoverers into the program for position update, and determine whether the updated position is better than the previous position. If so, use the new position; if not, re-perform the position update;
[0058] Step 8: After reaching the maximum number of iterations, output the optimal position and optimal fitness value of the sparrow individuals.
[0059] In the present invention, by establishing a regulation factor, the position of the discoverers can be updated adaptively, expanding the search scope of the discoverers. Additionally, based on traditional Gaussian mutation and Cauchy mutation, a hybrid mutation strategy is proposed, enabling the algorithm to avoid falling into local optima in the initial stage of iteration and accelerating the convergence rate in the middle and late stages of iteration. Meanwhile, the present invention uses reinforcement learning to dynamically adjust the proportion of discoverers, which can improve the search ability of the algorithm and effectively discover high-quality path planning solutions.
[0060] Specifically, the present invention uses the grid method for the environmental modeling of the robot, that is, the space around the mobile robot is divided into grid cells of the same size, and black and white are respectively used for obstacles and blank channels. Specifically, when the grid corresponding to the obstacle is black, it is represented by 1 when drawing the grid; the grid corresponding to the blank passable area is white and is represented by 0 in the matrix, as Figure 2 shown. Using the grid method can quickly find an optimal and shortest path in a specific environment, thereby completing the tasks of the robot.
[0061] In the grid map, the mobile robot has 8 optional directions and can move along the grids of the blank passable area, but cannot move to the grids corresponding to the obstacles. The directions of the mobile robot are as Figure 3 shown. Using the grid method for environmental modeling, its data structure is simple, with strong real-time performance, and can facilitate environmental modeling and spatial analysis.
[0062] In the traditional Sparrow Search Algorithm (SSA), the sparrow population can be divided into discoverers and joiners, and a vigilant with scouting and warning behaviors is added.
[0063] Establish a model, and the sparrow population can be initialized according to Equation (1).
[0064]
[0065] In the formula: I is the number of all sparrows; J is the dimension of the search space.
[0066] The sparrow fitness value is expressed as:
[0067]
[0068] The discoverers are responsible for guiding the entire sparrow population to search for food. The position update formula of the discoverers is shown in Equation (3).
[0069]
[0070] where: t is the current iteration number; t max represents the global maximum number of iterations; is the position information of the i-th sparrow population in the j-th dimension at the t-th iteration; α represents a random number between 0 and 1; R and ST are the warning value and safety value of the sparrow population position respectively, where R ∈ [0, 1]; ST ∈ [0.5, 1]. When R < ST, the discoverer can conduct extensive exploration operations within the area. When R ≥ ST, the vigilant perceives danger and issues an alarm to other sparrows, and the sparrow group immediately takes evasive actions; Q represents a random number subject to the standard normal distribution; L is a 1×d matrix with all elements being 1.
[0071] The position update of the joiner is shown in Equation (4).
[0072]
[0073] where: x worst is the current global worst position; x p is the optimal position where the current discoverer is located; A is a 1×d matrix, where each element is randomly assigned 1 or -1, A + = A T (AA T ) -1 .
[0074] When i > n / 2, it means that the i-th joiner is in a state of not getting food, with a relatively low fitness value and no qualification to compete with the discoverer, and needs to fly to other safe areas to forage; when i ≤ n / 2, it means that the i-th joiner has a better fitness, and the joiner will forage within the area of the current optimal individual. In the sparrow population, in addition to the discoverer and the joiner, there are also vigilant ones responsible for scouting and warning, accounting for 10%-20% of the whole. The vigilant ones are responsible for warning the surrounding of the foraging area. If there is danger, the vigilant ones will immediately give an early warning to the whole population and transfer to another place.
[0075] The position update formula of the vigilant is shown in Equation (5).
[0076]
[0077] where: x great is the current global optimal position; β is the step size adjustment parameter, which is a random number subject to the standard normal distribution; k is a random number in the interval [-1, 1]; ε takes a very small value to prevent the denominator from being 0; f i is the fitness of the i-th individual at the current iteration; f w is the fitness value of the global worst individual at the current iteration; f gis the fitness value of the globally optimal individual for the current iteration.
[0078] It can be seen from Equation (5) that if f i > f g , it means that this sparrow individual is at the periphery of the population and is relatively dangerous, and it needs to escape to a safe location. If f i = f g , it means that this sparrow individual is already at the center of the population and needs to approach other sparrows to reduce risks.
[0079] The initial positions of the traditional sparrow search algorithm are randomly generated, and these positions are evenly distributed. The uniform random distribution may cause the initial population to be too dense in some areas and too sparse in other areas, resulting in insufficient diversity. This application uses the standard normal distribution to perturb the initialization positions, and its initialization equation is:
[0080] X i,j = X rand + ε (6)
[0081] where X i,j is the initialization position, X rand is a random position, and ε is a random number subject to the standard normal distribution.
[0082] This application utilizes the good characteristics of the normal distribution such as self - adaptability, ergodicity, and randomness to increase the diversity of the population, so that the sparrow search algorithm can better explore the space and find better solutions. At the same time, due to the relatively wide tail of the normal distribution, it means that the generated initial positions have a certain degree of randomness in the search space.
[0083] Since the effect of the sparrow search algorithm is closely related to the position update method of the discoverer. Therefore, this application has improved the update method of the discoverer.
[0084] According to the discoverer position update formula (3) of the sparrow search algorithm, it can be known that the position of the discoverer will change with the increase of the iteration number, and the main influencing term is:
[0085]
[0086] The range of this influencing term will gradually decrease from (0, 1) to (0, 0.36). At the same time, with the increase of the iteration number, there will be a problem of slow response speed. For this reason, this application establishes a regulation factor ω m to improve the search method of the discoverer, thereby expanding the search range of the discoverer.
[0087] Specifically, the regulation factor ω m is:
[0088]
[0089] Among them, m0 is the control factor of the search range, and m0 ∈ [1.5, 2]. In this embodiment, the value of m0 is taken as 1.6. t is the current iteration number, and t max represents the global maximum number of iterations.
[0090] Thus, the updated formula for the discoverer's position after improvement is shown in formula (8).
[0091]
[0092] In addition, the traditional SSA algorithm will be prone to falling into the local optimum in the middle and late stages of iteration, resulting in premature convergence. Therefore, based on the traditional Gaussian mutation and Cauchy mutation, this application proposes a new hybrid mutation strategy to solve the above problems. After improvement, the Cauchy mutation is used to improve the search ability for the search space, while the Gaussian mutation can provide a more detailed search.
[0093] Specifically, this application selects Nu individuals of random numbers for Cauchy and Gaussian hybrid mutation. Two adjustment factors for the mutation ranges C1 and C2 are introduced and calculated through the following formula:
[0094]
[0095] Among them, k1 and k2 are random numbers, and the initial values designed in this application are taken as k1 = k2 = 0.5. t is the current iteration number, and t max represents the global maximum number of iterations.
[0096] The position of the mutated individual is calculated through the following function:
[0097]
[0098] Among them, is the individual with mutation at iteration t, Gauss(0, 1) is a random variable with a Gaussian distribution having a mean of 0 and a variance of 1, and Gauchy(0, 1) is a random variable with a Cauchy distribution having a mean of 0 and a variance of 1.
[0099] At the beginning of iteration, C2 is relatively large, and then gradually decreases as the iteration increases. This way makes the influence of the Cauchy mutation greater and can search for better solutions within a larger range. At the same time, C1 gradually increases, and the Gaussian mutation accounts for a larger proportion in the middle and late stages of iteration, accelerating the convergence process. In short, this method can enable the algorithm to jump out of the local optimum state at the initial stage of iteration and can speed up the convergence rate in the middle and late stages of iteration.
[0100] Therefore, in the present application, for the first Nu individuals, based on the mutant individuals, the position of the discoverer is updated using Equation (11); for the remaining individuals, i.e., the individuals after Nu, the discoverer position update method with the adjustment factor ω m is used to update the position of the discoverer, i.e., Equation (8).
[0101] In the present application, the proportion of discoverers in the population can be dynamically adjusted using reinforcement learning to improve the search ability of the algorithm. Specifically, the present application uses the Q-learning algorithm to make decisions in an unknown environment. Specifically, this algorithm learns a value function Q to guide the behavior, and this value function represents the expected reward for taking a specific action in a given state. The Q-learning algorithm continuously updates the Q value through the concept of rewards and punishments to approximate the optimal policy, thereby achieving the learning and optimization of the environment. The most important thing in the Q-learning algorithm is to create a Markov decision process model, and this process requires designing the state, action, and reward functions.
[0102] Specifically, it includes the following steps:
[0103] Step 61: Design the state.
[0104] The purpose of path planning is to find the shortest path as the optimal path, and the state can be defined as an equation related to the current global optimal fitness and the previous generation's global optimal fitness. Equation (12) gives the state equation.
[0105]
[0106] Among them, is the current global optimal fitness, is the previous generation's global optimal fitness.
[0107] Step 62: Design the action.
[0108] For each iteration, the agent (i.e., the entity that executes actions in the environment to achieve a certain goal) will take different actions to adjust the more appropriate proportion V of discoverers in the population. The present application defines an action set, and here the action set is: a ∈ {0.2, 0.3, 0.4}. At each time step, the algorithm will select an action a according to the current state, where a represents the selected proportion of discoverers.
[0109] Step 63: Design the reward and punishment function r.
[0110] The main body of the Q - learning algorithm brings rewards through different actions and continuously updates the Q - value to approximate the optimal strategy. The reward and punishment function of this application is related to the individual's best fitness. If the global optimal fitness decreases, the reward is positive; if it does not decrease, the reward is negative or zero. Formula (13) is the reward and punishment function designed in this application.
[0111] r = -(f g - min(f)) (13)
[0112] Among them, min(f) is the minimum fitness in the current population.
[0113] To verify the effectiveness of the optimized algorithm of this application, simulation experiments on path planning are carried out for the traditional sparrow search algorithm and the method provided in this application in 20×20 grid maps and 30×30 grid maps respectively, and then various indicators are compared. The operating environment of the simulation experiment is MATLAB R2022a.
[0114] First, establish simulation environment 1, that is, a 20×20 - scale grid map, and conduct simulation experiments on path planning for the traditional sparrow search algorithm and the method provided in this application.
[0115] In simulation environment 1, the path - planning diagram of the traditional sparrow search algorithm is shown in Figure 4(a), the path - planning diagram of the method provided in this application is Figure 4(b), and the comparison diagram of their convergence curves is Figure 5 . The simulation results of path planning are shown in Table 1, mainly examining two aspects: the minimum path length and the number of iterations.
[0116] Table 1 Simulation results of path planning in simulation environment 1
[0117] Algorithm Minimum path length / m Number of iterations Traditional sparrow search algorithm 33.1526 95 Method of the present application 32.4281 74
[0118] It can be seen from Table 1 that in the 20×20 scale, the minimum path length of this application is 0.7245 m shorter than that of the traditional algorithm. The algorithm of this application reaches stability in the 74th generation, and the traditional algorithm reaches stability in the 95th generation. The algorithm of this application reduces 21 generations.
[0119] Then, establish simulation environment 2, that is, a 30×30 - scale grid map, and conduct simulation experiments on path planning for the traditional sparrow search algorithm and the method provided in this application.
[0120] In simulation environment 2, the path planning of the traditional sparrow search algorithm is shown in Figure 6(a), the path planning of the improved algorithm of this application is shown in Figure 6(b), and the comparison diagram of their convergence curves is as Figure 7 shown. The simulation results of path planning are shown in Table 2, mainly examining two aspects: the minimum path length and the number of iterations.
[0121] Table 2 Simulation Environment 2 Path Planning Simulation Results
[0122] Algorithm Minimum path length / m Number of iterations Traditional sparrow search algorithm 51.8142 188 Method of the present application 43.4580 118
[0123] It can be seen from Table 2 that the minimum path length of the algorithm of the present application is shortened by 8.3562 m compared with the traditional algorithm, and the number of iterations is reduced by 70 times compared with the traditional algorithm to reach stability.
[0124] In summary, for the robot path planning method based on the sparrow search algorithm provided by the present invention, the standard normal distribution function is used to initialize the position, which increases the diversity of the search. Then, by establishing an adjustment factor, the position of the discoverer is updated adaptively, expanding the search range of the discoverer. In addition, the present application proposes a Gaussian and Cauchy hybrid mutation strategy, which enables the algorithm to avoid falling into local optimum in the initial stage of iteration and to accelerate the convergence speed in the middle and late stages of iteration. Finally, it is proposed to use reinforcement learning to dynamically adjust the number of discoverers, which helps to improve the search efficiency of the algorithm. Through the experimental verification of the algorithm in various simulation environments, the effectiveness of the improvement of the sparrow search algorithm is proved.
[0125] Obviously, those skilled in the art can make various changes and modifications to the invention without departing from the spirit and scope of the invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.
Claims
1. A robot path planning method based on the sparrow search algorithm, characterized in that It includes the following steps: Step 1: Population initialization; Step 2: Determine the initial proportion of discoverers and joiners in the entire population; Step 3: Determine the current position of the discoverer, and update the position of the discoverer based on the mutation strategy and the adjustment factor ω m Update the position of the discoverer; Step 4: Update the positions of the joiners; Step 5: Update the positions of the vigilant ones; Step 6: Calculate the individual optimal fitness, and dynamically adjust the proportion of discoverers using reinforcement learning; Step 7: Substitute the adjusted proportion of discoverers into the program for position update, and determine whether the updated position is better than the previous one. If so, use the new position; if not, re - perform the position update; Step 8: Output the optimal position and optimal fitness value of the sparrow individuals.
2. The robot path planning method based on the sparrow search algorithm according to claim 1, characterized in that, Use the grid method to perform environmental modeling of the robot.
3. The robot path planning method based on the sparrow search algorithm according to claim 1, characterized in that In Step 1, initialize the position using standard normal distribution perturbation.
4. The robot path planning method based on the sparrow search algorithm according to claim 3, characterized in that, The initialization equation is: X i,j = X rand + ε where X i,j is the initial position, X rand is a random position, and ε is a random number subject to the standard normal distribution.
5. The robot path planning method based on the sparrow search algorithm according to claim 1, wherein For the first Nu individuals, update the position of the discoverer based on the mutated individuals; for the remaining individuals, update the position using the discoverer position update method with the adjustment factor ω m to update the position.
6. The robot path planning method based on the sparrow search algorithm according to claim 5, wherein, In Step 3, the mutation strategy is a hybrid mutation strategy based on Gaussian mutation and Cauchy mutation.
7. The robot path planning method based on the sparrow search algorithm according to claim 6, characterized in that, The position calculation of the mutated individual is: wherein, is an individual with mutation at iteration t, Gauss(0,1) is a random variable with a Gaussian distribution having a mean of 0 and a variance of 1, Gauchy(0,1) is a random variable with a Cauchy distribution having a mean of 0 and a variance of 1, and C1 and C2 are the mutation ranges respectively.
8. The robot path planning method based on the sparrow search algorithm according to claim 7, wherein, C1 and C2 are respectively: Among them, k1 and k2 are random numbers, t is the current iteration number, and t max represents the global maximum number of iterations.
9. The robot path planning method based on the sparrow search algorithm according to claim 5, characterized in that In step 3, the adjustment factor ω m is: Among them, m0 is the control factor of the search range, t is the current iteration number, and t max represents the global maximum number of iterations.
10. The robot path planning method based on the sparrow search algorithm according to claim 1, characterized in that, In Step 6, the steps of the reinforcement learning include: Step 61: Design the state, and the state equation is: Among them, is the current global optimal fitness, is the global optimal fitness of the previous generation; Step 62: Design the action, including: Select an action a according to the current state, where a represents the selected proportion of discoverers; Step 63: Design the reward - punishment function r, r = -(f g - min(f)) where min(f) is the minimum fitness in the current population.
Citation Information
Cited By
Multi-sensor position intelligent generation method for information fusion accuracy
CN121684214A