## 4 ACO Algorithm Path Planning and Improvement
### Optimized Pheromone Concentration Updates  
In the process of path planning, the update of pheromones is a crucial task that affects the global search ability of the path, in which the volatile factor \(\rho\) is one of the key factors affecting the concentration of pheromones on the path [18]; when \(\rho\) is too small, the ethereal volatilization of pheromones on the path is slow, resulting in the accumulation of pheromones on the path, causing the algorithm to converge prematurely and fall into the local optimum. When \(\rho\) is too large, the pheromone volatilization on the path is faster, and the search randomness and global search are enhanced, but the convergence time is longer. Therefore, in this paper, the adaptive volatilization factor \(\rho\) is introduced to optimize the update of pheromones, and, at the beginning of the algorithm iteration, \(\rho\) takes a larger value to expand the randomness and globality of the search. In the later stage of algorithm iteration, \(\rho\) takes a smaller value to improve the convergence speed of the algorithm. The improved \(\rho\) can be calculated as follows:  
\[\rho(N)=\cos\biggl{(}\frac{N}{N_{\max}}\biggr{)} \tag{8}\]  
\(\rho(N)\) decreases with the increase in the number of iterations, and the pheromone concentration disappears faster in the previous stage of path planning, and the global search is strong. With the increase in the number of iterations, the path planning tends to be stable, and the convergence speed accelerates. The optimized pheromone update rules are as follows:  
\[\left\{\begin{array}{c}\tau_{ij}(t+1)=(1-\rho(N))\tau_{ij}(t)+\Delta\tau_{ij }(t)\\ \Delta\tau_{ij}(t)=\sum\limits_{k}^{m}\Delta\tau_{ij}^{k}(t)\end{array}\right. \tag{9}\]  
In the formula, \(\Delta\tau_{ij}^{k}(t)\) represents the increment of pheromone from apricot picking point \(i\) to picking point \(j\) by ant \(k\).  
\[\triangle\tau_{ij}^{k}(t)=\left\{\begin{array}{c}\frac{Q}{L_{k}},(Ant\;k\; from\;point\;i\;to\;point\;j)\\ 0,\;otherwise\end{array}\right. \tag{10}\]  
In the formula, Q is a constant, \(L_{k}\) represents the path taken by ant \(k\).  
The specific algorithm flow of the improved ACO algorithm is as follows:  
(1) Initialize the parameters, such as the number of picking points n and the number of ants m. The initial pheromone concentration is \(\tau_{ij}(0)=c\) (c is a constant), the sum of the pheromones left by the ants on the path from picking point i to j at the initial moment is \(\Delta\tau_{ij}(0)=0\), the initial number of iterations is \(N=0\), and the maximum number of iterations is \(N_{\max}\).  
(2) Place m ants randomly at n picking points and add the ant placement points to the taboo table \(ban_{k}\).  
(3) The improved transition probability principle is used for ant \(k\)(\(k\)= 1 to m), ant k moves to the next picking point, and the moved picking point is added to the \(ban_{k}\) until the n picking points are traversed.  
(4) Calculate the path length of each ant \({}^{k}l_{ij}\), (\({}^{k}l_{ij}\) represents the path of the kth ant from picking point \(i\) to picking point \(j\), \(k\) = 1,2,3,..., m).  
(5) Calculate the path length \(L_{\min}=\sum\limits_{z=1}^{n}l_{ij}^{z}\) traveled by ant \(k\) after completing an iterative cycle and update the global shortest path.  
(6) Update the pheromone concentration on the path according to Formulas (4)-(6).  
(7) Prepare to continue the looping again while \(N=N+1\), if \(N>N_{\max}\), the loop ends and outputs the optimal solution. Otherwise, return to Step (2).  
The improved ACO algorithm flowchart is shown in Figure 7, and the pseudocode can be found in Supplementary S1.