## 4 ACO Algorithm Path Planning and Improvement
### Improved Transfer Probability  
When the distribution of multiple fruit positions on a fruit tree is relatively random, if the picking robot picks randomly and in no order based on the spatial location information of the fruit obtained, a lot of picking time may be wasted, and the picking efficiency may be reduced. Therefore, the spatial locations of multiple fruits on the identified tree will be analyzed and studied, and the picking sequence of multiple clustered crabapplewill be planned to save picking time and improve picking efficiency. In this paper, the improved ACO algorithm was used to plan the picking sequence of multiple targets on the crabapple tree.  
The analysis of the traditional ACO algorithm reveals that the pheromone factor \(\alpha\) and the heuristic function factor \(\beta\) in its transition probability function are constants [17]. However, research has shown that when \(\alpha\) and \(\beta\) are set to be too large or too small, the ACO algorithm may exhibit a decrease in search efficiency, leading to the generation of local optimal solutions or an increased search randomness that hinders the discovery of the optimal solution. Therefore, this paper adopts a dynamic heuristic function factor \(\beta\) and pheromone factor \(\alpha\), allowing them to change with the number of iterations (the dynamic heuristic function factor \(\beta\) is a key parameter used to regulate the degree of influence of heuristic information on ant decision-making. Unlike traditional fixed \(\beta\) values, dynamic \(\beta\) can adaptively adjust based on algorithm runtime, search status, or environmental changes, thus balancing the exploration and development capabilities of the algorithm). After analyzing the ACO algorithm, it is found that during the initial phase of the iteration loop, \(\beta\) plays a significant role in path search, and thus, \(\beta\) should be set to a larger value while \(\alpha\) should be set to a smaller value. As the number of iterations increases, the concentration of pheromones on relatively shorter paths in global path planning is higher. At this point, the concentration of pheromones takes the lead in the path search, and to better find the optimal path and accelerate convergence, the value of \(\alpha\) should be increased while the value of \(\beta\) should be decreased. However, as the iteration progresses toward the end, the concentration of pheromones on relatively shorter paths is significantly higher than on other paths. To avoid premature convergence, the impact of pheromone concentration on path selection should be reduced, which means decreasing the value of \(\alpha\) and increasing the value of \(\beta\). This adjustment will facilitate the search for the global optimal route. The improved \(\alpha\) and \(\beta\) are as follows:  
\[\alpha(N)=A\sin(\frac{N\pi}{N_{\max}})+C \tag{5}\]  
\[\beta(N)=B\cos(\frac{2N\pi}{N_{\max}})+D \tag{6}\]  
In the formula, \(N\) is the current iteration number, \(N_{\max}\) is the maximum iteration number, and \(A\), \(B\), \(C\), and \(D\) are constants.  
The improved transfer probability is the following:  
\[p_{ij}^{k}(t)=\left\{\begin{array}{cc}\frac{\left[\tau_{ij}(t)\right]^{A(N)} \left[\tau_{ij}(t)\right]^{\beta(N)}}{\sum\limits_{s\in\text{end}_{k}}\left[ \tau_{ss}^{a(N)}(t)\right]\left[\tau_{ss}^{b(N)}(t)\right]},&j\in\text{{wed}}_{ k}\\ 0&,&\text{otherwise}\end{array}\right. \tag{7}\]  
In the formula  
\(\tau_{ij}(t)\) represents the pheromone concentration at the persimmon picking point \(i\) to picking point \(j\), \(\eta_{ij}(t)\) is the heuristic function,  
\(\eta_{ij}=1/D_{ij}\) is the desired degree of Ant \(k\) from the crabapple picking point \(i\) to the picking point \(j\),  
\(D_{ij}\) is the Euclidean distance from picking point \(i\) to picking point \(j\), and \(\text{{wed}}_{k}\) is an ant \(k\) that has not been collected at the picking point.