Abstract
Optimization problems in the field of industrial engineering usually involve massive amounts of information and complex scheduling process with the characteristics of high-dimension and non-convexity, which bring many challenges to finding an optimal solution. We proposed an improved beetle swarm optimization (IBSO) algorithm demonstrating the potential to solve different problems of path planning in static environment with good performance. Firstly, the algorithm is an upgrade of the original beetle antennae search (BAS) algorithm and the search strategy is improved by replacing a single beetle by multiple beetles. Secondly, the global search ability gets enhanced, and the diversity of optimization is improved through introducing nonlinear sinusoidal disturbance with Levy flight mechanism in beetles’ position. Finally, the search performance of beetle swarm is improved by simulating the characteristics of employment bees to search for a better solution near the honey source field in the Artificial Bee Colony (ABC) algorithm. Our experiment results show that IBSO algorithm can achieve higher search efficiency and wider search ranges through well balancing the advantages of local search and fast optimization of the BAS algorithm with the global search of the improved mechanism. The IBSO algorithm has shown the potential to provide a new solution for several optimization problems in path planning in static environment.
Introduction
In recent years, unmanned aerial vehicles (UAV) and industrial mobile robots have developed rapidly, and their applications have been expanding in many scientific and technological fields, such as Disaster monitoring [1, 2], water resources inspection [3, 4], power system monitoring [5], meteorological detection [6] and etc. It can be seen that the development of related technologies for UAV and industrial robots plays an increasingly important role in these areas. How to choose the optimal running trajectory and how to avoid obstacles in time for these intelligent technologies such as UAV and industrial mobile robots during the execution of tasks has attracted the attention of many researchers. Determining a reasonable path planning plan scheme is the primary focus of the researchers’ attention. The path planning problem can be solved by searching for the optimal solution of the optimization problem through the optimization algorithms.
Path planning is a branch of research on motion planning where the sequence point set or curve connecting the source and destination is called the path, and the sequence arrangement strategy of the sequence point set is called path planning. A reasonable planning strategy can save a lot of cost. Path planning includes several types of optimization problems. Based on the characteristics of the data used, path planning can be divided into discrete domain and continuous domain. One of the most classical optimization problems in path planning is the traveling salesman problem that falls into the category of the ergodic optimal path problem in the discrete domain. It is also a type of one-dimensional static optimization problem, equivalent to the route optimization problem after the environmental information is simplified, widely used in printed-circuit board hole turning [7], logistics problems [8] and various vehicle problems [9]. The common methods to solve such path problems are exact algorithms, including Dynamic Programming (DP) method [10] and Branch and Bound method [11]. However, as the scale of the problem increases, the exact algorithm will become powerless.
The goal of the global path planning in a continuous domain is to avoid obstacles and find the shortest path to the destination in the safe range when the environmental information is known and static. It is an optimization in the continuous multidimensional static environment. This type of path planning is mainly applied to the path planning for unmanned aerial vehicle [12], Cruise missile trajectory planning [13] and robot manipulator autonomous movement path planning [14]. The traditional algorithms for solving this kind of path planning problems mainly include Artificial Potential Field (APF) [15], A* algorithm [16], etc. The traditional APF algorithm is a virtual force method. It imitates the movement of objects under gravitational and repulsive forces. The path is optimized by establishing the gravitational and repulsive field function. In the process of path planning, it is easy to fall into a certain local area and cannot reach the destination. The A* algorithm is a direct search method for solving the shortest path in a static road network. The closer the distance estimation value in the algorithm is to the actual value, the faster the final search speed, but the effectiveness of A* algorithm is not ideal and there exist a large number of turns in the path. The Rapidly-Exploring Random Tree (RRT) algorithm [17] uses collision detection on sampling points in the state space and directs the search to a blank area to find a planned path from the starting point. However, due to the limitations of the algorithm, the randomness of the next step of the search is too large, making the path unsmooth. Traditional algorithms often have difficult modeling problems when solving practical problems, while graphics methods provide a basic modeling method. The Grid method [18] is a method of map modeling, which divides the environmental space into units and represents them with squares of equal size. The selection of the grid size is an important factor affecting the performance of the planning algorithm.
The intelligent optimization algorithms are inspired by nature, and they play a very good role when dealing with path planning problems under complex and dynamic environmental information. The emergence of intelligent optimization algorithms provides a new calculation method for solving path planning problems. This type of method does not need to construct a complex mathematical model to obtain a globally feasible path planning solution. Researchers have proposed many heuristic optimization algorithms for solving path planning problems by simulating natural biological evolution or group behavior, such as Bat Algorithm (BA) [19], Firefly Algorithm (FA) [20], Particle Swarm Optimization (PSO) Algorithm [21] etc. Gemeinder. et al. proposed a mobile robot based on Genetic Algorithm (GA) [22], and introduced an active search algorithm to overcome the shortcomings of the earlier version. Wu et al. proposed a novel Beetle Antennae Algorithm with fallback mechanism [23]. If a collision occurs, it will fall back a certain distance, which results in the increase of the solving time and leads to poor optimization results after back-off. Wu et al. proposed an Agglomerative Greedy Brain Storm Optimization (AG-BSO) Algorithm [24] to solve typical cases in traveling salesman problem (TSP) and obtained better results. Zhong et al. proposed a discrete pigeon-inspired optimization algorithm with metropolis acceptance criterion [25] which performs well in TSP with a large-scale urban dimension. To sum up, the intelligent optimization algorithm can help improve the accuracy of path planning and each algorithm has its own advantages and disadvantages when solving such problems. The research on the path planning has never stopped.
The BAS algorithm is one of the intelligent optimization algorithms. The advantage of this algorithm is that only one individual beetle is used for search and optimization, which reduces the amount of computation to a certain extent. Because of its simple mechanism, the algorithm converges fast. Since BAS uses an individual beetle, it is very easy to cause the beetle to reach local extreme value in the search domain, resulting in inaccurate solution results. At the same time, in each position update of BAS algorithm, the beetle flies in a straight line along the tentacle direction, which is also one of the factors that make BAS easy to enter the local extreme value range. To solve the above problems, we proposed the IBSO algorithm that enhances the BAS algorithm and combines it with the swarm intelligence optimization algorithm. The individual beetle search and optimization is advanced to the beetle swarm for search and optimization. Combined with the idea of hiring bees to search near the nectar source neighborhood in the artificial bee colony (ABC) algorithm, it enriches the search ability of the beetle swarm to solve the global problem. Finally, the Levy flight strategy with nonlinear sinusoidal disturbance is introduced to address the shortcomings of the BAS algorithm that the beetle must fly directly when the position is updated. The beetles now can fly randomly according to the step length. Compared with the ABC and BAS algorithms, the IBSO algorithm has a powerful search range and faster search speed. The main contributions of our algorithm are listed as follows: Changing individual beetle search into beetle swarm search, and employing the ABC algorithm where bees searching in the nectar source neighborhood to enrich the search range. Introducing the Levy flight strategy with nonlinear sinusoidal disturbance, so that the beetle has the ability of random flight, so as to change the defect that the beetle flies in a straight line along with the tentacle direction during each position update. The proposed algorithm has been applied to solve several optimization problems in path planning, including the TSP and obstacle avoidance path planning problem. The simulations have shown good performance.
The rest of the paper is organized as follows. In section 2, we introduce the basic problem models of two types of path planning applications. In section 3, we introduce the design of the IBSO algorithm. In section 4, we use the benchmark function to test and verify the IBSO algorithm and show the algorithm flowchart. In section 5, we introduce the verification and application of IBSO in path planning of mobile robots in static environment, show the simulation results, and compare the performance of IBSO and counterpart algorithms in path planning. In section 6, we analyze the shortcomings of the IBSO and the focus of the next work. In section 7, we summarize the whole paper.
Problem Model
Path planning has a wide range of applications. In this paper, we mainly discuss and analyze two kinds of optimization problems: ergodic optimal path problem in a discrete domain and global path planning problem in a continuous domain.
Ergodic optimal path problem in discrete domain
The general characteristic of ergodic optimal path problem in discrete domain is that the path information is static, with the starting point as the final target node. There might be multiple sub target nodes in the middle. The motion actuator is required to start from the starting point with the shortest path, traverse all sub target nodes, and return to the starting point. This kind of problem mainly includes TSP and its extended application.
Optimization of TSP
The traveling salesman problem [26], also known as the salesman problem, is a typical NP-hard problem. Given n city coordinate locations and distances between cities, a traveling salesman starts from a point city, traverses other cities, visits each city only once and finally returns to the originating city, and ensures the shortest total path length. The mathematical model of TSP is described as follows:
Set G = (V, E) is the weighted graph, V = {v1, v2, . . . , v
n
} is the vertex set, E is the edge set, the distance between vertex i and j is d
ij
, it is known that d
ij
> 0, i, j ∈ V, and set x
ij
represents the sub-path form the i–th city to the j–th city. If x
ij
exists in the path of the travel agent, then x
ij
= 1,otherwise x
ij
= 0. Its mathematical expression is as follows:
L is the solution sequence, then the optimal representation of the traversal path of the TSP problem can be written as a linear programming form as follows:
In the Equation (3), |L| is the number of elements in the set L. The constraint condition in the Equation (3) is that each vertex has and can only be traversed once, and that Hamilton does not have any subtour. Find the one with the lowest weight among all Hamilton path satisfying the condition. After the traveling salesman walks through all the cities, set its traversal path is L = (x1, x2, . . . , x
n
, x1), that is, the order of the traveling salesman’s travel cities. The above problem is transformed into determining a traversal sequence (x1, x2, . . . , x
n
, x1) and finding its minimum value.
The optimal path conversion mechanism of the single TSP is shown in Fig. 1:

