Abstract

In response to the issue of the traditional ant colony algorithm (T-ACO) with many iterations and slow convergence speed in robot global path planning, we propose an enhanced ant colony algorithm (S-IACO) that incorporates Gaussian sampling. Firstly, the initial pheromone concentration contained in the raster map is preprocessed. Gaussian distribution sampling is adopted, and the sampling median value is used as the initial pheromone concentration of the raster map. Secondly, the heuristic function of the ant colony algorithm was improved. The number of ant colony iterations and the current path length were dynamically introduced into the heuristic function of the algorithm as influencing factors. Finally, this work redefined the pheromone update rule and introduced the concept of loss function by considering the influence of initialization pheromone on the results. By comparing with other improved ant colony algorithms, as well as PSO and GA algorithms, the S-IACO algorithm proposed has fewer iterations and faster convergence speed.

1. Introduction

The rapid growth of the robot industry and the continual emergence of new opportunities have created a market filled with unprecedented potential. As we know, artificial intelligence equipment such as unmanned scientific research vehicles and drones have been widely used in many fields, such as industry and medical treatment. Path planning exists in the abovementioned smart devices; therefore, the path planning of robots is undoubtedly a work of great significance. Specifically, robot path planning focuses on designing a collision-free and low-cost shortest path from the start point to the end point to achieve efficient obstacle avoidance and low cost for the robot. Algorithms commonly used in path planning include Dijkstra algorithm [1], Floyd algorithm [2], and A algorithm [3], but they are all traditional search methods and have disadvantages such as low efficiency. With the deepening of research, intelligent algorithms with high efficiency such as genetic algorithm [4], simulated annealing method [5], neural network algorithm [6], and ant colony optimization algorithm (ACO) are developing rapidly.

As T-ACO suffers from slow convergence and a tendency to fall into local optimal, many scholars have proposed improved methods. Chen et al. [7] addressed the algorithm deadlock problem by introducing jump point search rules to improve the algorithm iteration speed. Jiao et al. [8] adopted adaptive state transition strategy and pheromone update strategy to solve these problems and applied them to smart wheels. Chen et al. [9] applied ACO to path planning of batteries and verified the good performance of the model. Li et al. [10] improved the algorithm to achieve automatic detection and path planning, reducing the detection energy consumption of the system. He et al. [11] designed variable domain search factors to compensate for the lack of early information. Liu et al. [12] used local optimization over pheromone diffusion to make the ant search range smaller. Yang et al. [13] introduced heuristic function into pheromone update strategy, enabling the algorithm to effectively avoid obstacles dynamically. Xu et al. [14] used K-means with crossover to implement map partitioning and avoid premature convergence of the algorithm. Xia et al. [15] designed the quantum ant colony algorithm and applied it to the USV. Zhao et al. [16] focused on pheromone updating and superposition, proposing a nonuniformly distributed pheromone concentration algorithm (OMV-ACO) that avoids searching for duplicate paths. Tao et al. [17] proposed the IACO algorithm by introducing initialization pheromone in the heuristic function, which achieved fast convergence. Gong et al. [18] proposed a high-quality obstacle avoidance strategy to diminish the blindness of the presearch. Xue et al. [19] used multistep search to improve the pheromone update strategy. Chen and Liu [20] introduced a potential field function and designed a global search model to be applied to search for high-quality paths. Chen et al. [21] modified the algorithm visibility and pheromone increments for path planning. Li et al. [22] used Gaussian wave to find the optimal path, and the improved algorithm has better obstacle avoidance ability. Qi et al. [23] introduced a dynamic adjustment factor to improve the state transfer function and solved the problem of slow convergence of the algorithm. Zhang et al. [24] proposed a multiobjective planning algorithm for particle swarm optimization, considered the degree of risk and path distance, and modeled the problem as a constrained biobjective problem with uncertainty coefficients. Geng et al. [25] used a heuristic particle swarm optimization (PSO) algorithm for multiple survivor rescue robot path planning in finite survival time and proposed an integer PSO algorithm to solve the problem, which enables fast local search to improve its efficiency. All of the abovementioned methods are based on the T-ACO with improvements to the state transfer function, heuristic function, and pheromone update strategy. Among them, the initial pheromone concentration treatment is more common but does not consider the randomness of ant movement.

