## 4 Mutual Learning-Based Trajectory Optimization Algorithm  
To reduce the redundant nodes of the initial trajectory generated by the adaptive ant colony algorithm to further optimize the length and smoothness of the trajectory, a trajectory optimization algorithm based on mutual learning is proposed. Firstly, feature ablation experiments were carried out for each turning point to obtain the safety feature sequence of each turning point. Then, each point learns from other points to gradually eliminate the points that do not affect the trajectory safety to optimize the trajectory length and smoothness. Finally, the shortest sequence of key points affecting trajectory safety is obtained. The proposed algorithm achieved a smooth trajectory and minimized the length of the trajectory. At the same time, the wear of the robot's steering to follow the planned trajectory was reduced. For instance, as shown in Figure 5, the feasible initial trajectory \(L_{old}\): \(S\to N_{1}\rightarrow\ldots\to N_{8}\rightarrow\ldots\to E\) is usually not the best trajectory. After the trajectory optimization algorithm based on mutual learning is optimized once, the trajectory \(L_{1}\) can reach the end point without passing through the \(N_{1}\) point. When the optimization is completed, the final trajectory \(L_{best}\) can even reach the end point directly through the \(N_{8}\) point. Consequently, \(L_{old}\) is optimized to \(L_{best}\): \(S\to N_{8}\to E\), which optimizes the length and smoothness of the initial trajectory. The algorithm is described as follows. The initial trajectory \(L_{old}\), including the starting point \(S\) and the ending point \(E\), can be represented by a set of all turning points \(N=\{S,N_{1},N_{2},\ldots,N_{i},\ldots,N_{n},E\}\), \(i\in[1,n]\), and the coordinates of the point set are represented by Equation (12). \[R=\{(x_{0},y_{0}),(x_{1},y_{1}),(x_{2},y_{2}),\ldots,(x_{i},y_{i}),\ldots,(x_{ n},y_{n}),(x_{n+1},y_{n+1})\} \tag{12}\]  
To learn the collision characteristic of each turning point, it is assumed that there are \(n\) initial individuals \(P_{i}\) represented by the characteristic matrix (13). Then each individual subjected to a characteristic ablation experiment, and the characteristic zero point is set by Equation (14). \[P_{i}=[N_{0},N_{1},N_{2},\ldots,N_{i},\ldots,N_{n},N_{n+1}] \tag{13}\]  
\[N_{i}=\left\{ \begin{array}{ll}0,&N_{i}\text{ {is ablated}}\\ 1,&\text{ {otherwise}}\end{array} \right. \tag{14}\]  
A reward and punishment step are added to determine whether the \(i\)-th individual \(P_{i}\) reaches the target directly from the starting point without collision. The cost function is \(L_{i}(P_{i})\) calculated by Equation (15), \(L_{old}\) is the length of the initial trajectory, and \(L_{i}\) is the trajectory length of the current individual. \[L_{i}(P_{i})= \begin{cases}L_{i},&\text{ {if }}P_{i}\text{ {no collision}}\\ L_{old},&\text{ {otherwise}}\end{cases}  \tag{15}\]  
Figure 5: The initial trajectory and the trajectory optimized by mutual learning. The ultimate goal of the mutual learning trajectory optimization algorithm is to generate an optimized path with fewer turns \(D_{best}\) and a shorter length \(L_{best}\). \[L_{best}\ =\min\{\hat{L}_{1},\hat{L}_{2},\cdots,\hat{L}_{i},\cdots,\hat{L}_{n}\} \tag{19}\]  
\[D_{best}\ =\ \text{length}\ \{P_{best}\ \
eq 0\} \tag{20}\]  
Algorithm 1. The pseudo code for MLTO.