## 3 System Model and Problem Description
### Joint Optimization Algorithm Design
## 5 Experimental Results and Analysis

Consider a simulation network environment of UAV-assisted MEC, including a single UAV and \(U\) randomly distributed user equipment. The UAV starts from the origin (0,0,0) and returns to the origin after completing a task period. The experiment was conducted in the WIN10 environment based on the MATLAB R2020a platform, with a hardware configuration of an Intel Core i5-12400 processor and 16 GB of memory. Firstly, according to the simulation parameters in Table 1 (the settings of these parameters are from the relevant literature), variables were defined in the MATLAB script and the environment was

Figure 2: The algorithm 1 convergence performance. initialized, including the random distribution of obstacles and user devices, channel models, and configuration of computing tasks. Then, the core module of the HAMEO algorithm in this paper is programmed and compared with the current mainstream algorithms in terms of performance. Finally, the MATLAB Graphics toolbox is used to visualize the experimental data. ### UAV Trajectory Analysis

By conducting comparative experiments with different flight time slots, the \(U=30\) motion of the UAV in 3D space (Figure 3) and its 2D projection (Figure 4) were plotted for the number of user devices. \begin{table}
\begin{tabular}{c c c} \hline
**Parameter** & **Description** & **Value** \\ \hline \(D\) & Range & 1000 m \(\times\) 1000 m \(\times\) 50 m \\ \(T_{f}\) & Period duration & 70 s \\ \(N\) & Number of time slots & 40 \\ \(\beta_{0}\) & Average channel gain at 1 m & \(-\)50 dB \\ \(\sigma^{2}\) & Noise & \(-\)100 dBm \\ \(\Gamma\) & Signal-to-noise ratio difference & 8.2 dB \\ \(\alpha\) & Path loss parameter & 2 \\ \(B_{u}(t)\) & Bandwidth & 1 MHz \\ \(p_{u}(t)\) & Device transmission power & 30 dBm \\ \(l_{u}(t)\) & Amount of data offloading by the device & [1, 10] Mbit \\ \(C_{u}\) & CPU cycle required for unit bit data & \(10^{3}\) cycles/bit \\ \(M\) & UAV payload & 5 kg \\ \(v_{max}\) & Maximum speed of UAV & 20 m/s \\ \(a_{max}\) & Maximum acceleration of UAV & 5 m/s\({}^{2}\) \\ \(f\) & UAV computing capability & 1 GHz \\ \(\psi\) & UAV capacitance coefficient & \(10^{-27}\) \\ \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters. Figure 4: Two-dimensional projection of UAV trajectories at different flight time slots. Figure 3: Three-dimensional trajectory maps of UAV with different flight time slots. The experimental results show that the algorithm proposed in this paper can effectively achieve 3D obstacle avoidance. The UAV can avoid obstacles by circling or crossing during flight, and the trajectory does not overlap with the obstacles. Combining 2D trajectory analysis provides a more intuitive display. As the number of time slots increases, the spatial matching degree between the UAV trajectory and the user device position further improves, allowing it to move closer to the user side and effectively improving the quality of communication services. To verify the performance advantage of the APO algorithm in solving problem P4, we compare it with three UAV trajectory planning algorithms: the GA [30], Ant Colony Optimization (ACO) [31], and Whale Optimization Algorithm (WOA) [32]. Figure 5 shows the running time required for each algorithm to achieve a stable UAV trajectory for the first time at different time slots. When the number of time slots was small, there was not much difference in the time consumption of each algorithm. As the number of slots increased, the time consumption of the GA and WOA increased rapidly, while the ACO algorithm grew slowly, and the overall time consumption of the APO algorithm remained relatively low. It needs further explanation that as the number of time slots increases, the reason for the increase in the running time of each algorithm is mainly related to the expansion of the problem scale and the search mechanism of the algorithm itself. The number of time slots directly determines the number of discrete time steps in drone trajectory planning.