An improved mayfly algorithm-based global path planning method for mobile robots
By improving the mayfly algorithm and introducing ion motion cross-search, adaptive inertia weight, and F-distribution variation, the problems of insufficient global search capability and local optima in path planning of the mayfly algorithm are solved, and better path planning results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIANGTAN UNIV
- Filing Date
- 2023-05-31
- Publication Date
- 2026-05-08
AI Technical Summary
Existing mayfly algorithms have weak global search capabilities, are prone to getting trapped in local optima, and struggle to achieve ideal accuracy and stability in path planning.
The improved mayfly algorithm optimizes the path planning process and improves convergence efficiency and global search capability by introducing ion motion cross-search rules, adaptive inertia weights, F-distribution random mutation, and penalty function.
The improved mayfly algorithm exhibits better search capabilities and faster convergence speed in path planning, yields better paths, and is more stable.
Smart Images

Figure CN116652947B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robot path planning, and in particular to a global path planning method for mobile robots based on an improved mayfly algorithm. Background Technology
[0002] Autonomous mobile robots are programmable, multi-tasking mechanical devices capable of moving freely in environments containing obstacles, performing various functions, and acquiring environmental information through sensors. Path planning is one of the most fundamental problems that mobile robots must solve before completing their tasks. Path planning technology establishes behavioral guidelines for robots to move within a defined space, following specific performance indicators and algorithms. Its purpose is to search for feasible and expected action paths for the robot from its current position to a target point in space. Early researchers proposed many algorithms for robot path planning, but these methods all have some drawbacks, such as being overly complex and unsuitable for complex environments. To overcome these shortcomings, metaheuristic methods have attracted a large number of researchers in recent years, such as ant colony optimization, particle swarm optimization, and bacterial foraging optimization algorithms.
[0003] In 2020, Konstantions Zervoudakis proposed a novel swarm intelligence algorithm—the Mayfly Algorithm (MA)—which combines the advantages of particle swarm optimization, firefly optimization, and genetic algorithms. Compared to most bio-inspired optimization algorithms, the Mayfly Algorithm has a faster convergence speed and higher convergence accuracy. However, the Mayfly Algorithm has weak global search capabilities and suffers from low diversity and stagnation problems, such as local optima, which makes it difficult to achieve ideal accuracy and stability in the later stages of the algorithm. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a global path planning method for mobile robots based on an improved mayfly algorithm, which features a simple algorithm, good search capability, and fast and stable convergence.
[0005] The technical solution of this invention to solve the above problems is: a global path planning method for mobile robots based on an improved mayfly algorithm, comprising the following steps:
[0006] Step 1: Obtain map information and model the map environment;
[0007] Step 2: Initialize mayfly population parameters and randomly generate mayfly population locations. x Set initial speed v If the initial value is zero, generate an initial path and calculate the fitness value;
[0008] Step 3: Update the speed and position of the male and female mayflies;
[0009] Step 4: Calculate the updated fitness value of the mayflies, and then sort the mayflies by position from smallest to largest according to their fitness value;
[0010] Step 5: Generate mayfly offspring and perform mutation operations on the offspring mayflies;
[0011] Step 6: Divide the offspring mayflies into males and females, calculate the fitness values of the offspring mayflies, and update the individual optimum, global optimum, and relevant parameters;
[0012] Step 7: Update the dance coefficient and random flight coefficient, and update the weight coefficient;
[0013] Step 8: Determine if the maximum number of iterations has been reached. If so, output the optimal solution; otherwise, return to step 3.
[0014] In the above-described mobile robot global path planning method based on the improved mayfly algorithm, in step 1, to facilitate the establishment of the geometric model for robot path planning, the following assumptions are made:
[0015] (1) Assume that the robot moves in a two-dimensional space, that is, the height of the robot and obstacles in the environment does not need to be considered;
[0016] (2) Assume that there are no dynamic obstacles in the environment and that the mobile robot has already acquired information on all static obstacles in the environment;
[0017] (3) Assume that the mobile robot is treated as a point mass, and its size and shape do not need to be considered;
[0018] The environmental model is established directly using the Cartesian coordinate system. In the actual working environment, the shapes of obstacles are diverse. Therefore, the method of representing obstacles is simplified by using "expansion" to handle various irregularly shaped obstacles in the environment. Each shape of obstacle is represented by the smallest circle that can contain it, and the size of the obstacle is represented by the area of the circle. This method is called "expansion". Using this method to handle obstacles makes it easier to establish the geometric model.
[0019] In actual path planning tasks, in order to prevent the robot from getting too close to the obstacle and thus threatening the robot's safety, the obstacle needs to be "expanded" in a larger area when modeling it. The radius of the expansion is R, and R is the safe distance for the robot to approach the obstacle.
[0020] The requirement for robot path planning is: in an environment with known obstacles, starting from the starting point... S To the target point GTo find the optimal path that avoids obstacles, factors such as path length, safety, and smoothness must be considered. A two-dimensional coordinate system must be established. x - o - y Obstacles are represented by solid black objects, and the starting point for robot path planning is represented by a solid small dot in the lower left corner of the two-dimensional coordinate system. S The coordinates are represented as The target point for robot path planning is represented by a solid small circle in the upper right corner of the two-dimensional coordinate system. G The coordinates are represented as The task of robot path planning is to find a path from the starting point. S To the target point G The collision-free path, which is represented by a set. , This means that the first m Each node is represented using Cartesian coordinates. This ensures that the lines connecting adjacent points do not pass through obstacles in the environment, and the connection of each line segment is the optimized path.
[0021] The above-described mobile robot global path planning method based on the improved mayfly algorithm, in step 2, uses the fitness function value as the path length. During the optimization process, the mayfly continuously changes its position, and some paths may cross obstacles, becoming illegal paths. To maintain path diversity and avoid eliminating illegal paths, a fitness function with a penalty function is used. By adding a penalty value, illegal paths are automatically eliminated during the optimization process. Suppose a path has... m There are nodes, and the coordinates of each node are... The coordinates of the starting and ending points of the path are respectively and The fitness function is set as follows:
[0022]
[0023] In the above formula, μ The penalty value. L The length of the robot's motion path, which is the sum of the distances between each node from the starting point to the target point, is calculated as follows:
[0024]
[0025] V The illegality degree of the path is used to determine whether a path node is located in an obstacle region, i.e., whether the path passes through an obstacle. V The initial value is 0, calculate V The value is expressed in the following ways:
[0026]
[0027]
[0028]
[0029] in, Indicates the first path i The coordinates of each node, Indicates the first k The coordinates of the center of each circular obstacle. Indicates the first k The first obstacle on the path i The distance value between each node. Indicates the first k The distance values from each obstacle to a node on the path; For the first k The radius of the circular obstacle NUM This represents the number of obstacles; `ave()` indicates taking the average value. Used to determine whether a path passes through an obstacle; if so, the point falling within the obstacle area corresponds to... The element value in the array is greater than 0. V >0, otherwise array All elements in the array are 0, that is V =0, at which point the fitness value is equal to the path length.
[0030] In the above-described global path planning method for mobile robots based on the improved mayfly algorithm, the velocity update formula for the male mayfly in step 3 is as follows:
[0031]
[0032] in, Indicates the first i Only male mayflies exist in this dimension. j Upper t The speed of +1 iteration, This indicates that the i-th male mayfly is in dimension [i]. j superior t The position of the next iteration. f ( x ) is the objective function. and Indicates the positive attraction coefficient. β Visibility coefficient, For dance coefficients, r It is a random number in the range [-1, 1]. For the first i The mayfly in the first j The best position Wei ever reached. gbestThe globally optimal position. and These represent the positions of the i-th male mayfly. and Between and and gbest The Euclidean distance between them; g Inertial weight;
[0033]
[0034] in, and These are the minimum and maximum weight coefficients, respectively. t This represents the current iteration number. T This represents the maximum number of iterations.
[0035] The speed update formula for female mayflies is:
[0036]
[0037] in, and They represent t After the next iteration, the i-th female mayfly is... j Dimensional position and velocity, This represents the distance between male and female mayflies. This represents the random flight coefficient.
[0038] In the above-described global path planning method for mobile robots based on the improved mayfly algorithm, step 3 introduces an adaptive inertia weight coefficient into the search equation of the mayfly algorithm. The position update expressions for male and female mayflies are as follows:
[0039]
[0040]
[0041] in, Indicates the first i Only male mayflies in the first t The position at +1 iteration, Then it means the first i Only male mayflies in the first t Speed at +1 iteration Indicates the first i Only female mayflies in the 1st t The position at +1 iteration, ω These are the weighting coefficients.
[0042] In the aforementioned global path planning method for mobile robots based on the improved mayfly algorithm, step 5 introduces an ion motion cross-search equation and a gravity factor during the mating phase of the mayfly algorithm. AF , BF The search step size is increased adaptively; assuming male mayflies are cations and female mayflies are anions, male and female mayflies are attracted to each other by attraction, and the two offspring produced after the female mayfly approaches and mates are... and The expression is:
[0043]
[0044]
[0045]
[0046] in, male and female They represent the father and mother parents, respectively. This represents the optimal male mayfly. This represents the optimal female mayfly. , .
[0047] In the aforementioned mobile robot global path planning method based on the improved mayfly algorithm, step 5 introduces an F-distribution random mutation strategy, randomly selecting a group of offspring mayflies for mutation operation:
[0048]
[0049] in, F(3,4) indicates the position of the offspring mayfly after mutation, and F(3,4) indicates that it follows an F distribution with (3,4) degrees of freedom.
[0050] In the mobile robot global path planning method based on the improved mayfly algorithm described above, in step 7, the dance coefficient and random flight coefficient also decrease with the number of iterations, as shown in the following formula:
[0051]
[0052]
[0053] in, , They are respectively t The dance coefficient and random flight coefficient at any moment, , These are the initial dance coefficient and random flight coefficient, respectively. , These are the decay parameters of the dance coefficient and the random flight coefficient at time t, respectively.
[0054] The formula for updating the weight coefficients is:
[0055]
[0056] in, and These are the minimum and maximum weight coefficients, respectively. T This represents the maximum number of iterations.
[0057] The beneficial effects of this invention are as follows: This invention improves the mayfly algorithm by introducing ion motion cross-search rules and adaptive inertia weights to improve the algorithm's convergence efficiency and global search capability. At the same time, it introduces F-distribution random mutation to increase the diversity of the algorithm's search results. The improved mayfly algorithm is applied to the path planning problem of mobile robots and experimental verification is carried out. The results show that the improved mayfly optimization algorithm has better search capability, obtains a better path than the original algorithm, and has a faster and more stable convergence process. Attached Figure Description
[0058] Figure 1 This is a flowchart of the present invention.
[0059] Figure 2 This is a schematic diagram of a raster-based environment map.
[0060] Figure 3 A schematic diagram of the expansion process for irregular obstacles.
[0061] Figure 4 This is a schematic diagram representing an obstacle in a practical application.
[0062] Figure 5 This is a schematic diagram of path planning for a mobile robot.
[0063] Figure 6 The optimization results for the test functions are shown in the graphs, where (a)-(e) are the optimization results for the test functions Sphere, Rastrigin, Griewank, Rosenbrock, and Quadric, respectively.
[0064] Figure 7 The graph shows the shortest path curves planned by the four algorithms in Environment 1.
[0065] Figure 8 The following are the convergence curves of four algorithms in the given environment.
[0066] Figure 9 The graph shows the shortest path curves planned by the four algorithms in Environment 2.
[0067] Figure 10The graph shows the convergence curves of the four algorithms in Environment 2. Detailed Implementation
[0068] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0069] like Figure 1 As shown, a global path planning method for mobile robots based on an improved mayfly algorithm includes the following steps:
[0070] Step 1: Obtain map information and model the map environment.
[0071] In optimizing robot paths using the mayfly algorithm, the first step is to model the environment map. To facilitate the establishment of a geometric model for robot path planning, the following assumptions are made:
[0072] (1) Assume that the robot moves in a two-dimensional space, that is, the height of the robot and obstacles in the environment does not need to be considered;
[0073] (2) Assume that there are no dynamic obstacles in the environment and that the mobile robot has already acquired information on all static obstacles in the environment;
[0074] (3) Assume that the mobile robot is treated as a point mass, and its size and shape do not need to be considered.
[0075] Environmental modeling is a crucial step in mobile robot path planning, directly impacting the efficiency of the path planning algorithm and the quality of the path. A good environmental modeling method can simplify the problem description and ignore factors in the actual environment that have a minor impact on the robot's movement.
[0076] There are many modeling methods for mobile robot path planning, among which the grid method is a commonly used one. The grid method first divides the environment space into a grid, which is divided into obstacle grids and free grids. Obstacle grids contain obstacles that the robot's planned path should avoid; free grids do not contain obstacles, and the robot can move freely on them. The grid composed of free grids and obstacle grids constitutes the robot's working environment, such as... Figure 2 As shown in the diagram, blank grids represent free grids, and gray grids represent obstacles. In the robot's working environment, many obstacles are not regularly shaped. Therefore, for irregular obstacles, if a part of the obstacle covers a grid, even if it does not completely cover the entire grid, this grid is defined as an obstacle grid. This ensures that the robot can safely avoid obstacles and reach the target point. Figure 2The black grid cells within the gray area represent obstacle grids. Generally, in the mathematical model of a grid, obstacle grids are represented by 1, and free grids by 0. The robot's task is to perform path planning and optimize the best path within this grid composed of 0s and 1s.
[0077] Grid-based modeling is relatively simple and easy to implement, but it has certain drawbacks. For example, if the size of a single grid cell is too large, the smoothness of the robot's path will be poor, and the planned path may not even be suitable for the robot to walk on. If the size of a single grid cell is too small, the smoothness of the planned path is guaranteed, but it will increase the computational difficulty of the algorithm and increase the workload.
[0078] To avoid the problems arising from this, this invention directly uses a Cartesian coordinate system to establish the environmental model. In actual working environments, obstacles have diverse shapes. Therefore, the method of representing obstacles is simplified by using an "expansion" approach to handle various irregularly shaped obstacles in the environment. Each shape of obstacle is represented by the smallest circle that can contain it, and the size of the obstacle is represented by the area of that circle. Figure 3 As shown, this processing method is called "expansion" processing, and using this method to handle obstacles makes it easier to build geometric models.
[0079] In practical path planning tasks, to prevent the robot from getting too close to obstacles and jeopardizing its safety, the obstacle model needs to be "expanded" to a larger extent, such as... Figure 4 As shown, the expanded radius is R, where R is the safe distance for the robot to approach the obstacle.
[0080] The requirement for robot path planning is: in an environment with known obstacles, starting from the starting point... S To the target point G Finding the optimal path that avoids obstacles involves considering factors such as path length, safety, and smoothness. Path planning includes... Figure 5 As shown. In Figure 5 In the middle, establish a two-dimensional coordinate system x - o - y Obstacles are represented by solid black objects, and the starting point for robot path planning is represented by a solid small dot in the lower left corner of the two-dimensional coordinate system. S The coordinates are represented as The target point for robot path planning is represented by a solid small circle in the upper right corner of the two-dimensional coordinate system. G The coordinates are represented as The task of robot path planning is to find a path from the starting point. S To the target point GThe collision-free path, which is represented by a set. Represented using rectangular coordinates as This ensures that the lines connecting adjacent points do not pass through obstacles in the environment, and the connection of each line segment is the optimized path.
[0081] Step 2: Initialize mayfly population parameters and randomly generate mayfly population locations. x Set initial speed v If the initial value is zero, generate an initial path and calculate the fitness value.
[0082] In step 2, the fitness function value can be viewed as the path length. As the mayfly continuously changes its position during the optimization process, some paths will cross obstacles and become illegal paths. To maintain path diversity and avoid eliminating illegal paths, a fitness function with a penalty function is used. By attaching a large penalty value, illegal paths are automatically eliminated during the optimization process. Suppose a path has... m There are nodes, and the coordinates of each node are... , ,⋯, The coordinates of the starting and ending points of the path are respectively and The fitness function is set as follows:
[0083]
[0084] In the above formula, μ To impose a penalty value that is sufficiently large, this invention will μ Set to 100; L The length of the robot's motion path, which is the sum of the distances between each node from the starting point to the target point, is calculated as follows:
[0085]
[0086] V The illegality degree of the path is used to determine whether a path node is located in an obstacle region, i.e., whether the path passes through an obstacle. V The initial value is 0, calculate V The value is expressed in the following ways:
[0087]
[0088]
[0089]
[0090] in, Indicates the first path i The coordinates of each node, Indicates the firstk The coordinates of the center of each circular obstacle. Indicates the first k The first obstacle on the path i The distance value between each node. Indicates the first k The distance values from each obstacle to a node on the path. For the first k The radius of the circular obstacle NUM This represents the number of obstacles; `ave()` indicates taking the average value. Used to determine whether a path passes through an obstacle; if so, the point falling within the obstacle area corresponds to... The element value in the array is greater than 0. V >0, otherwise array All elements in the array are 0, that is V =0, at which point the fitness value is equal to the path length.
[0091] Step 3: Update the speed and position of the male and female mayflies.
[0092] Male mayflies are social creatures, and each male mayfly adjusts its position based on its own situation and the behavior of nearby individuals. The speed update formula for male mayflies is:
[0093]
[0094] in, Indicates the first i Only male mayflies exist in this dimension. j Upper t The speed of +1 iteration, This indicates that the i-th male mayfly is in dimension [i]. j superior t The position of the next iteration. f ( x ) is the objective function. and Indicates the positive attraction coefficient. β Visibility coefficient, For dance coefficients, r It is a random number in the range [-1, 1]. For the first i The mayfly in the first j The best position Wei ever reached. gbest The globally optimal position. and They represent the first i Location of only male mayflies and Between and and gbest The Euclidean distance between them;g Inertial weight;
[0095]
[0096] in, and These are the minimum and maximum weight coefficients, respectively. t This represents the current iteration number. T This represents the maximum number of iterations.
[0097] The difference between female and male mayflies is that female mayflies do not gather in groups, but instead move towards the location of male mayflies to mate. The speed update formula for female mayflies is:
[0098]
[0099] in, and They represent t After the nth iteration i The position and velocity of the female mayfly in dimension j. This represents the distance between male and female mayflies. This represents the random flight coefficient.
[0100] Weight coefficients are a crucial factor influencing an algorithm's search capability, directly impacting both its global and local search abilities. In the Ephemeral algorithm, the goal is to enhance both the early-stage global search capability (finding optimal positions within the search space) and the later-stage local search capability (improving convergence accuracy).
[0101] During the algorithm iteration process, it is necessary to set appropriate weight coefficients. ω To balance the global and local search capabilities of the algorithm while ensuring both optimization speed and accuracy, an adaptive inertia weight coefficient is introduced into the mayfly algorithm's search equation to maintain search diversity in the early stages, improve early global search capabilities, and enable rapid convergence in later stages. The position update expressions for male and female mayflies are as follows:
[0102]
[0103]
[0104] in, Indicates the first i Only male mayflies in the first t The position at +1 iteration, Then it means the first i Only male mayflies in the first t Speed at +1 iteration Indicates the first i Only female mayflies in the 1st t The position at +1 iteration, ω is the weighting coefficient. In the formula... The weight coefficient decreases continuously during the iterative convergence process. ω The deceleration rate is relatively gradual in both the early and later stages, which is beneficial for the algorithm to perform global and local searches smoothly; weight coefficients ω The relatively fast deceleration rate in the mid-term is beneficial for improving the convergence speed of the algorithm.
[0105] Step 4: Calculate the updated fitness value of the mayflies, and then sort the mayflies by position from smallest to largest according to their fitness values.
[0106] Step 5: Generate mayfly offspring and perform mutation operations on the offspring mayflies.
[0107] In nature, anions and cations attract each other, while like ions repel each other. Anions move towards the most desirable cations under the influence of attraction, while cations move towards the most desirable anions.
[0108] To improve the evolutionary speed of mayflies and promote rapid population convergence, an ion motion cross-search equation is introduced into the mating phase of the mayfly algorithm, along with a gravity factor. AF , BF The search step size is increased adaptively; assuming male mayflies are cations and female mayflies are anions, male and female mayflies are attracted to each other by attraction, and the two offspring produced after the female mayfly approaches and mates are... and The expression is:
[0109]
[0110]
[0111]
[0112] in, male and female They represent the father and mother parents, respectively. This represents the optimal male mayfly. This represents the optimal female mayfly. , .
[0113] The mayfly algorithm updates the flight state of mayflies by having male mayflies and their offspring follow the individual optimal and the global optimal. In the early stages of iteration, the mayfly algorithm exhibits high flight speed and converges quickly. However, as the algorithm iterates, most mayflies concentrate in the vicinity of the global optimum or their historical best, reducing their activity and shrinking their activity space. This decreases their search ability and makes them prone to getting trapped in local optima.
[0114] To mitigate the decline in mayfly population diversity during iteration, an F-distribution random mutation strategy is introduced, randomly selecting a group of offspring mayflies for mutation:
[0115]
[0116] in, F(3,4) indicates the position of the offspring mayfly after mutation, and F(3,4) indicates that it follows an F distribution with (3,4) degrees of freedom.
[0117] Step 6: Divide the offspring mayflies into males and females, calculate the fitness values of the offspring mayflies, and update the individual optimum, global optimum, and related parameters.
[0118] Step 7: Update the dance coefficient and random flight coefficient, and update the weight coefficient.
[0119] In step 7, the dance coefficient and the random flight coefficient also decrease with the number of iterations, as shown in the following formula:
[0120]
[0121]
[0122] in, , They are respectively t The dance coefficient and random flight coefficient at any moment, , These are the initial dance coefficient and random flight coefficient, respectively. , They are respectively t The decay parameters of the moment-of-flight coefficient and the decay parameters of the random flight coefficient;
[0123] The formula for updating the weight coefficients is:
[0124]
[0125] in, and These are the minimum and maximum weight coefficients, respectively. T This represents the maximum number of iterations.
[0126] Step 8: Determine if the maximum number of iterations has been reached. If so, output the optimal solution; otherwise, return to step 3.
[0127] Algorithm performance simulation experiment
[0128] (1) Test function
[0129] The algorithm of this invention is denoted as the IMA algorithm. To verify the optimization performance of the IMA algorithm, five standard test functions were selected and optimized using the IMA algorithm. The specific information of the five test functions is shown in Table 1. The optimal value of all five test functions is 0, and the dimension is 30. At the same time, the original Mayfly Algorithm (MA), Artificial Bee Colony Algorithm (ABC), and Particle Swarm Optimization (PSO) algorithms were tested and compared.
[0130] Table 1 Standard Test Functions
[0131]
[0132] (2) Simulation Experiment Results and Analysis
[0133] In the simulation experiments, to increase the comparability of the algorithm results, the parameters of the four algorithms were standardized. The total population of the MA and IMA algorithms was 100, with 50 male and 50 female mayflies. The population of the ABC and PSO algorithms was 100, and the maximum number of iterations was 1000. To avoid random factors affecting the optimization results during the algorithm iteration process, the four algorithms were run independently 50 times on each test function. Finally, the average and standard deviation of the results obtained from each test function were taken as the final simulation results, as shown in Table 2.
[0134] Table 2 Simulation Experiment Results
[0135]
[0136] As shown in Table 2, the simulation results demonstrate that the IMA algorithm significantly improves upon the other three algorithms in both stability and convergence accuracy. For the five standard test functions, the IMA algorithm exhibits better optimization performance compared to the MA, ABC, and PSO algorithms. Among these five test functions, the IMA algorithm's results for Sphere, Rastrigin, Griewank, and Quadric functions are significantly better than the other three algorithms, and all are close to the theoretical optimum, meeting the expected requirements. For the Rosenbrock function, the optimal and average values of the IMA algorithm and the ABC algorithm are close, but both are superior to the MA and PSO algorithms. Furthermore, the IMA algorithm's optimization results for Rastrigin and Griewank both reach the theoretical optimum of 0, with a standard deviation of 0, indicating good stability.
[0137] To facilitate comparison of the optimization effects and convergence performance of the four algorithms, the iterative convergence curves of the four algorithms during testing are given below for five test functions, as follows: Figure 6 As shown.
[0138] Depend on Figure 6 (a) shows that for the Sphere function, the convergence of the ABC algorithm in the early stages is similar to that of the IMA algorithm, but in the middle and later stages, the convergence of the IMA algorithm is significantly better than that of the ABC algorithm, and the optimization results of the IMA algorithm are significantly better than those of the MA, ABC, and PSO algorithms. Figure 6 As shown in (b) and 6(c), for the Rastrigin and Griewank functions, the IMA algorithm reaches its theoretical optimum when the number of iterations approaches 200, clearly demonstrating that the IMA algorithm outperforms the other three algorithms. Figure 6 (d) shows that for the Rosenbrock function, the convergence performance of the IMA algorithm is close to that of the ABC algorithm, but better than the MA and PSO algorithms. Figure 6 (e) shows that for the Quadric function, the IMA algorithm significantly outperforms the other three algorithms in optimization. Path planning simulation
[0139] To verify the performance of the IMA algorithm, this invention used MATLAB 2016a software to complete related simulation experiments. Two different environments with obstacles were set up, the robot's path was planned, and simulation experiments were conducted. Simultaneously, comparative experiments were performed with the MA algorithm, ABC algorithm, and PSO algorithm under the same environment. Each algorithm was run independently 50 times, and the data was recorded. The population size for the artificial bee colony algorithm and the particle swarm algorithm was set to 100, while the number of male and female mayflies for the MA algorithm and the IMA algorithm was set to 50 each, with 200 iterations.
[0140] like Figure 7 The diagram shows the shortest paths planned for the robot by four algorithms in the first environment. The black area represents obstacles, and the red area represents the threat zone when the robot approaches the obstacles. To avoid the robot getting too close to the obstacles and thus threatening its safety, the robot should plan its route outside the red area.
[0141] like Figure 8 The diagram shows the convergence curves of four algorithms. Figure 8 The convergence curves show that the MA algorithm stops optimizing the path after 9 iterations. The MA algorithm's rapid convergence prevents it from searching for more paths, resulting in premature convergence and preventing it from achieving the desired optimization effect. The IMA algorithm, while ensuring optimization performance, also boasts a fast convergence speed; the planned path reaches its optimal effect after approximately 20 iterations. Furthermore, it is evident that the IMA algorithm significantly outperforms the ABC and PSO algorithms.
[0142] Table 3 lists the path lengths obtained from simulation experiments of the four algorithms under the first simulation environment. The results show that the shortest path length solved by the MA algorithm is 48.21m, while the shortest path length solved by the IMA algorithm proposed in this invention is 46.43m, which is 3.7% shorter than the shortest path length solved by the original algorithms. In 50 experiments, the average path length obtained by the IMA algorithm is 46.71m, which is 7.7% shorter than the MA algorithm, and 12.3% and 8.1% shorter than the ABC algorithm and PSO algorithm, respectively. Obviously, the optimization results of the IMA algorithm are significantly better than those of the MA, ABC, and PSO algorithms.
[0143] Table 3 shows the path lengths planned by the four algorithms in Environment 1.
[0144]
[0145] Figure 9 To find the shortest path for the robot using the four algorithms in the second environment, Figure 10 These are the convergence curves for the four algorithms. Figure 3 As shown in the convergence curve .10, the MA algorithm's excessively fast convergence speed leads to premature convergence, decreased diversity in the mayfly population, and an inability to search for better paths. The IMA algorithm, while maintaining optimization performance, also boasts a fast convergence speed; the planned path reaches its optimal effect after approximately 25 iterations. Furthermore, it is evident that the IMA algorithm significantly outperforms the ABC and PSO algorithms.
[0146] Table 4 lists the path lengths obtained from simulation experiments of the four algorithms under the second simulation environment. The results show that the shortest path length solved by the MA algorithm is 56.96m, while the shortest path length solved by the IMA algorithm proposed in this invention is 54.22m, which is 4.8% shorter than the shortest path length solved by the original algorithms. In 50 experiments, the average path length obtained by the IMA algorithm is 54.46m, which is 9.7% shorter than the MA algorithm, and 15.4% and 8.5% shorter than the ABC and PSO algorithms, respectively. Clearly, the optimization results of the IMA algorithm are significantly better than those of the MA, ABC, and PSO algorithms.
[0147] Table 4. Path lengths planned by the four algorithms in Environment 2
[0148]
[0149] This invention improves the mayfly algorithm by introducing ion motion cross-search rules and adaptive inertia weights to enhance the algorithm's convergence efficiency and global search capability. It also introduces F-distribution random mutation to increase the diversity of search results. The improved mayfly algorithm is applied to the path planning problem of mobile robots and experimentally verified. The results show that the improved mayfly optimization algorithm has better search capability, obtains better paths than the original algorithm, and has a faster and more stable convergence process.
Claims
1. A global path planning method for mobile robots based on an improved mayfly algorithm, characterized in that, Includes the following steps: Step 1: Obtain map information and model the map environment; Step 2: Initialize the mayfly population parameters, randomly generate the position x of the mayfly population, set the initial velocity v to zero, generate the initial path, and calculate the fitness value; Step 3: Update the speed and position of the male and female mayflies; Step 4: Calculate the updated fitness value of the mayflies, and then sort the mayflies by position from smallest to largest according to their fitness value; Step 5: Generate mayfly offspring and perform mutation operations on the offspring mayflies; In the mating phase of the mayfly algorithm, an ion movement cross-search equation is introduced, and gravity factors AF and BF are adaptively adjusted to increase the search step size. Assuming male mayflies are cations and female mayflies are anions, male and female mayflies approach each other through attraction. After a female mayfly approaches and mates, the two offspring produced are... and The expression is: ; ; ; Where male and female represent the father and mother, respectively. This represents the optimal male mayfly. This represents the optimal female mayfly. , ; Step 6: Divide the offspring mayflies into males and females, calculate the fitness values of the offspring mayflies, and update the individual optimum, global optimum, and relevant parameters; Step 7: Update the dance coefficient and random flight coefficient, and update the weight coefficient; Step 8: Determine if the maximum number of iterations has been reached. If so, output the optimal solution; otherwise, return to step 3.
2. The global path planning method for mobile robots based on the improved mayfly algorithm according to claim 1, characterized in that, In step 1, to facilitate the establishment of the geometric model for robot path planning, the following assumptions are made: (1) Assume that the robot moves in a two-dimensional space, that is, the height of the robot and obstacles in the environment does not need to be considered; (2) Assume that there are no dynamic obstacles in the environment and that the mobile robot has already acquired information on all static obstacles in the environment; (3) Assume that the mobile robot is treated as a point mass, and its size and shape do not need to be considered; The environmental model is established directly using the Cartesian coordinate system. In actual working environments, obstacles have diverse shapes. Therefore, the method of representing obstacles is simplified by using "expansion" to handle various irregularly shaped obstacles in the environment. Obstacles of various shapes are represented by the smallest circle that can contain the obstacle, and the size of the obstacle is represented by the area of the circle. This method is called "expansion". Using this method to handle obstacles makes it easier to establish the geometric model. In actual path planning tasks, in order to prevent the robot from getting too close to the obstacle and thus threatening the robot's safety, the obstacle needs to be "expanded" in its range when modeling it. The radius of the expansion is R, and R is the safe distance for the robot to approach the obstacle. The requirement for robot path planning is: in an environment with known obstacles, starting from the starting point... S To the target point G To find the optimal path that avoids obstacles, factors such as path length, safety, and smoothness must be considered. A two-dimensional coordinate system must be established. x - o - y Obstacles are represented by solid black objects, and the starting point for robot path planning is represented by a solid small dot in the lower left corner of the two-dimensional coordinate system. S The coordinates are represented as The target point for robot path planning is represented by a solid small circle in the upper right corner of the two-dimensional coordinate system. G The coordinates are represented as The task of robot path planning is to find a path from the starting point. S To the target point G The collision-free path, which is represented by a set. , This means that the first m Each node is represented using Cartesian coordinates. This ensures that the lines connecting adjacent points do not pass through obstacles in the environment, and the connection of each line segment is the optimized path.
3. The global path planning method for mobile robots based on the improved mayfly algorithm according to claim 1, characterized in that, In step 2, the fitness function value is considered as the path length. During the optimization process, the mayfly continuously changes its position, and some paths will cross obstacles and become illegal paths. To maintain path diversity and avoid eliminating illegal paths, a fitness function with a penalty function is used. By adding a penalty value, illegal paths are automatically eliminated during the optimization process. Suppose a path has... m There are nodes, and the coordinates of each node are... The coordinates of the starting and ending points of the path are respectively and The fitness function is set as follows: ; In the above formula, μ The penalty value. L The length of the robot's motion path, which is the sum of the distances between each node from the starting point to the target point, is calculated as follows: ; V The illegality degree of the path is used to determine whether a path node is located in an obstacle region, i.e., whether the path passes through an obstacle. V The initial value is 0, calculate V The value is expressed in the following ways: ; ; ; in, This represents the coordinates of the i-th node on the path. This represents the coordinates of the center of the k-th circular obstacle. Indicates the first k The distance from each obstacle to the i-th node on the path. Indicates the first k The distance values from each obstacle to a node on the path; For the first k The radius of each circular obstacle, NUM, is the number of obstacles, and ave() represents the average value. Used to determine whether a path passes through an obstacle; if so, the point falling within the obstacle area corresponds to... The element value in the array is greater than 0. V >0, otherwise array All elements in the array are 0, that is V =0, at which point the fitness value is equal to the path length.
4. The global path planning method for mobile robots based on the improved mayfly algorithm according to claim 1, characterized in that, In step 3, the speed update formula for male mayflies is: ; in, Indicates the first i Only male mayflies exist in this dimension. j Upper t The speed of +1 iteration, This indicates that the i-th male mayfly is in dimension [i]. j superior t The position of the next iteration. f ( x ) is the objective function. and Indicates the positive attraction coefficient. β Visibility coefficient, For dance coefficients, r It is a random number in the range [-1, 1]. For the i-th mayfly in the th... j The best position that Dimension has ever reached is gbest, which is the globally optimal position. and They represent the first i Location of only male mayflies and Between and The Euclidean distance between and gbest; g Inertial weight; ; in, and These are the minimum and maximum weight coefficients, respectively. t This represents the current iteration number. T This represents the maximum number of iterations. The speed update formula for female mayflies is: ; in, and They represent t The position and velocity of the i-th female mayfly in dimension j after the iteration. This represents the distance between male and female mayflies. This represents the random flight coefficient.
5. The global path planning method for mobile robots based on the improved mayfly algorithm according to claim 1, characterized in that, In step 3, an adaptive inertia weight coefficient is introduced into the search equation of the mayfly algorithm, and the position update expressions for male and female mayflies are as follows: ; ; in, Indicates the first i Only male mayflies in the first t The position at +1 iteration, Then it means the first i Only male mayflies in the first t Speed at +1 iteration Indicates the first i Only female mayflies in the 1st t The position at +1 iteration, ω These are the weighting coefficients.
6. The global path planning method for mobile robots based on the improved mayfly algorithm according to claim 4, characterized in that, In step 5, an F-distribution random mutation strategy is introduced to randomly select a group of offspring mayflies for mutation: ; in, F(3,4) indicates the position of the offspring mayfly after mutation, and F(3,4) indicates that it follows an F distribution with (3,4) degrees of freedom.
7. The global path planning method for mobile robots based on the improved mayfly algorithm according to claim 4, characterized in that, In step 7, the dance coefficient and the random flight coefficient also decrease with the number of iterations, as shown in the following formula: ; ; in, , They are respectively t The dance coefficient and random flight coefficient at any moment, , These are the initial dance coefficient and random flight coefficient, respectively. , These are the decay parameters of the dance coefficient and the random flight coefficient at time t, respectively. The formula for updating the weight coefficients is: ; in, and These are the minimum and maximum weight coefficients, respectively. T This represents the maximum number of iterations.
Citation Information
Patent Citations
Robot multi-target path planning based on improved mayfly naiad optimization algorithm
CN113485451A
Mobile robot path planning method based on dynamic adaptive parameter adjustment mayfly naiad algorithm
CN114995390A