Single traveling salesman path conversion.
The Multiple Traveling Salesman Problem (MTSP) is a generalization of the classic traveling salesman problem, which is to transform a single traveling salesman into multiple traveling salesman, and add some additional conditions to make it more in line with the problems of vehicle path planning [27], emergency material distribution [28], UAV coverage search [29], and off-grade product control [30] in real life, that is, given cities, traveling salesmen from the same (or different) cities and take a travel route respectively, so that each city has one and only one traveling salesman (except the departure city), and at the same time, the total distance traveled by all traveling salesmen is required to be as small as possible and the length of the longest loop is as small as possible. Compared to TSP, MTSP has a broader engineering background. Therefore, how to solve MTSP quickly and effectively has high practical application value. The mathematical model of MTSP is as follows:
Point a0 is used to represent the departure city of the traveling salesman, also known as the source point, A = {a1, a2, . . . , an-1, a
n
} indicates that the cities that m traveling salesman b1, b2, . . . , b
m
need to visit. Define variables:
Modelling the multiple traveling salesman problem:
In Equation (5), fitness is the objective function formula, expressed as the minimum total distance of mtraveling salesman, where:
Equation (6) represents the respective distances of the traveling salesman, where c
ij
represents the distance it takes for the traveling salesman to pass through the corresponding arc segment (i, j). The qualifications are:
Equation (7) indicates that starting from the designated city a0, all cities have one and only one traveling salesman to make a visit.
Equation (8) indicates that the end city of any arc has only one starting point connected to it. Equation (9) indicates that the starting city of any arc has only one ending city connected to it.
The optimal path conversion mechanism of the MTSP is shown in Fig. 2:

MTSP conversion.
The global path planning in continuous domain is focused on how to avoid obstacles and find the shortest path to the destination within the safe range when the environmental information is known and static. Solving such problems usually depends on the combination of intelligent algorithms and environment modeling.
2D obstacle avoidance path planning
With the development of new high tech, the application of robots in the field of industrial manufacturing has become more and more extensive, and the path planning of intelligently controlled mobile robots to avoid obstacles during motion has become an important research focus [31]. Traditional obstacle avoidance algorithms include artificial potential field method, A* algorithm, etc.; Intelligent optimization algorithms can also solve obstacle avoidance problems, such as chicken swarm algorithm [32], wolf swarm algorithm [33], etc. The path planning trajectory space modeling of obstacle avoidance problem is as follows:
The intelligent control robot is set to move in a 2D static space environment. In the inertial coordinate system Oxy, the starting point is S, and the target end point is E. There are many obstacles between the two points S and E, and the SE direction is the movement direction of the robot. Connect SE to divide SE into D + 1 equal parts, denoted as se i , i = (1, 2, . . . , D + 1), in each small segment, make the vertical line l i segment of se i , i = (1, 2, . . . , D + 1). Take a point on each vertical line segment l i to obtain a set of points p = {S, E1, E2, . . . , E D , E} including the starting point and the target end point, and connect these points one by one to form a path. Therefore, the obstacle avoidance problem is classified as solving the optimization coordinate problem, and the optimal path is the optimal fitness value of the optimization problem. Its model diagram is shown in Fig. 3:

Obstacle avoidance problem space model.
In order to speed up the execution of the algorithm, the line segment SE is used as the x-axis of the coordinate system to denote , and we perform the coordinate transformation on the point set [34], then take SE as the angle γ between the x-axis and the original coordinate axis, and according to the point S as the reference point rotates a clockwise γ, and then translates the origin of the coordinates to realize the coordinate transformation. Through coordinate transformation, the corresponding relationship between the original coordinate system and the local coordinate with SEas the coordinate axis is shown in Equation (10):
Where, represents the coordinates of the corresponding point after coordinate transformation, and (x
s
, y
s
) represents the coordinates of the initial point S. From the figure, the distance between two parallel lines (l
i
, li-1) is:
The movement distance of the robot affects its movement time. Through the fitness function f, the shortest value of the total path length from the starting point to the end point can be obtained. The trajectory distance of the robot movement is:
Therefore, the solution of the robot obstacle avoidance path planning problem can be transformed into the extreme value problem of the objective function. When the function Fitness reaches the minimum, the obstacle avoidance path planning problem is completed. The objective function is the fitness function:
When the robot moves into the obstacle range, it need to adjust the moving direction of the robot to avoid entering the threat area. T is the adjustment function. When a line segment on the moving path collides with the center of the obstacle and the radius of the circle, the robot’s motion trajectory is changed by multiplying the adjustment function by an adjustment factor.
In Equation (14), α
i
is the number of intersections between the i–th component path and the obstacle object. It can be obtained that the evaluation index of the obstacle avoidance problem is shown in Equation (15), which is used as a performance reference for the obstacle avoidance problem of the intelligent control robot. That is to find the shortest path of the mobile robot without touching the obstacle after entering the threat area.
To study the problem of path planning, first of all, we need to model the environment of the planning space, and set the motion area as a 3D space with a size of a * b * c m3 under the rectangular coordinate system. The fitness function is an important index to evaluate the path quality. For the 3D path planning of UAVs, the trajectory cost and the obstacle avoidance cost need to be comprehensively considered.
The trajectory cost f v is determined by the length of the path fitted by the cubic B-spline curve. Equation (16) represents all adjacent nodes (x i , y i , z i ) and (xi+1, yi+1, zi+1) in the path sum of distances.
The minimum distance between the path and the obstacle peak is dmin, which requires a safe distance d s between the path and the obstacle peak, and the obstacle cost f a is shown in Equation (17).
Combining the trajectory cost and the obstacle avoidance cost, the fitness function is obtained as shown in Equation (18). When dmin ⩾ d s , the UAV has no collision risk, and the obstacle avoidance cost can be ignored; when dmin < d s , the UAV has no collision risk. There is a risk of collision, and the fitness function fis infinite.
In this section, we presented the design of IBSO algorithm in depth, including the original BAS algorithm and the optimization strategies introduced. The selection of parameters involved in the algorithm is also described.
Beetle antennae search algorithm
The BAS algorithm [35] is a heuristic optimization algorithm proposed by Jiang and Li in 2018. The algorithm principle is: food is the target object, and the smell of food is equivalent to a function. Each point value of the function in the space is different. The two antennae of the beetle are able to collect the odor value of two nearby points. The purpose of the beetle is to search the point with the largest odor in the space. The specific orientation of the food is equivalent to the maximum point of the objective function, and the beetle moves step by step to the orientation where the food smells the most. BAS is different from other optimization algorithms in that it only depends on one individual to search, that is, one beetle, which greatly reduces the computation and shortens the computational time. Therefore, the process of beetle foraging is the optimization process of BAS algorithm. The specific steps are as follows:
1). Set the direction vector and step length of the initial position of beetle:
Whererands (•) is the random function, the Dim represents the spatial dimension. On the selection of step size factor step: the initial step of beetle could be as large as possible, which is usually set to be equivalent to the maximum length of the independent variable. In each iteration, we use Equation (20).
The decrement factor eta is between [0, 1], usually setting eta = 0.95, t is the current number of iterations and n is the total number of iterations.
2). Calculate the position of the two antennae of the beetle:
Where, x l and x r are the coordinate position of the left and right antennae of the beetle respectively. x t represents the centroid coordinate of the beetle at iteration t. The d0 represents the distance length between the two antennae. In this paper, we set the value d0 = 3 which is large enough to cover part of the search interval.
3). Calculate the objective function f (•), thef (•) represents the odor concentration values obtained by the two antennae, expressed as f (x l ) and f (x r ) respectively.
4). Update the beetle’s position: by comparing the objective values of two antennae, if f (x l ) > f (x r ), then the beetle moves to the left; on the contrary, the beetle moves to the right. In the next iteration, the position update equation of the beetle is as follows:
Where, step represents the step size factor of iteration t. In this paper, we assume that the initial step size of beetle is step = 1, and sign (•) is a symbolic function, which is used to return the positive and negative of the parameter value.
Beetle swarm
The original BAS algorithm is based on a single beetle search to find the optimal solution. It can quickly obtain approximate solutions for simple function solving problems. However, as the problem scale increases and the variable dimensions increase, the effectiveness and accuracy of the BAS algorithm gradually decreases, and the convergence effect changes. Moreover, the individual beetle search works in a single direction in each iteration, and it cannot be guarantee that the objective function value of the single beetle for each optimization is better than its previous step. To address the shortcomings of the beetle antennae algorithm, we optimize a single beetle into the beetle swarm search. The number of beetles becomes N that move in N directions to speed up the beetle swarm searching for the global optimum. It improves the possibility of the beetles to find a better position and avoid falling into the local optimum. At the same time, it can shorten the convergence and optimization time of solving the path planning problem by combining the fast convergence characteristics of the original BAS algorithm.
The beetle swarm population can be expressed as Equation (23):
Where, N is the population number of beetles, and the direction vector of beetles is expressed as follows:
Where, rands (•) is the random matrix function generated in MATLAB, and i is the i–th beetle. Transforming a single beetle into a group of beetles can increase the direction of the head of the beetles in the initial position, so as to expend the exploration range. The fitness value corresponding to the beetle swarm can be represented by the following vector:
The value of each column in F x represents the fitness value of the corresponding single beetle. By transforming a single beetle into beetle swarm search, the algorithm’s optimization ability in the search process is greatly improved with faster convergence and the search range is expanded. The algorithm can solve more fully in the search domain and increase the global search ability. In order to more vividly depict the differences between single beetle and beetle swarm in the search process, Fig. 4 shows the movement of individual beetle in search and optimization, and Fig. 5 shows the search and optimization results of the movement changes of single beetle after being converted to beetle swarm.

