Application of an Improved Ant Colony Algorithm to Optimal Path Planning for Automatic Guided Vehicles

The path planning is the key technology of AGV path finding. This paper uses an improved ant colony algorithm to plan the path of an AGV. For avoiding the defects of traditional ant colony algorithm such as low smoothness of route and local optimal solution, the transition probability and pheromone update method are improved. Various actual turning situations are analyzed in the transition probability, the basis for defining the smoothing factor is provided by the Bezier curve, and a random selection operator is formed for updating local pheromone by extracting characteristic information of iterative process. The simulation results in different environments prove that the smoothing factor plays an important role in optimizing the smoothness of the path and the diversity of the constructed solutions, and the random selection operator is effective in solving the contradiction of the local optimal solution and in finding the optimal solution.


Introduction
Path planning for automatic guided vehicles is a hot topic in the field of logistics research, and it is also a typical vehicle routing problem (VRP).Automatic guided vehicles are required to meet the requirements such as shortest time, shortest path, lowest energy consumption, etc., and search for an optimal or near-optimal safe path in a given working environment.At present, there are relatively traditional algorithms, such as the A* algorithm [1,2], Dijkstra algorithm and artificial potential field algorithm.In recent years, scholars have also proposed to apply bionic algorithm to path planning, such as genetic algorithm [3][4][5][6], ant colony algorithm [7][8][9][10], particle swarm algorithm [11][12][13][14], etc. the path smoothness is an important index for evaluating path planning algorithms.Huang Chen et al. [15] and Song Rui et al. [16] combined the A* algorithm with path smoothing to obtain smooth and high-quality paths.Baoye Song et al. proposed kinematic constraints to make the particle swarm algorithm get a smoother path [17].
The ant colony algorithm is a bionic evolutionary algorithm originated from nature.It was proposed by Marco Dorigo in 1991 [18].It has the advantages of strong robustness, self-