The main contribution of this work was to propose an enhanced ant colony algorithm (S-IACO). It introduced a Gaussian distribution for initialized pheromone concentrations and used the sampled values as map-initialized pheromones. Also, the path length and the number of iterations were introduced as influencing factors of the heuristic function, making the algorithm more directional in the early stages of the search. More importantly, the loss function was introduced for compensating the movement states of the ants between different concentration grids, which greatly improved the algorithm’s merit-seeking ability.

2. T-ACO and Environmental Model

2.1. Ant Colony Algorithm Idea

The T-ACO was inspired by an interesting natural phenomenon. Ants in nature release and sense chemicals called pheromones as they search for food. On the initial path, the ant will blindly search for the path due to the low pheromone concentration. As pheromone concentrations increase along shorter paths, ants can sense and arrive at the path with the higher pheromone concentration to form a positive feedback mechanism. After feedback from multiple generations of ants, the shortest path has the highest pheromone concentration, which increases the probability of ants choosing this path and realizes the optimal solution of the shortest path quickly.

2.2. Mathematical Model of Ant Colony Algorithm
2.2.1. Probabilistic Selection Function

The ants will select the next node according to the pheromone concentration, and the node with a larger pheromone concentration is easier to be selected by ants. In addition, the ant’s choice of path also affects the pheromone concentration at that node. The rules for ant selection of nodes are shown as follows:where is the probabilistic selection function of the ant between nodes and , represents the concentration of pheromones left by ants from node to node , and represents the heuristic function for ants, usually taking the reciprocal of the Euclidean distance between node and node . is the pheromone heuristic factor, which means how important the concentration here is to the next node; is the expectation heuristic, which means the degree of influence of the distance between the current node and the next node. indicates the number of next nodes that the ant can select.

2.2.2. Pheromone Update Rules

Nodes that the ant traverses are included in the taboos list. This node will not be reselected by the ant. Therefore, when the ant completes the iteration, the nodes in the taboo table form a path feasible solution. When selecting each node, the algorithm updates the pheromone concentration of the previous path so that subsequent ants can better choose, so the pheromone update strategy is introduced, and the rules are as follows:where is the pheromone concentration at the node, while is the pheromone concentration volatilization factor, the value in the example is is the pheromone concentration of the previous node, and is the total pheromone of the path traveled.

2.2.3. Environmental Model

In a 2D environment, the robot path planning is often modeled using the raster method. The raster method divides an environment map proportionally into squares with one unit. As shown in Figure 1, the “0” in the grid map represents the ant’s alternative path; “1” represents obstacles in the grid map. The starting node and end node are marked as “Start S” and “End E”, respectively.

3. Improved Ant Colony Algorithm

3.1. Initialization Pheromone Concentration Improvements

In T-ACO, a uniform concentration of pheromones is assigned in the raster; it causes the ants to find the optimal path without direction, resulting in a slow search for the optimal path. Raster with high concentrations of pheromones is more likely to form optimal paths. T-ACO uniformly distributes the initial pheromone concentration so that the ants have the same probability of selection in all directions. Such path selection has strong randomness, which leads to the point that the ant may not find the optimal path or fall into the local optimal dilemma. To reduce the blindness of the T-ACO in early search and acceleration search speed, the initial pheromone concentration was modeled by the Gaussian distribution method. The grid region is divided and sampled using Gaussian distribution, and the sampled value is taken as the initial pheromone concentration of the region. This reduces the blindness of the algorithm in the early stage of the search and enables the algorithm to find the optimal path faster. Since the most optimal paths are located on either side of the start and end lines, the concentration of pheromones near the connection should be higher than that in other regions. As shown in Figure 2, the starting and ending line segments are the diameters of the circle. The circular region was assigned an uneven initial pheromone concentration. The assignment rule is based on equation (4), where is the initial pheromone concentration, is the current assignment level, and is the regional mean. The assignment rule satisfies the Gaussian distribution, as shown in Figure 3. Gaussian sampling was performed in the direction of vertical bisectors along the starting and ending lines, and then the median of the sampled values was taken as the initial pheromone concentration in the region. According to numerous studies, it is more universal and adaptive when the initialization pheromone value is 8, so the maximum initialization pheromone concentration is set to 8. The unevenly layered initialization pheromones make ants more directional and purposeful in the early stage of optimization.

