# The Improved A* Algorithm for Quadrotor UAVs under Forest Obstacle Avoidance Path Planning
## 3 Results
### Performance Simulation Experiment Results  
This study employed Matlab to build four simulation environments to test the performance of the improved A* algorithm proposed in Section 2.2. The evaluation metrics included data processing time, number of traversal nodes, number of turning points, total turning angle, and path length. In Section 3.1, the weight parameter values in the evaluation function of the improved A* algorithm were determined. Based on the simulation experiments, the path planning trajectories of the traditional A* algorithm and the improved A* algorithm in different environments were obtained and are shown in Figure 7. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter \(b\)** & **Path Search Time(s)** & **Number of Nodes Traversed** \\ \hline
1 & 0.714 & 144 \\
1.5 & 0.709 & 144 \\
2 & 0.713 & 142 \\
2.5 & 0.732 & 141 \\
3 & 0.775 & 141 \\ \hline \end{tabular}
\end{table} 
Table 1: Path search time and number of traversed nodes corresponding to different \(b\) values. Figure 6: Relative length of paths with different parameters. Figure 7: Path planning trajectories for different environmental maps and optimization steps. **(a)** Environments 1; **(b)** Environments 2; **(c)** Environments 3; **(d)** Environments 4. Note: In the above four groups of graphs, from left to right, each group shows the path planning effect of traditional A* algorithm, add Optimization 1, add Optimization 1 and Optimization 2, add Optimization 1 and Optimization 2 and Optimization 3. And the green circle represents the starting point and the red star represents the target point. It can be seen from Figure 7 that both the traditional A* algorithm and the optimized A* algorithm can achieve effective obstacle avoidance. Nevertheless, the traditional A* algorithm requires more grid traversals during pathfinding, resulting in longer pathfinding times. After optimization 1, the algorithm became more targeted in its path search, resulting in a substantial reduction in the number of grid searches and data processing time. Optimization 2, built on the foundation of optimization 1, eliminated all redundant turning points, significantly reducing the total number of turning points and total turning angle while still maintaining the necessary turning points for obstacle avoidance. Subsequently, optimization 3 was added to smooth the path using quasi-uniform cubic B-spline curves based on optimizations 1 and 2. The broken lines at the turning points were replaced by smooth curves, resulting in a path with no distinct turning points. The total turning angle was further reduced, and the corresponding path length was also shortened. The performance evaluation index results of the algorithms for different environments and optimization steps are shown in Table 2.  
Further analysis of the data presented in Table 2 reveals that optimization 1 results in a decrease of 64.87% in the average number of traversed nodes and a reduction of 73.77% in the data processing time. On the basis of optimization 1, optimization 2 further reduces the number of newly generated path turns by an average of 32.27%, path length by an average of 8.48%, total turn angle by an average of 50.83%, and data processing time by an average of 50.05%. By adding optimization 3 to the paths generated by optimization 1 and optimization 2, the final performance of the improved A* algorithm is achieved, which demonstrates an average reduction of 64.87% in the number of traversed nodes, an average reduction of 49.64% in data processing time, and a shorter and smoother path with no significant turning point. The average reduction in path length and total turning angle is 12.52% and 54.53%, respectively.