Single beetle movement.

Beetle swarm movement.
According to Equation (21) and (22), when a beetle updates its position, it flies in the direction of the well- adapted tentacle in a straight line along with the current step size. Based on this principle, the beetle is very easy to fall into the local extreme value region, resulting in inaccurate results. What’s more, the beetle does not have the ability to jump out of the local extreme value. Therefore, in this paper, we introduced the Levy flight strategy with nonlinear sinusoidal disturbance to simulate the motion behavior of the position update of the beetle swarm. We employ its random walk characteristics to solve the problem of being difficult to change the direction of motion in the search process.
Levy flight strategy is a random walk model that conforms to the Levy distribution [36]. Many insects and birds in nature conform to the Levy distribution model. Most of its trajectory movement shows small step, and occasionally a larger step. Levy flight formula is as follows:
Where, L (β) is the step length of the Levy distribution with the parameter β in the random direction. In this paper, μ and ν all obey the normal distribution, μ ∼ N (0, σ2), ν ∼ N (0, 1), Γ represents the gamma function, 1 < β < 3. in this paper, we let β = 2, the Levy flight motion simulation diagram is as follows:
It can be seen from Fig. 6 that during Levy flight, large jumps occasionally occur, and most of them are in small steps. Meanwhile, the direction of Levy flight strategy changes randomly. In the improved algorithm, Equation (11) is used to replace the position update step in the original BAS:

Levy flight motion simulation diagram.
Where, ⊗ represents the vector operation (point-to-point multiplication according to the vector method). The Levy flight strategy is introduced into the positioning of the beetle, which mimics the biological behavior of a beetle exploring the food smell and constantly flying towards the food source. It changes the behavior of a beetle flying along the antennae direction in the original BAS algorithm, which is in favor of enhancing the ability of global exploration and enabling the beetle to jump out of the search domain of the local extreme value.
Because BAS algorithm is prone to search stagnation and premature convergence, Shen et al. [37] proposed a method to change the forward direction of a beetle by the disturbance generated by rand random number to jump out of local optimization. In this paper, the random number disturbance generated by nonlinear sinusoidal disturbance is used to increase the ability to jump out of premature convergence. We add a disturbance term to Equation (22) and adjust the peak value of the function by using the number of iterations and the waveform of the sine function, so that the function has a large fluctuation in the early stage of iteration or when the fitness value is large, which helps BAS algorithm jump out of premature convergence. In the late stage of iteration or when the fitness value is small, it has a small fluctuation, which helps to optimize the feasible solution and avoid stagnation. The adjustment formula of disturbance term is shown in Equation (28):
In Equation (28), rand represents a random number that obeys Gaussian normal distribution; t is the number of iterations; ω represents the constant value of the t–thiteration. According to Equation (28), we can see that the value of ω affects the peak value of the disturbance factor. In order to explore the influence of the value of ω on the peak value of nonlinear sinusoidal disturbance, we select different values of ω for simulation. It can be concluded from Fig. 7 that the value of ω is different, and the amplitude position of the disturbance factor changes accordingly. When ω = 2, the amplitude is large and the coverage is wide, which helps the algorithm to jump out of the local optimum in the later stage; when ω = 2.5 and ω = 3, the amplitude range of the disturbance factor is not as large as when ω = 2, so we takes ω = 2.

