## 3 System Model and Problem Description
### Joint Optimization Algorithm Design  
(1) Algorithm design  
The energy efficiency maximization algorithm for joint optimization of the UAV flight trajectory and user device task offloading rate proposed in this paper is summarized as follows in Algorithm 1. ``` Input: Initial energy efficiency value \(\gamma^{0}\), initial UAV trajectory \(\left\{c_{(t)}\right\}^{0}\), initial offloading rate \(\{\eta_{u}(t)\}^{0}\), the maximum iteration times for inner and outer layers \(n_{max}\), \(k_{max}\) and convergence threshold \(\epsilon\). Output: The optimal energy efficiency \(\gamma_{CSE}\), the optimal UAV trajectory \(c(t)\) and optimal task offloading rate \(\eta_{u}(t)\). Outer loop (updated energy efficiency \(\gamma\)): Step 1: Fixed energy efficiency \(\gamma=\gamma^{k}\); Inner loop (alternating optimization \(\eta_{u}(t)\) and \(c(t)\)): Step 2: Given the trajectory of the UAV \(\left\{c_{(t)}\right\}^{n}\), solving problem P3 using GA algorithm and update the task offloading rate \(\{\eta_{u}(t)\}^{n+1}\); Step 3: Given the task offloading rate \(\{\eta_{u}(t)\}^{n+1}\), use the APO algorithm to solve problem P4 and update the UAV flight trajectory \(\left\{c_{(t)}\right\}^{n+1}\); Termination condition: If the upper limit of inner iteration times is reached, exit the inner loop. Step 4: Save the current optimal \(\eta_{u}(t)\) and \(c(t)\), and update the energy efficiency \(\gamma^{k+1}\) using Equation (19). Termination condition: If \(||\gamma^{k+1}-\gamma^{k}||\leq\epsilon\) or when the number of iterations in the outer layer reaches \(k_{max}\), exit the outer loop. Complexity analysis

The computational complexity of this algorithm is determined by two layers of iterations: the number iteration of the outer layer is \(k_{max}\), they alternately execute the GA algorithm and APO algorithm each time, and the total number of iterations is \(n_{max}\). The single-run complexity of the GA algorithm is \(O\big{(}T_{ga}*N_{p1}*U*N\big{)}\), and the single-run complexity of the APO algorithm is \(O\big{(}T_{apo}*N_{p2}*3*N\big{)}\), where \(T_{\text{ga}}\) and \(T_{\text{apo}}\) are the number of internal iterations of the GA and APO algorithms. Therefore, the computational complexity of the algorithm can be expressed as \(O\big{(}k_{max}*n_{max}*\big{(}T_{ga}*N_{p1}*U*N+T_{apo}*N_{p2}*3*N\big{)} \big{)}\), ignoring the constant and further simplifying it \(O(k_{max}*n_{max}*(U*N)\,,\) indicating that it mainly depends on the number of user devices \(U\) and the number of time slots \(N\). Convergence analysis

Algorithm 1 belongs to a two-layer alternating optimization framework, and its convergence depends on the following mathematical properties:

Outer loop: Based on the Dinkelbach method, the fractional programming problem is transformed into an iterative subtraction problem. In each iteration, the update of \(\gamma\) strictly monotonically increases, and the objective function has an upper bound. When \(||\gamma^{k+1}-\gamma^{k}||\leq\epsilon\,,\) the \(\epsilon\)- global optimal solution is reached. Inner loop: Alternate optimization of \(\eta_{u}(t)\) and \(c(t)\), where, in problem P3 (genetic algorithm GA), the global search feature of GA ensures that the optimal \(\eta_{u}(t)\) is approximated with a probability of 1 within a finite generation, but it needs to satisfy the elite retention strategy and appropriate mutation rate. In problem P4 (APO algorithm), APO ensures convergence to the local optimal trajectory \(c(t)\) under the constraint set convexity. We set the maximum number of outer iterations to 50, convergence threshold to 0.3, optimal energy efficiency value to 1.3, and initial energy efficiency to 0.5. The results are showed in Figure 2.

We can observe that the sequence of the objective function is non-decreasing after each alternating optimization in (b). When the number of iteration is 17, the energy efficiency of outer iteration is converged and bounded in (a). According to the monotonic bounded theorem, Algorithm 1 must converge.