3.2. Improved Heuristics Function

In T-ACO, the reciprocal of the Euclidean distance between the node and the candidate node is usually used as the heuristic function, but it considers the actual cost between two points, and the robot path planning is affected by local factors. S-IACO considers the impact of global factors on robot path planning and introduces the number of iterations and path length as influencing factors into the heuristic function. The improved heuristic function can be expressed aswhere is the dynamic update factor, is the maximum number of iterations for the ant; N is the number of current iterations; is the distance from the node to the target node; and is the Euclidean distance from the node to be selected to the target node. From formula (5), it can be known that the heuristic function is affected by the heuristic factor and the number of algorithm iterations and the current path length , while the heuristic function is sensitive to the heuristic factor. In the initial stage of the algorithm looking for the optimal path, the sum is small, and the algorithm is greatly influenced by the heuristic function; in the middle and later stages of the algorithm, when the sum is close to the maximum value, the influence of the heuristic function on the algorithm is minimized. As the end approaches, the pheromone concentration along the path becomes the dominant factor in finding the best path.

3.3. Improved Pheromone Update Policy

In T-ACO, all maps share the same initial pheromone concentration, and the ants operate blindly during the initial search phase. Although initializing pheromones was unevenly distributed in OMV-ACO and IACO, ants had multiple motion states. When the ant enters the high concentration area from the low concentration area, it can be considered that the ant is looking for the nearest path to the destination. On the contrary, if the ant enters from a high concentration to a low concentration, it is considered that the ant deviates from the optimal path, which will increase the number of algorithm iterations and increase the probability of the ant failing to find the optimal path. Therefore, S-IACO redefines pheromone renewal strategy and proposes the concept of loss function . When the ants moved from the high concentration area to the low concentration area, the loss function had a negative feedback effect, and the pheromone concentration increment on the new path was small. When the ants move from the low concentration area to the high concentration area, the loss function will produce a positive feedback effect, and the pheromone increment on the new path is larger. The improved pheromone update strategy is shown in formulas (6)–(9).

In equation (6) and (7), is a constant, which usually takes the value 1; is the length of the current path of the ant; is the average of all ant path lengths. When , it indicates that the current path deviates from the shortest path, at which point the pheromone increment of the node is weakened. At this time, the value is negative and the pheromone concentration decreases. When , is positive. At this time, the pheromone increased, where indicates the impact on pheromones when ants cross regions, and if ants cross regions from low level to high levels, this part is positive, which will promote the continued optimization of ants in this area; if the ant moves from the upper subregion to the lower level, it is considered that the ant’s optimization path has shifted, and this part will be negative, weakening the pheromone concentration in the current path direction. is the loss value of pheromone concentration between two adjacent nodes, if the pheromone concentration of the current node is higher than that of the previous node, and it can be considered that the ant is looking in the right direction. If it is lower than the previous node, the pheromone increment of that node is reduced. The improved algorithm enhances the directionality of ant optimization, so that ant population will find the optimal solution faster with a lower number of iterations.

3.4. Steps to Improve the Ant Colony Algorithm

The flowchart of the improved ant colony algorithm is shown in Figure 4.

The pseudocode is shown in Table 1.

4. Simulation Experiments

4.1. Sensitivity Analysis and Ablation Experiments

Since S-IACO performs Gaussian sampling and assignment on the initialization pheromone, the sampling rule introduces the parameter . At the same time, the heuristic function is also improved by introducing a heuristic factor, and the algorithm is easily affected by the two. In order to explore the influence of and , this work uses the control variable method to analyze the sensitivity. In the 30 × 30 map environment (Figure 5(a)), the fixed value is 0.5, to explore the influence of on the algorithm; in the 30 × 30 map environment (Figure 5(a)), the fixed value is 1, to explore the influence of on the algorithm. The experimental results are shown in Figure 6.

By conducting sensitivity analysis, the algorithm demonstrates rapid convergence when the value is set to 1 and remains fixed. When is fixed, the algorithm can converge quickly when the value is 0.5. Based on the abovementioned analysis, this work designs an ablation experiment to verify the correctness of the abovementioned conclusions. Similarly, the control variable method is adopted. Experiments were carried out in 20 × 20 environment map (Figure 6(a)) and 30 × 30 environment map (Figure 7(a)), respectively, and the average of ten successful experiment results was taken as the conclusion. The experimental conclusions are shown in Tables 25.