The influence of the value of ωon disturbance.
According to the improvements discussed, the beetle for updating the position shown in Equation (29):
The ABC algorithm is a swarm intelligence algorithm [38]. The algorithm includes three roles: hire bee, follow bee, and scout bee. In the stage of hire bees and follow bees, they search for nectar sources near their domains, calculate fitness values, and judge the fitness function values of the new and old nectar sources to make a choice:
Where, f new is the formula for bees to search for new nectar sources nearby, fi,D corresponds to the i–th nectar source in D dimension, rand takes a random number in (0, 1), fitness is the fitness function, value i is the objective function of the optimization problem to be sought.
Combining with the characteristics of hire bees and follow bees searching near the field, after each location update of beetle, let it choose a new location near the neighborhood to replace the current location, judge the fitness of the location, and decide whether to stay or discard. Then, continue to search for a location with better fitness and update. The principle of bees searching near the nectar source area in the ABC algorithm is introduced into the BAS algorithm, which can enhance the diversity of the local search results of the population, overcome the problem that a beetle cannot jump out of the local optimum when it falls into the partial optimal solution. Meanwhile, the introduction of the search within the neighborhood can be used as a basis for judging whether the beetle has entered the target range and changing the update of the beetle’s movement position.
In order to test the performance of improved algorithm, we use the benchmark function to evaluate the performance of IBSO algorithm and compare the experimental results with the other five algorithms. Then we describe the flow chart of the IBSO algorithm for solving the path planning problem to show the execution process of the algorithm more clearly. The computational complexity of the algorithm is analyzed by pseudo code.
Benchmark function test
We test the improved algorithm with 10 benchmark functions. The relevant contents of the benchmark function are shown in Table 1. We use the MATLAB R2018 as the simulation software in the experiment.
Relevant parameters of standard test function
Relevant parameters of standard test function
In order to verify the excellent performance of IBSO algorithm. We choose several typical heuristic algorithms and IBSO algorithm for comparative experiments. It includes PSO [39], the original BAS, sooty tern optimization algorithm (STOA) [40], ant lion optimizer (ALO) [41] and artificial bee colony algorithm. To ensuring the fairness of the comparison algorithm and obtain satisfactory results. We set the maximum number of iterations for each algorithm to be 200. The number of search population of each algorithm is 100, and the spatial dimension is 30. Table 2 provides the main parameter settings of the six comparison algorithms.
The main parameter settings of the six algorithms
The main parameter settings of the six algorithms
We run each algorithm independently for 20 times, and count the average, optimal and worst value of the six algorithms. In the Table 3, Best, Worst and Mean represent the optimal value, worst value and average value. We rank the average solution values obtained by different algorithms according to the quality of the results. Table 3 shows the results of the test results. From the optimal value, worst value, average value and the ranking of the experimental results, we can see the optimization performance of IBSO algorithm.
Experimental results of 6 algorithms
Experimental results of 6 algorithms
According to the data in Table 3, the 10 benchmark functions are run independently for 20 times, and the IBSO algorithm can find the optimal value for the test functions f2,f5, f7 and f10. In the results of benchmark test functions f1, f3 and f8, the optimal solution can be achieved, and the average solution value shows a considerable improvement in the accuracy of the solution compared with the other five algorithms. Although the results of benchmark functions f4, f6 and f9 do not reach the optimal solution, its solution accuracy is considerably improved compared with the other algorithms, and the solution result is better than that of the comparison algorithm. In order to more intuitively show the excellent performance of the IBSO algorithm, Fig. 8 are the iterative convergence diagrams of the six algorithms. In order to more clearly show the convergence effect of the algorithm, some functions use the logarithmic function representation for the fitness value.

f1-f10 Iterative convergence graph.
According to the iterative convergence diagrams of 6 optimization algorithms to solve 10 benchmark test functions, it can be seen that the test functions f2,f5,f7 and f10 can be solved to the optimal solution when the iteration is less than 50 times. Among other benchmark functions, the IBSO algorithm shows better solution accuracy and faster convergence speed, which is due to the fast convergence characteristics of the beetle algorithm. In addition, we study and analyse the distribution characteristics of the benchmark functions solved by IBSO and comparison algorithms in 20 independent experiments. As shown in Fig. 9, the box diagram analysis is shown. We proposed IBSO performs well in most functions compared to other competitors. The median, maximum and minimum values of the objective functions obtained by IBSO are almost the same as the optimal solutions, especially for f2, f5, f7 and f10. In the box diagram, f1, f3, f4, f6, f8 and f9, we can see that there is a gap between the maximum and minimum solution ranges of IBSO algorithm, but according to the statistical data in Table 3, IBSO solution values are superior to other comparison algorithms when the solution accuracy changes.

Box diagram analysis for benchmark f1-f10.
From the analysis of iterative convergence graph and box graph of benchmark functions, it is obvious that the IBSO algorithm we proposed has shown comparable better computational performance, which further proves the validity of IBSO algorithm.
Therefore, IBSO shows the potential to be a better optimizer for solving global optimization problems, particularly, it has good computational performance in solving complex nonlinear problems. It in turn provides a feasible basis for the IBSO algorithm to solve some complex nonlinear calculation modelling in the path planning problem.
The implementation flow chart of the IBSO algorithm in path planning problem is shown in Fig. 10:

Flow chart of IBSO for path planning.
The pseudo code of the above model is presented in Algorithm 1.
The number of executions of basic operations when an algorithm solves a problem is defined as the time complexity of the algorithm. The original BAS algorithm is simple in principle and fast in execution. The time complexity can be expressed as T (N) = O (DIter i ). Among them, D represents the spatial dimension of the problem to be solved, and Iter i represents the number of iterations of the algorithm to solve the problem, so the time complexity of the BAS algorithm is O (1). The spatial dimension of the IBSO algorithm proposed in this paper is still D, and the number of iterations is still T i . After a single beetle transformed into beetle swarm, the population number becomes N s , and in each iteration process, it is converted from a beetle search to a population number N s for solution. Optimization increases the computational complexity of the algorithm execution, and increases the solution time. N s has a greater impact on the computational complexity of the enhanced algorithm, but the introduced Levy flight strategy for vector operations and step disturbance factor r are both within a small range. The numerical value has little effect on the computational complexity of the algorithm. The idea of neighborhood search combined with artificial bee colony algorithm is to reselect points near the current optimal location for fitness calculation and compare it with the current best point. Therefore, the increased calculation process is O (Iter i N s ). Therefore, the time complexity of the enhanced algorithm can be roughly expressed as T (N) = O (DIter i N s + Iter i N s + r ⊗ L (β)), that is, O (N). Therefore, the computational complexity of the IBSO algorithm is slightly larger than that of the BAS algorithm.
The IBSO algorithm achieves ideal performance results in the benchmark function. Next, it is tested whether the IBSO algorithm still has good solution performance in the path planning optimization problems. In this paper, we choose two kinds of common path planning problems: the ergodic optimal path problem in the discrete domain and the global path planning problem in the continuous domain. The experimental contents including TSP, MTSP, and obstacle avoidance problem of simulated robots in 2D plane and 3D environment. According to different solving problems, we carry out modeling and analysis, and use the proposed IBSO algorithm to solve them.
In this paper, without considering other real-time factors, our modeling and simulation are tested in an idealized static environment model. We regard UAV as a mass point.
Experimental process analysis
The specific steps of using the proposed IBSO algorithm in path planning problem are as follows: Analyze and model the path planning problem to determine the optimal objective function. Improve the traditional beetle antennae search algorithm. Use the improved IBSO algorithm to optimize different path planning problems.
In the IBSO algorithm, the location information of the beetle swarm is expressed as the optimal path distance length. The shortest cumulative length of the path line is used as the value of the fitness function for the optimization algorithm. Each model is run 20 times independently. We take the average as the comparison data.
The detailed parameter settings of the test experiment are shown in Table 4:
Experimental parameter setting
Experimental parameter setting
Case A: optimization of the traveling salesman problem
There are many optimization algorithms for solving TSP. The PSO has the advantages of fast search, easy implementation, and simple parameter setting. It is suitable for solving combinatorial optimization problems [42]. The ant colony optimization (ACO) algorithm selects the next path based on probability, and the ants will secrete pheromone substances on the path when they travel, avoiding the path that has been traveled, and select the next city according to the probability calculated by the heuristic factor, so that the ACO algorithm has great advantages for solving the TSP [43]. In order to verify the effectiveness of the improved algorithm in this paper, we use the above two algorithms to solve TSP as the comparison of the algorithm in this paper, and cite the experimental results of the literature [44–46] for comparison. The TSPLIB database [47] is used to test the simulation, the test platform is MATLAB R2018a. The data instance is continuously tested for 20 times, and the optimal value and average value are recorded. The experimental results are shown in Table 5. Table 5 Simulation results of the improved algorithm
Simulation results of the improved algorithm
Simulation results of the improved algorithm
It can be seen from Table 5 that the IBSO algorithm has a great improvement in the solution accuracy. Among them, the test set burma14 can be solved to the optimal value, and the relative error value of the test set bayg29 is approximately 0. The theoretical optimal solution can be obtained in 20 simulation tests. The relative error of IBSO algorithm is significantly lower than that of other comparison algorithms. In the test set dantzig42, the relative errors of the PSO and ACO algorithms are as high as 50.5% and 8.7%, while the solution values of the IBSO algorithm and the reference [44, 45] are further improved, but the results of the IBSO algorithm are better. The simulation comparison of the above three test sets shows that the IBSO is more accurate in solving TSP. Figure 11 is the optimal path diagram of the solution of the three test sets by the IBSO algorithm.

Optimal path of three test set cases.
The following is the TSP case simulation time of the three test set cases as shown in Table 6 and the algorithm convergence comparison graph as shown in Fig. 12.
Simulation time comparison of three algorithms

Iterative curve of three test set cases.
It can be seen from Table 6 that the ACO algorithm has the longest running time, which is about 2–7 times than the IBSO algorithm. The running time of the PSO algorithm and the IBSO algorithm is shorter, but the IBSO algorithm we proposed is 0.3 s shorter on average than the PSO algorithm. Among the comparison algorithms in reference [46], the simulation time of AS algorithm is the shortest, but it is also higher than that of IBSO algorithm. Comparing the iterative convergence curves of the three algorithms, case bayg29, the IBSO algorithm finds the optimal solution after about 30 iterations, the PSO and ACO find the optimal solution after 120 and 80 iterations, respectively. Case burma14, the number of cities is small, and the solution results of the three algorithms are all close to the optimal value. It can be seen from the iterative graph that the convergence effect of the IBSO algorithm is worse than that of the ACO algorithm in the early iteration. This is because the IBSO algorithm needs to determine the position and orientation of the beetle, and once the target orientation is determined, the solution can be quickly converged. In addition, in this case, the IBSO algorithm can solve the optimal solution value, while the PSO and ACO algorithms do not solve the optimal solution value. In the case of dantzig42, the IBSO algorithm finds the optimum after about 50 iterations, while the PSO algorithm falls into a local extremum at about 110 iterations, indicating that the PSO algorithm is not suitable for solving the multi-city TSP problem. The ACO algorithm has not yet found the optimal solution after reaching the maximum number of iterations. It can be seen from the above analysis that the convergence speed of our proposed IBSO algorithm is faster than other algorithms, the running time is shorter, and the solution performance is better.
In the previous section, we tested the IBSO algorithm with the classical TSP problem in the path planning problem. In this section, we applied the IBSO algorithm to the extended TSP problem: the solution of MTSP. Similarly, referring to the TSPLIB test data set. The data case is continuously tested for 20 simulations, and the maximum number of iterations is 200. The number of travel agents is 5. The optimal value was recorded, and the experimental results are shown in Table 7.
Simulation results of the improved algorithm
Simulation results of the improved algorithm
The path diagram of IBSO algorithm to solve MTSP test cases is shown in Fig. 13:

Path planning.
It can be seen from Table 7 that our proposed IBSO also has good computational performance in solving the multi-travelling salesman problem. In Burma14 and Bayg29, which have a small number of cities, IBSO can solve the current optimal solution. With the increase of the number of cities, the calculation degree is complicated. Although the IBSO algorithm cannot solve the current optimal solution, it has a great improvement in the solution results compared with the other algorithms, and is the closest to the current known optimal solution. From Fig. 13, we can see that the IBSO algorithm solves the MTSP case, which can better allocate cities to multiple travelling salesmen. Combining the solution path planning diagram and the solution results, it can be seen that IBSO has better performance in solving the multi-travelling salesman problem.
Case A: path planning for 2D obstacle avoidance
In this section, we use the proposed IBSO algorithm to shorten the optimization time and provide a new idea for the mobile robot to avoid obstacles in time. The IBSO algorithm can find the current optimal path and obtain a smooth collision-free and smooth obstacle avoidance path. It effectively improves the problem of avoiding obstacles during the real-time movement of the intelligent control robot and increases the safety.
Two cases are simulated in MATLAB environment based on the improved beetle swarm optimization algorithm, and compared with PSO, ABC, improved artificial bee colony algorithm [58], literature [59] TPBSO algorithm are compared to prove the effectiveness of the IBSO algorithm. The initial number of the beetle population is 50, the initial step of the beetle is step = 1, and the distance between two antennae is d = 2. The particle swarm population is 200, and the learning factor is set to 2; the ABC employs 40 bees. The maximum number of iterations of each algorithm It max = 600times, and the search is performed in the spatial dimension D = 30. The simulation results of the five algorithms are as follows.
CASE A: threat obstacle setting
CASE A: threat obstacle setting