Environmental model
The grid method is the most commonly used way to correspond grid information with environment.This method is easy to create, simplifies complex problems and reduces the amount of data computation.Therefore, the grid method is used to establish a two-dimensional space environment model of the vehicles.The grid method model is shown in Fig. 1.The standard for dividing the grid area is the unit moving step of the vehicle, the green grid is the starting grid, the grid number increases from left to right and from top to bottom, the red grid is the end grid, the black grid is the set obstacle, and the white grid is the free grid. is the grid number and  is the grid edge length.The relationship between the grid number and the grid center coordinates is as follows: {  = (, ) − 0.5,   = −0.5,  =  − 0.5  =  + 0.5 − (/) ,

Principle of Ant Colony Algorithm
Ants in nature release a secretion (pheromone), during their foraging movement.As time goes by, the substance will volatilize gradually, so the concentration of pheromone is the strongest at the starting point or around the destination.The probability of ants selecting a path is proportional to the intensity of pheromone on the path.Of course, with the increasing intensity of pheromone, the probability of being selected increases.So repeatedly, finally make the shortest path is retained.

Model of Ant Colony Algorithm
As a probabilistic algorithm, the ant colony algorithm uses the pheromone quantity of optional transfer nodes to determine the next directions of ants.In the following formula,    () is the calculated value of ant position transfer probability, which indicates the transfer probability of ant  moving from position  to position j at time .
where   () represents the pheromone intensity of the current position to the target point at time ,   () is the heuristic information of the ant, that is, the reciprocal of the distance from the current position to the end point, expressed as   () = 1   ⁄ , both have a certain guiding role for the movement of ants.α and β respectively represent the weighted values of pheromone and visibility, and   indicates the aggregate of transfer nodes that ant  is allowed to select next at node .
Each ant updates its pheromone after completing an iteration, and each path pheromone is adjusted according to the following formula： where  is the number of ants, 0 < ρ ≤ 1 is the evaporation rate of the pheromone, so (1 − ρ)  () indicates the residual pheromone after the path pheromone volatilizes, and ∆   is the pheromone left by the th ant in the path  to j. as shown in the following formula: where   is the total path length obtained by the th ant after taking the complete path.As described above, the algorithm finally leads to the global optimization path.

Improved Ant Colony Algorithm
In order to overcome the shortcomings of ant colony algorithm, such as low smoothness and locality of optimal solution, in this paper we propose an improved ant colony algorithm based on the existing algorithm in the following way: (1) adding a smoothing factor  to the transition probability; (2) constructing random selection operators by statistical analysis to improve pheromone update method.

Improved Transition Probability
Transfer probability is the reference for selecting the next point to move.However, the vehicle will inevitably turn in the running process, and too many invalid turns will cause speed loss and time waste.Therefore, we analyze the effect of turning on the path trajectory in actual situations, and then punish the ants turning by adding a smoothing factor , so that the ants have a greater probability of choosing a straight line to run in the moving process and reduce unnecessary turns.
Next, we analyze the turning process to make it more in line with the actual situation.Dividing the turning process into two types of discussions, one is the turning without obstacles in the range, the other is the turning with obstacles in the range.The path result obtained by the algorithm is ideal, so we need to analyze the actual turning process in order to define the smoothing factor .When the turning node is determined, we use the vector curve drawing method, that is. the Bezier curve processing to draw the trajectory.The curve processing method has the properties of endpoint tangent vector, convex hull and slow change of curvature, and is suitable for processing the vehicle motion trajectory.We consider the Bezier curve is the moving path of the vehicle in actual situation.The following figure shows the turning without obstacles.The blue line is the ideal path and the red curve is the processed curve path.  ,  −1 ,  +1 are path nodes.The picture shows that the actual path is shorter than the ideal path.

Fig. 2 Barrier-free turn
We analyzed the turns with obstacles in the range.Furthermore, it is found that there are two kinds of ideal situations with large deviation from the actual turning curve.As are shown in the following two figures, the upward figure shows that the angle  is 135°, and the downward figure shows that the angle  is 90°.Due to the defects of grid method, we take point  as the control point of the Bezier curve.The processing straight line represented by the green dashed line is constructed, and the red Bezier curve is finally obtained, and then the length of the Bezier curve is approximately computed by the numerical method.The following table 1 shows the length data for different turns.From the above table, it is found that the Bezier curve with barrier-free turns is shorter than the ideal path, while the Bezier curve with barrier turns is obviously longer than the ideal path.Therefore, it is concluded that under a certain number of turns, barrier-free turns are more suitable for actual situation than barrier turns.
Therefore, when we set the smoothing factor parameter value of the algorithm, we should conform to the fact that barrier-free turns are better than barrier turns.The definition of the smoothing factor  is divided into two parts as shown in the following formula: 1 is a smoothing factor in the case of Barrier turn, and  2 is a smoothing factor in the case of Barrier-free turn.According to the actual turning curve, we set the smoothing factor as the above three levels.The smoothing factor is combined with the pseudo-random scaling rule as shown in the following formula： where  0 is an adjustable parameter, which determines the relative importance between using prior knowledge and exploring new paths; when the random number  is greater than  0 , the next node with the largest formula value is directly selected; when  is smaller than  0 , the selection of the next node is based on the original transition probability.The uncertainty of the pseudo-random mechanism increases the diversity of the ant's solutions in the process of solving, thus increasing the possibility of getting the global optimal solution.

Improvement of Pheromone Update
The ant colony algorithm is a random search method.Like most intelligent optimization algorithms, it seeks the optimal solution from a large number of possible solutions.The construction of the optimal solution is to construct the solution individually by each ant individual, and then select it through information interaction between groups.As an intelligent algorithm, ant colony algorithm is mainly embodied in the update of pheromone and the intelligent relationship between individual ants and groups.However, the existing algorithms do not consider the evolution of ant colony in the iterative process.If the path information of each generation of ant colony is extracted as a feature, the diversity of solutions can be reduced.
According to the concept of statistics on data processing, the relevant characteristic information of a group is extracted.In this paper, the characteristic parameters of each generation of ants are extracted by statistical analysis method, i.e. random value, mean value and maximum difference value of path information of each generation of ants.And it is applied in the updating process of ant colony pheromone.In this paper, on the basis of ACS, EAS and MMAS are used for reference in updating pheromone, and random selection operators are added.The local update rule of pheromone is to reduce path pheromone through negative feedback mechanism, to realize local adjustment of pheromone, and to increase diversity of possible paths explored by ants.The update method of local pheromone is as follows: where ξ is an adjustable parameter,   is the initial pheromone value, and ∆  is a random selection operator.By integrating the random value, mean value and the maximum difference value in the path information of each generation of ants, the following formula is used for calculation: in the formula, λ is the serial number of randomly selected elite ants, σ is the number of elite ants,   is the path length corresponding to the selected elite ants in each generation,   is the path length corresponding to the worst ants in each generation,  is the path length corresponding to the removal of other selected ants in each generation, and   is the average path length of each generation of ants.
For global pheromone update rules we employ traditional pheromone update models.We use pseudo code to represent the entire running process of the improved ant colony algorithm.
In the above code, we add a smoothing factor  in calculating the transition probability.In the pheromone update process, the global pheromone update is combined with the local pheromone based on statistical analysis.

Evaluation of Algorithm Application
The performance of the algorithm can be evaluated from convergence speed, time complexity or shortest path, etc.As a path planning algorithm, the first consideration is whether the path obtained by the algorithm is the optimal solution and whether the optimal solution is suitable for practical application.Therefore, we set the algorithm path as the first evaluation index.
However, in the process of algorithm implementation, we add the influence factors of actual turning on the path.To evaluate the optimal path of the algorithm, it is necessary to consider the deviation between the ideal path and the turning curve.

Experimental Results and Simulation
In order to verify the effectiveness of the improved algorithm in this paper, this section compares the improved algorithm with the algorithms mentioned in this paper, such as EAS, RAS and ACS, which are respectively used in the simulation experiment of vehicle path planning based on grid method.And the improved algorithm and other algorithms are firstly used for path planning in different environments.The simulation experiment is carried out in MATLAB: 2.8GHz processor, 12GB memory and 64-bit system.The global pheromone volatilization factor is 0.1, the local pheromone volatilization factor is 0.08, the heuristic factor is 3, and the pheromone factor is 2.

Performance Comparison of Algorithms in simple environment
Figures. 5 and 6 are respectively path planning figures and iterative graphs of four algorithms in a U-shaped obstacle environment but with different obstacle positions.Table 2 shows the experimental data in simple environment.

The Result of Performance Comparison in Simple Environment
By combining the path planning chart and data table, it is found that using the improved algorithm can effectively obtain the optimal path.Moreover, it can be clearly found from the table that the improved algorithm makes fewer turns in the path planning, and other algorithms make too many invalid turns on the path that could travel straight, which makes the moving path more complicated.This shows the function of smoothing factor, which is studied in detail in the next section.According to the evaluation reference, the influence caused by the shortest path and obstacle angle of the algorithm is comprehensively evaluated, and the improved algorithm is better than other algorithms in this environment.

Performance Comparison of Algorithms in Medium Environment
The following two figures are respectively the path planning and iteration of the four algorithms in medium environment.Table 3 gives experimental data in medium environment.

The Result of Performance Comparison in Medium Environment
Figures 7 and 8 show the actual effects of the four algorithms in medium-sized environment.We can find from the iteration in Fig. 7 that no optimal solution has been found in other algorithms except the improved algorithm.From the number of corners in the data table, the improved algorithm is obviously better than other algorithms, whether it is the number of corners or the number of corners under obstacles.Moreover, the standard deviation of the shortest path also shows that the improved algorithm is better than other algorithms in the aspect of stability.

Performance Comparison of Algorithms in Complex Environment
The following figures show the path planning and iteration of the four algorithms in complex environment.Table 4 gives experimental data in complex environment.4 are comparisons of four algorithms in complex environment.It is obvious from the iteration that the improved algorithm can find the optimal solution.By judging from the average number of corners and the number of corners with obstacles, the number of corners of the improved algorithm is far smaller than that of other algorithms, which shows that the improved algorithm has better smoothness.Although the improved algorithm has some losses in convergence speed, but the decrease in convergence speed is allowed on the premise that the optimal solution can be found.

The Discussion of Performance Comparison in Different Environment
The performance of the integrated algorithm in different complexity environments shows that the improved algorithm has better performance.From the standard deviation of the shortest path, it is found that the improved algorithm has better stability, accuracy and optimization ability in the process of searching for the path, which effectively improves the unstable results of probabilistic algorithm.In addition, because the smoothing factor is added, the algorithm is obviously better than other algorithms in the ability to avoid turning, which makes the shortest path of the algorithm smoother.In practical application, the improved algorithm has more application potential than other algorithms.The smoothing factor is further discussed in the next section.

Experimental Verification of Smoothing Factor
The experiments in the previous section show the performance of the improved algorithm in different experimental environments.In this section, the role of smoothing factors in the algorithm is further studied.We apply the improved algorithm with or without smoothing factor to medium and complex environment to judge the effect of smoothing factor.The shortest path, diversity and the number of corners of the algorithm are compared to reach a conclusion, where in diversity is the ability to construct solutions in the iterative process of the algorithm.With the increase of diversity, the probability of finding the optimal solution is enhanced, which can effectively avoid the occurrence of local optimal problems.

Comparison of Algorithms in Medium Environment
The following two figures are the path planning with two algorithms in a medium-sized environment.5 shows the resulting data.From the above chart, it is found that the smoothing factor has a great influence on the performance of the algorithm.In terms of the average number of corners, both algorithms can effectively find the shortest path, but the average number of corners of the algorithm without  is significantly larger than that of the improved algorithm with .Through further analysis, we have previously concluded that the number of barrier corners will greatly affect the actual path, so for the smaller number, the algorithm bas better ability to obtain the optimal solution under actual constraints.

Comparison of Algorithms in Complex Environment
The following two figures are path planning of two algorithms in a complex environment.6 shows the resulting data.From the above chart, it is found that under the same conditions, the improved algorithm with  added can find a shorter path than the algorithm without , and it is obviously better than the improved algorithm without  in terms of the average number of corners and algorithm diversity.

Discuss the Influence of Smoothing Factor in the Algorithm
From the experimental comparison of the smoothing factor in the above two environments, we have proved that the smoothing factor have a significant effect on improving the performance of all aspects of the algorithm.Although the algorithm has a slight loss in convergence speed, it is negligible compared with the greater improvement in other performance of the algorithm.

Conclusions
In this paper we have analyzed the characteristics of ant colony algorithm in path planning and the positive feedback process of ant information.We have examined the smoothness of the path and discussed the actual influence of obstacles on the turning path.The added smoothing factors have been classified to make the algorithm more suitable for the actual environment.By combining the penalty mechanism with pseudo-random selection rules, the selection probability of straight path have been improved, thus improving the convergence speed, smoothness and diversity of the algorithm.In the process of local pheromone update, we have extracted the worst and average ant information of each generation of ants through statistical analysis and randomly select them.The convergence speed of the coordination algorithm and the ability to get the optimal solution make the algorithm self-adaptive to a certain extent because each generation of ant information has to undergo the same processing.Through the experimental simulation in different complexity environments, it is proved that the improved algorithm can give the optimal solution accurately and stably compared with other algorithms in different environments, and the algorithm has excellent performance in smoothness.
In the convergence aspect of the algorithm in this paper, the convergence speed decreases because of improving the diversity of the algorithm.How to balance the convergence and diversity of the algorithm is the next goal to be solved.When there is no obstacle, the turning process of the vehicle.The blue line is the ideal route and the red line is the actual route.When there is a obstacle, the vehicle completes the turning process (θ=90°).The blue line is the ideal route and the red line is the actual route.

Fig. 9
Fig. 9 Path planning and iteration

Figure 9
Figure 9 and Table4are comparisons of four algorithms in complex environment.It is obvious from the iteration that the improved algorithm can find the optimal solution.By judging from the average number of corners and the number of corners with obstacles, the number of corners of the improved algorithm is far smaller than that of other algorithms, which shows that the improved algorithm has better smoothness.Although the improved algorithm has some losses in convergence speed, but the decrease in convergence speed is allowed on the premise that the optimal solution can be found.
Figure (a) is an improved algorithm without adding a smoothing factor, and Fig.(b) is an improved algorithm with adding a smoothing factor.Table

Fig. 10
Fig. 10 Path planning Table 5. Algorithm resulting data Figure (a) is an improved algorithm without adding a smoothing factor, and Fig.(b) is an improved algorithm with adding a smoothing factor.Table

Figures
Figures

Figure 3 When
Figure 3

Figure 5 Path
Figure 5

Figure 10 Path
Figure 10

Figure 11 Path
Figure 11

Table 1 .
Length data for different turns

Table 2 .
Experimental data in simple environment

Table 3 .
Experimental data in medium environment

Table 4 .
Experimental data in complex environment

Table 5 .
Algorithm resulting data

Table 6 .
Algorithm resulting data