As shown in Tables 35, the different values of and will have a certain impact on the performance of the algorithm proposed, which may increase the probability of algorithm failure. However, if reasonable values are taken for and , the performance of the algorithm is better than that of other comparative algorithms.

4.2. Experimental Results and Analysis

In order to verify that the improved algorithm has a faster search speed and smaller iteration time than other algorithms, this work conducts a control experiment on the algorithm before and after simulation in MATLAB2018a software. The experiment uses a computer configuration of Intel (R) Core (TM) i5-12500 dual-core CPU, 3.10 GHz, and a memory of 16 GB. The 20 × 20 and 30 × 30 size grid diagrams were established for experimental verification.

In this research, the values of each parameter were set as follows: number of ants K = 50, maximum number of iterations, , pheromone heuristic factor , expectation heuristic ,  = 0.5, and  = 2.The T-ACO, OMV-ACO, and IACO were selected as control experiments. Based on OMV-ACO and IACO, the initial pheromone concentration, heuristic function, and adaptive volatile factor are improved and compared. Ten independent repeated experiments were performed on the proposed algorithm, the traditional algorithm, the OMV-ACO algorithm, and the IACO algorithm, respectively. The average path length and the average number of iterations of 10 experiments were calculated, respectively, and used as evaluation criteria of the algorithm.

OMV-ACO shares similarities with this study in terms of initial pheromone settings. Both methods employ an uneven distribution of initial pheromone concentrations by connecting the line segments between the start and end points of the environment and aligning them with the direction of the segments. However, in OMV-ACO, the effect of initialization information on finding the optimal path is not obvious at the later stage of search. Both this work and IACO consider the influence of the initial pheromone on finding the optimal path and introduce it into the heuristic function. However, the difference and novelty of this work lie in introducing path length and iteration number into heuristic function and redefining pheromone updating rule. OMV-ACO and IACO focus only on the effects of initializing pheromones on ant early search and heuristic functions. However, they ignored the effect of the uneven distribution of initial pheromones on the selection of the next node as the ants crossed over different concentrations. In this case, the ant will deviate from the optimal path and finally found that it is not the optimal path or even the algorithm cannot find the optimal path. In this work, the path length and the number of iterations are introduced into the heuristic function, and the loss function is introduced into the pheromone updating strategy considering the ant traversing different regions. The T-ACO, the algorithm in OMV-ACO, the algorithm in IACO, and S-IACO are verified and compared under different environments. Finally, we choose PSO, GA algorithm, and S-IACO algorithm for comparative experiments. The results show that the performance of this work is better. The simulation results are shown in Figures 68 and Tables 6 and 7.

As shown in Figures 7(a)7(f), all four algorithms will find the optimal path in the 20 × 20 environment map. In the environment of Figure 7(a), the number of iterations in OMV-ACO is about 23, the number of iterations in IACO is about 30; and the number of iterations of the S-IACO is about 13. Compared with OMV-ACO and IACO, the simulation time was shortened by 4.98 s and 5.55 s, respectively. In the environment of Figure 7(a), the number of iterations of OMV-ACO is about 26, that of IACO is about 19, and that of the S-IACO is about 11. Compared with OMV-ACO and IACO, the simulation time was shortened by 5.28 s and 4.48 s, respectively. Similarly, in Figure 5(a), the iteration times of the S-ICAO are reduced by 7 generations and 2 generations, respectively, compared with OMV-ACO and IACO. Simulation time is reduced by 1.16 s and 0.43 s, respectively. In the 20 × 20 environment, the experimental results of the proposed algorithm are superior to other algorithms.