CASE 1 path planning of five algorithms.
It can be seen from the operation images that the PSO algorithm and the TPSBO algorithm did not avoid obstacles in the early stage of the iteration, the ABC algorithm and the improved ABC algorithm have a good optimization effect in the early stage of the iteration, but with the characteristics of the algorithm itself, the convergence rate slows down, and the limitations of the algorithm appear. In the later stage, the small object obstacle is not well avoided, and the optimization process enters the obstacle radius. The IBSO algorithm proposed in this paper avoids obstacles well in the entire iterative optimization process, without touching. Secondly, from the motion trajectory, the PSO algorithm has minor fluctuations and has many inflection points; the motion trajectory of the ABC algorithm and the improved ABC algorithm fluctuates in a small range in the later stage; the motion trajectory of the ABC algorithm is not smooth; the motion trajectory of the IBSO algorithm is smoother than other algorithms, with no inflection points. Tables 9 10 list the comparison of different indicators.
Comparison of five algorithms
Comparison of average data of five algorithms
From the analysis of Tables 9 10, it can be seen that under the same number of iterations, the convergence speed of the IBSO algorithm is shortened by at least 0.5 seconds on average. This is precisely due to the rapid optimization and convergence of the BAS algorithm, which enables the intelligent control robot to respond quickly and avoid obstacles when it is about to touch an obstacle. From the perspective of optimal path length, the path lengths measured by the PSO algorithm, the ABC algorithm, the improved ABC algorithm and the TPBSO algorithm from the simulation experiments are all higher than the IBSO algorithm. The results measured by the IBSO algorithm not only smooth the trajectory, but also reduce the path length by nearly 10 meters. The IBSO algorithm proposed in this paper is lower than other algorithms in terms of average objective function mean and index value variance. Therefore, the IBSO algorithm is relatively stable, and the optimization effect and robustness are strong. It can solve the problem of intelligent control robot avoiding obstacles in 2D environment very well.
CASE B: threat obstacle setting
Comparison of five algorithms

CASE 2 path planning and iterative convergence comparison diagram of five algorithms.
In case 2, the obstacle environment is more complex. According to the simulation operation diagram, both the PSO algorithm and the TPBSO algorithm have many inflection points and pass through obstacles; the improved ABC algorithm crosses obstacles in the early stage of operation, and the simulation effect is poor; The running trajectory of the ABC algorithm and the IBSO algorithm in this paper are similar, but it can be seen from the figure that the running trajectory of IBSO is smoother. It can also be seen from the iterative convergence diagram that the IBSO algorithm in this paper has the best optimization results, which further verifies this paper still has good operating results in the case of more complex obstacle environments, which provides an effective solution to the obstacle avoidance problem of mobile robots in 2D space, and further proves the effectiveness of the IBSO algorithm.
In the previous section, we discussed the path planning scheme for solving the obstacle avoidance problem with the IBSO algorithm in the 2D environment. In this section, we further discuss the path planning scheme for solving the obstacle avoidance problem with the IBSO algorithm in the 3D space. Many researchers have also studied the solution of obstacle avoidance problem in 3D path planning. At present, the mainstream algorithm for solving this kind of problem is based on the improvement of the traditional obstacle avoidance algorithm, such as the improved A* algorithm [56] and the improved RRT algorithm [57]. Many researchers use intelligent optimization algorithm to solve it. Lv et al. apply golden eagle optimizer (GEO) and gray wolf optimizer (GWO) in the path planning of UAV for power detection [58]. Utkarsh et al. use glow-worm swarm optimization (GSO) to solve the three-dimensional obstacle avoidance problem [59].
To study the problem of path planning, we first need to model the environment of the planning space. The obstacle terrain in 3D space is often generated by the mountain simulation function shown in Equation (32):
In the formula, Z i (x, y) represents the height at the point (x, y) on the i–thobstacle peak, that is, the ordinate. k1, k2 are two adjustable parameters used to change the shape and size of the mountain. x i , y i represent the abscissa and ordinate of the center of the mountain, x si , y si represent the attenuation of mountain i in the x and y directions, that is, the slope, which is the control amount that affects the slope of the mountain. h i is the highest height of the obstacle peak.
In order to reduce the angle adjustment operation of UAV in the actual movement process, so as to reduce energy consumption and improve endurance, it is necessary to fit the 3D path as smooth as possible. Generally, B-spline curve method is used to construct smooth trajectory [60]. The equation of B-spline curve is shown in Equation (33):
In the formula, d i (i = 0, 1, . . . , n) is the control vertex of the B-spline curve, which is used to limit the range of the curve, and Ni,k (u)is the i–th k–th basis function with respect to the parameter u. Function value, the highest degree is k. Equation (34) is the recursion of the basis function.
In the formula, define 0/0 =0, u i (i = 0, 1, . . . , n) is the node vector, and its sequence satisfies the non-decreasing relationship. In this paper, the node vector repeatability at both ends is k + 1, the inner node vectors are uniformly distributed, and the value of k is 3, that is, the path is fitted by a cubic uniform B-spline curve equation.
In order to test the obstacle avoidance performance of the IBSO algorithm in a 3D environment, the size of the environment space is set to 500 * 500 * 500m3.
The IBSO algorithm is used to test the 3D environment of the CASE 1, and the IBSO algorithm is tested and compared with PSO and ACO algorithms. Path start coordinates is (10, 30, 190) and path end coordinates is (420, 460, 320). In this test example, we random set 6 local highest peaks, and 4 threats are added to the peaks. The parameters of the threat and the coordinates of the highest point of the mountain are shown in Tables 13 14 respectively. For this environment, each algorithm runs independently for 20 times, with 50 iterations. The average values of the detailed experimental results are shown in Table 15.
Threat parameters
Peak parameters
Comparison of algorithm results
The IBSO algorithm is applied to the solution of this test case, and its 3D path planning diagram and corresponding 2D path lines are shown in Fig. 16 and Fig. 17.

