## 3 Description of the Integrated Improved Algorithm
### Igoo-iapf Algorithm Description
#### 3.3.3 Improvements to the APF Algorithm  
Due to the issue of excessive repulsive forces that can prevent the UAV from reaching the target point, improvements have been made to the APF algorithm in the context of path planning. In this regard, the GWO is utilized for multiple iterations to optimize and generate an initial path. The initial path is then assigned an attractive force, which is strongest at the point closest to the current position of the UAV. This approach enhances the attractive force and mitigates the problem of excessive repulsive forces. The attractive force along the path can be defined as follows:  
\[U_{att2}(X)=\frac{1}{2}K_{\_line}(x-x_{p})^{2} \tag{38}\]  
\[F_{att2}(X)=-grad[K_{\_line}]=-K_{\_line}(x-x_{p}) \tag{39}\]  
In the equation, where \(K_{\_line}\) represents the path attraction gain coefficient, and \(x_{\_}G\) denotes the position of the point on the initial path closest to the current position of the UAV. After calculating the line attraction force obtained by the UAV, the line attraction force is incorporated into the total force experienced by the UAV, resulting in a new formula for the total force:  
\[F_{\_}{all}=F_{att1}+F_{att2}+\sum_{i=1}^{n}F_{\_}{rep\_}i \tag{40}\]  
Guided by the direction of the total force, the UAV navigates towards the target point. When approaching obstacles, the UAV experiences repulsive forces from the obstacles, leading to avoidance behavior. Due to the continuous proximity and distancing of obstacles during the UAV's flight, the influence distance of obstacles has a significant impact on the range and magnitude of the force field experienced by the UAV. Figures 4-6 illustrate the comparison of various parameters of the IAPF influenced by obstacles. In conducting algorithmic simulation experiments, the flexibility to adaptively adjust the gain coefficients based on the experimental environment is crucial to avoid the algorithm becoming trapped in local optima. 3.3.4. The Steps of IGWO-APF Fusion Algorithm  
Based on the content presented in Sections 2.1-2.3, the algorithmic flowchart of the proposed method is illustrated in Figure 7. The detailed description of the fusion algorithm is as follows:  
Figure 5: Diagram of the impact of obstacles on the attraction of airlines. Figure 6: Diagram of the impact of obstacles on the total force field. Step 1: Compute the influence distance \(p_{o}\) between the UAV and obstacles to determine if the UAV is located within a relatively free space away from obstacles. This is important because in practical planning scenarios, it is common to encounter situations where the UAV is far from obstacles. Based on the fast planning capability of the IAPF algorithm, the distance _dis_ between the UAV and obstacles is calculated. If \(dis>p_{o}\), the IAPF is directly chosen for path planning to reduce the planning time. If \(dis<p_{o}\), the IGWO is used for initial path planning of the UAV. Step 2: Perform population initialization for the GWO algorithm. Generate the first generation of wolves using a random distribution following a normal distribution, and conduct collision detection (flag judgment). If flag = 0, it indicates that the path does not intersect with any obstacles, signifying that this path can be selected. If flag = 1, it implies that the path intersects with obstacles, thus increasing the fitness value. Finally, update the global best solution. Step 3: Generate path points for all grey wolves based on the given formula. Calculate the cost values for all grey wolves, and identify the three wolves with the lowest costs as the \(\alpha,\beta,\delta\) wolves. Update the convergence factor using the formula, and then calculate A using another formula. Step 4: Determine if t is greater than T. If t is less than T, increment t by 1 and return to Step 2. Otherwise, the algorithm iteration concludes, and the global optimal value and the optimal path are outputted as the results of the algorithm.