## 3 System Model and Problem Description
### Joint Optimization Algorithm Design
The more time slots there are, the more trajectory points (position, velocity, direction, etc.) need to be optimized, resulting in linear or even polynomial growth in the dimensions of decision variables. For heuristic algorithms such as GA, WOA, ACO, and APO, the size of the solution space exponentially increases with the variable dimension. For example, GA (genetic algorithm): The cost of population evolution is high: as time slots increase, individual encoding lengths become longer, and the time required for crossover and mutation operations increases. The WOA relies on random concatenation and spiral update mechanisms. As the number of time slots increases, adjusting parameters (such as search radius) becomes more difficult and the convergence speed slows down. ACO needs to gradually construct the trajectory for each time slot, and increasing the number of time slots directly extends the iteration time. In this paper, APO utilizes problem decomposability to maintain a low time complexity. ### Performance Analysis

To verify the energy efficiency advantages of the joint optimization strategy with maximized energy efficiency (OPMEE) for the UAV flight trajectory and user device task

Figure 5: Running times for different trajectory optimization algorithms. offloading rate strategy proposed in this paper, several different offloading strategies were compared. 1. Optimal Service Order and Flight Speed (OSOFS) [10]: A two-stage optimization algorithm is proposed to minimize the energy consumption of a single UAV-assisted MEC system during each flight. 2. Binary Offloading with Single UAV MEC (BOSU) [33]: A single UAV-assisted MEC is used to provide computing resources, where all user tasks are either executed on the user device or offloaded to the UAV MEC for execution, and the UAV flies according to the designed UAV trajectory. 3. Partial Offloading with Single UAV MEC (POSU) [34]: The user's task can be divided into two parts, using the user device and UAV-assisted MEC to complete the computation with a given UAV trajectory. As shown in Figure 6, the energy consumption of the UAV-assisted MEC system changes with the enhancement of UAV performance. Among them, the BOSU and POSU schemes have higher energy consumption, while the OSOFS and OPMEE schemes have lower energy consumption. With the enhancement of UAV-assisted MEC system performance, the energy consumption reduction of the OPMEE scheme proposed in this paper is more significant. The performance of UAV-assisted MEC systems can affect the trajectory and hovering time of UAVs, thereby affecting the total energy consumption, by affecting the computation delay of tasks. In BOSU and POSU schemes, due to the lack of trajectory optimization capability, UAVs have more wasteful trajectories, thereby increasing energy consumption. In addition, due to their excellent trajectory optimization capabilities and the ability to partition time slots and tasks more finely, the OSOFS and OPMEE schemes make more efficient use of edge network resources, resulting in lower energy consumption. Figure 7 shows the trend of task offloading ratio as task complexity increases. The offloading ratio of the four task offloading schemes increases with the increase in task complexity, but the offloading ratio of BOSU and POSU schemes is significantly lower than that of OSOFS and OPMEE schemes. Therefore, whether the scheme has trajectory optimization is very important. When the complexity of tasks increases, in order to reduce energy consumption, user devices tend to migrate more tasks to UAV-assisted MEC. In the OSOFS and OPMEE schemes, UAV-assisted MEC performs task offloading and computation along optimized trajectories, thus increasing the task offloading ratio. The task offloading cost in BOSU and POSU schemes is relatively high, so the offloading ratio is lower than that in OSOFS and OPMEE schemes. Note that when task complexity increases 6, the offloading rate of OSOFS is bigger than OPMEE.