Figures 5(a)5(f) show the different performances of the four algorithms in a 30 × 30 environment. In this environment, the T-ACO convergence speed is slow, cannot find the optimal path, and finally leads to the failure to find the optimal path. The algorithm in OMV-ACO found the optimal path with length of 51.93 m after 44 iterations. The algorithm in IACO found the optimal path with length of 49.36 m after 51 iterations. After 34 iterations, this work algorithm finds an optimal path with a length of 49.36 m. The results show that initializing pheromone with uneven distribution has a great influence on the ant’s search for the optimal path. If the ant moves from the region of high pheromone concentration to the region of low pheromone concentration, the ant will deviate from the optimal path, if not the shortest path. As shown in Figure 5(b), in another 30 × 30 environment, the improved algorithm in this work presents more prominent advantages. In this environment, OMV-ACO, IACO, and S-ICAO can find the optimal path, respectively, but the optimal path found in this work has the shortest length, the least number of iterations, and the shortest time. In Figure 5(c), OMV-ACO IACO and S-IACO can find the optimal path, but the iteration times of the improved algorithm in this work are reduced by 7 generations compared with IACO, and the simulation time is reduced by 1.88 s. Through the abovementioned experimental results and analysis, the improved algorithm has better performance.

As shown in Figures 8(a)8(f), in the 30 × 30 environment, we select PSO, GA algorithm, and S-IACO algorithm for comparison. In the 30 × 30 environment, PSO, GA, and S-IACO can all complete iterations, but the paths found by PSO and GA algorithms are not optimal. At the same time, due to the high complexity of the GA algorithm and the large number of iterations, the performance of the GA algorithm is not obvious enough within a limited number of iterations. The PSO algorithm is an evolutionary algorithm that imitates the behavior of animal flocks. It is similar to the ant colony algorithm, but because of its large randomness, the algorithm cannot guarantee to converge to the global optimum. Through the abovementioned comparison, it can be found that the performance of S-IACO is better than that of PSO and GA algorithms.

The uneven distribution of initialization pheromones imparts directionality to the ants during the early search phase, resulting in accelerated convergence speed of the algorithm. The influence of iteration times and path length was considered in the heuristic function, and the pheromone concentration updating strategy was redefined, and the loss function was introduced. The proposed loss function reduces the probability of ants deviating from the high concentration area. In the early and late stages of the algorithm, the interaction between the heuristic function and pheromone updating strategy improves the convergence speed and reduces the number of iterations.

4.3. Experimental Statistical Tests

We propose a robot global path planning method based on the ant colony algorithm. However, the ant colony algorithm is an evolutionary algorithm, and the results of each experiment are random. In order to verify the reliability of the proposed algorithm, this work conducts a statistical test on the experimental results. Since the four algorithms can find the optimal path in the 20 × 20 map, no statistical tests are performed here for the 20 × 20 map environment. In the 30 × 30 environment, the performance of each algorithm shows a large difference. The 30 × 30 environment map is statistically tested, and the results of 10 successful experiments with the four algorithms are statistically analyzed in Tables 813.

5. Conclusion

This study employs Gaussian sampling to preprocess the initial pheromone concentration and incorporates the iteration number and path length into the heuristic function. Finally, the pheromone renewal strategy was redefined, and the concept of loss function was introduced according to the different motion states of ants. The reliability of the algorithm is verified by simulation experiments. The improved algorithm can effectively solve the blindness of early search and reduce the number of iterations. The new pheromone updating rules make the ants more directional in late search and reduce the probability of ants falling into local optimization, and the algorithm converges quickly. Although the reliability of the improved algorithm is verified by the simulation experiment, the algorithm still has some shortcomings. When the complexity of the map increases, the algorithm will produce oscillation, which needs further study.

Data Availability

The data used to support the findings of this work are available from the corresponding author upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Authors’ Contributions

Zhangfang Hu is the instructor, supervised the study, and performed funding acquisition. Junhao Zhang is responsible for programming and implementation of the computer code and supporting algorithms, conceptualized the study, performed formal analysis, and wrote the manuscript. Xingyuan Wang validated the study.

Acknowledgments

The authors would like to thank Professor Luo Yuan of the laboratory for her support to this article, Youdao translation, Google translation software, Matlab software simulation work, and MathType tool. We identify the authors of this article as Junhao Zhang, Zhangfang Hu, and Xingyuan Wang. Also, permission has been obtained from someone who has contributed to the manuscript but is not qualified as a partner. This work was supported by the National Natural Science Foundation for Young Scholars of China (Grant nos. 61703067 and 61803058) and the Natural Science Foundation of China (Grant nos. 51775076 and 61801061).

Supplementary Materials

The supplementary materials include the iteration times of T-ACO, OMV-ACO algorithm, IACO algorithm, and the improved algorithm in this work under different environments. (Supplementary Materials)