## 2 Materials and Methods
### Coverage Path Planning
#### 2.3.5 Algorithm Simulation  
Based on the above improvements, the st70 dataset is used for validation. st70 is a dataset in the problem library TSPLIB of TSP and related problems; it contains 70 cities and their coordinate information, with an optimal path distance of 675. We use the dynamic adaptive function genetic algorithm (DF-GA) in this paper to compare and verify the algorithm with traditional genetic algorithm (GA), particle swarm optimization (PSO), ant colony optimization (ACO), and improved Genetic Algorithm (IMP-GA) [37]. Each algorithm was repeated 50 times, recording the convergence algebra and convergence value of each algorithm. The convergence curve is shown in Figure 3. At the same time, the average convergence iteration times, average convergence value and average convergence time of 50 experiments of each algorithm are calculated, and the results are shown in Table 1. Note that here, the DF-GA only includes the improvement of the population initialization and the genetic operators, not improving the fitness function, as the test dataset does not consider the angle information.  
As can be seen from Figure 3, the DF-GA has a better initial population and the convergence value is significantly lower than other algorithms. Combined with Table 1, our algorithm solves an average path of 699.04, which is only 3.44% different from the optimal path of 675. Compared to GA, PSO, ACO, and IMP-GA, path lengths are reduced by 6.14%, 12.30%, 2.77%, and 5.33%, respectively, significantly, and reduce convergence iteration algebra and convergence time. The results show that our Genetic Algorithm can obtain a better path in a shorter time, has fewer iterations, and can effectively avoid falling into local optimization.  
In order to evaluate the performance of the algorithm after adding angle parameters to the adaptation function and dynamically adjusting the weights, we use the algorithm (DF-GA) in this paper, the algorithm in this paper with fixed weight coefficients (SF-GA), and the traditional Genetic Algorithm (GA) without angle parameters to perform path planning for the sampling design above. We performed 30 repeated experiments for each algorithm, the number of iterations was set to 500, and the relevant data in the experiment were recorded, as shown in Table 2.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Algorithm** & **Average Path Length (m)** & \
\begin{tabular}{c} **Average Count of** \\ **Iterations (Count)** \\ \end{tabular} &
\begin{tabular}{c} **Average Convergence** \\ **Time (s)** \\ \end{tabular} \\ \hline GA & 744.73 & 432.25 & 9.13 \\ PSO & 797.09 & 442.61 & 20.61 \\ ACO & 718.98 & 361.50 & 68.34 \\ IAM-GA & 738.39 & 417.93 & 21.00 \\ DF-GA & 699.04 & 248.35 & 4.32 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The performance of different algorithms on the st70 dataset.  
Figure 3: Convergence curve.  
It can be seen from Table 2 that the shortest path can be obtained by all three algorithms, but the dynamic and static algorithm are superior to the traditional genetic algorithm in terms of optimal angle and total average angle, which shows that increasing angle parameters can effectively reduce the number of turns of the path. The dynamic function algorithm is better than the static in terms of total average angle and optimal angle, which shows that dynamic adjustment weight is effective. The traditional function is superior in iteration numbers because it does not consider angle constraints. The dynamic function is still superior to the static function when angle constraint is considered. Figure 4 are the paths planned by the traditional genetic algorithm and dynamic function genetic algorithm, respectively. The angle of (a) is 114.14 and that of (b) is 92.15. It can also be seen from the figure that path (b) consists of more straight sections with fewer turns than (a).