Comparison diagram of 3D path planning.

2D route diagram.
According to Fig. 16 and Fig. 17, it can be clearly seen that in the test of this case, a large number of zigzag lines appear in the trajectory of PSO algorithm in the 3D path graph. In the corresponding two-dimensional path graph, it can be found that in the later stage of operation, the trajectory of the algorithm goes into the mountains and fails to avoid obstacles. Compared with PSO algorithm, ACO algorithm does not collide with obstacles and mountains, and the route trajectory is further smoothed. IBSO algorithm has a better running effect compared with PSO and ACO. From the 3D path planning diagram and the corresponding 2D running track diagram, it can be seen that the running track is smoother with less twists and turns, and it can also successfully avoid obstacles. According to Table 15, it can be seen that the route path run by IBSO algorithm is shorter, and the simulation time is shortened to 60.3174 s, which attributes to the result of rapid optimization by the algorithm.
In order to increase the algorithm performance comparison, IBSO algorithm is used to test the three-dimensional environment of the case 2, and IBSO algorithm is tested and compared with PSO and ACO algorithm. We randomly set up 12 local highest peaks and added 4 threats to the peaks. The threats parameters and peaks parameters are shown in Tables 16 17 respectively. Path start coordinates are (15,30,210) and path end coordinates are (450,490,330).
Threats parameters
Peaks parameters
The IBSO algorithm is applied to the solution of this test case, and its 3D path planning diagram and corresponding 2D path lines are shown in Figs. 18 19.

Comparison diagram of 3D path planning.

2D route diagram.
From Figs. 19 20, we can see that by solving case 2 with IBSO algorithm, we can get a smooth path that can avoid threats. At the same time, IBSO algorithm can find a path with low flight altitude. The shortest path length of the final objective function is 9.4358E+02 m. In contrast, PSO algorithm and ACO algorithm failed to avoid obstacles due to the limitation of algorithm performance when passing the first obstacle, and the path of PSO is more tortuous.

Iterative diagram of path change.
For this 3D environment, each algorithm runs independently for 20 times, with 50 iterations. The average values of the detailed experimental results are shown in Table 18. The iterative comparison diagram of the three algorithms is shown in Fig. 20.
Comparison of algorithm results
As can be seen from Table 18, the IBSO algorithm has the shortest path length, which is nearly 64 m shorter than the other two algorithms. From the perspective of test time, IBSO also has good performance, which is nearly 5s-7 s shorter than the other two algorithms. This is the embodiment of the fast iterative optimization of the BAS algorithm. The average number of iterations to reach the optimal fitness, IBSO algorithm also shows good computational performance, about 46 times can reach the optimal fitness. From the iteration comparison chart, it can be found that the final optimization result of IBSO algorithm is better than that of the other two algorithms. However, in the early iteration process, IBSO algorithm is worse than PSO algorithm and ACO algorithm, this because the random location of beetle in the initial stage of IBSO algorithm and the singularity of beetle direction will make beetle need to determine the approximate target direction in the multi-dimensional space. Once they can quickly optimize after a period of iterative optimization. Through the above experiments, we further verify the effectiveness of our IBSO algorithm in solving the obstacle avoidance problem of three-dimensional path planning.
In order to study the path planning problem, an improved beetle swarm optimization algorithm is proposed in this paper. This paper analyzes two kinds of common path planning problems: ergodic optimal path problem in discrete domain and global path planning problem in continuous domain, including traveling salesman problem, multi traveling salesman problem, path planning of two-dimensional obstacle avoidance problem and path planning of three-dimensional UAV obstacle avoidance problem. We transform the single search of traditional beetle antennae algorithm into beetle swarm search solution to enrich the global optimization. Combining with the Levy flight strategy of nonlinear sinusoidal disturbance, the single beetle is prevented from being bound by the position of local convergence, and the search space is expanded. Combined with the idea of hiring bees to search near the nectar source neighborhood in the artificial bee colony algorithm, it enriches the search ability of the beetle swarm to solve the global problem. The whole process balances the local and global search, as an improved beetle swarm optimization algorithm. We test four typical path planning problems. The experimental results show that the IBSO has better global search ability than other control algorithms, with fewer iterations, faster convergence, shorter time-consuming, and the final path is better, which provides an effective solution for the design of path planning scheme.
For IBSO algorithm we proposed, the algorithm uses random initialization during population initialization, which will cause nonuniform population distribution in the search range, and then affect the search results. In the following work, we would use Latin Hypercube Sampling (LHS), Monte Carlo method and other methods to discuss the distribution of population initialization and the solution results. Secondly, these improvements to the BAS algorithm will inevitably lead to an increase in the time complexity of the algorithm. The analysis of computational complexity also includes the spatial complexity. How the spatial complexity of IBSO algorithm changes is also the content we need to study in our future work.
In our future research, we can further optimize our algorithm from the perspective of other more complex application problems in path planning, such as the balanced traveling salesman problem and the coloring bottleneck TSP. In addition, the environment model is further improved to make it closer to the real test environment to a greater extent.
Author contributions
Conceptualization, Yucheng Lyu and Yuanbin Mo; methodology, Songqing Yue; software, Lila Hong; validation, Yuanbin Mo and Songqing Yue; writing-original draft preparation, Yucheng Lyu; writing-review and editing, Yucheng Lyu, Yuanbin Mo and Songqing Yue; supervision, Yuanbin Mo.
Informed consent statement
All authors have read and agreed to the published version of the manuscript.
Conflicts of interest
All authors disclosed no relevant relationships. All authors declare no conflict of interest.
Data availability statement
The data that support the findings of this study are available from the corresponding author upon reasonable request.
Footnotes
Acknowledgments
This work was supported in part by the National Natural Science Foundation of China under Grant 21466008; in part by the Guangxi Natural Science Foundation under Grant 2019GXNSFAA185017; in part by the Innovation Project of Guangxi Graduate Education under Grant YCSW2022255 and in part by the School Level Scientific Research Projects under Grant 2021MDKJ004.
