## 4 Methodology  
### Simplification  
The solution to a fractional programming problem is challenging. We first utilize the Dinkelbach approach to transform the original problem into an integral programming problem to solve the fractional programming problem. Assuming that \(\eta^{*}\) is the best possible computational efficiency, the following conditions are both sufficient and necessary for the best possible outcome:  
\[max\{R(\mathrm{s}(n),\mathrm{q}(n))-\eta^{*}E(\mathrm{s}(n),\mathrm{q}(n))\}=0 \tag{12}\]  
Therefore, problem \(P\) can be converted into integral problem \(P1\) as follows:  
\[\begin{split} P1:\underset{n,X(n)}{max}R(& s(n),\mathrm{q}(n))-\eta E(\mathrm{s}(n),\mathrm{q}(n))\\ & s.t.C1-C6.\end{split} \tag{13}\]  
where \(\eta\) is a non-negative parameter. We define \(F(\eta)=R(\mathrm{s}(n),\mathrm{q}(n))-\eta E(\mathrm{s}(n),\mathrm{q}(n))\), which is a strictly monotonic decreasing function of \(\eta\). If the optimal computational efficiency \(\eta^{*}\) is given in advance, there is \(F(\eta)\geq 0\) when \(\eta\leq\eta^{*}\), when \(\eta\leq\eta^{*}\), \(F(\eta)<0\).  
To obtain the best computational efficiency, the method first initializes \(\eta\) to a small constant, creates a set of gradually increasing \(\eta\) values according to the feasible solutions \(\mathrm{s}(n),\mathrm{q}(n)\) in several iterations, and then updates the \(\eta\) values. So, \(F(\eta)\) is approximately 0. The best \(\mathrm{s}^{*}(n),\mathrm{q}^{*}(n)\) and \(\eta^{*}\) can be identified after a predetermined number of iterations.  
Although the \(P1\) problem is relatively easy to deal with, due to the interaction between the UAV trajectory and other optimization variables, \(P1\) is still not convex. This problem still cannot be solved directly. Problem \(P1\) is divided into two sub-problems \(SP1\) and \(SP2\) based on the types of coupling variables to further simplify the non-convex problem. The trajectory scheduling of UAVs can be optimized given user associations, and the problem can be expressed as \(SP1\):  
\[\begin{split} SP1:\underset{q(n)}{max}\sum\limits_{n=1}^{N}\sum \limits_{i=1}^{M}s_{i}(n)& W\tau\cdot\log_{2}\Big{(}1+\frac{p_{i}(n) \beta_{0}}{(N_{0}+w_{i}(n)P_{NLOS})(h^{2}+\|q(n)-u_{i}\|^{2})}\Big{)}\\ &\text{s. t. }C1,C3,C4,C6.\end{split} \tag{14}\]  
In relation to the UAV flight path \(q(n)\), the objective function is non-convex, and the \(SP1\) problem is still non-convex. To maximize energy efficiency in the long run and to compensate for Dinkelbach's shortcomings, we used deep reinforcement learning to solve this subproblem.  
The user association in problem \(P1\) is an integer planning process for a given UAV's trajectory.  
\[\begin{split} SP2:\underset{\mathrm{s}(n)}{max}\sum\limits_{n=1} ^{N}\sum\limits_{i=1}^{M}s_{i}(n)& W\tau\log_{2}\Big{(}1+\frac{p_ {i}(n)h_{i}(n)}{N_{0}+w_{i}(n)P_{NLOS}}\Big{)}-\eta\sum\limits_{n=1}^{N}\sum \limits_{i=1}^{M}s_{i}(n)p_{i}(n)\tau\\ &\text{s. t. }C2,C5.\end{split} \tag{15}\]  
Since continuous variables are completely separated, the \(SP2\) problem is a standard integer linear programming problem. To make a quick decision to solve the user association problem, we introduce priority function \(\psi_{i}(n)\) and balance factor \(\Theta=\frac{\alpha}{M+\varsigma_{i}(n)}\) to achieve offloading fairness.  
\[\psi_{i}(n)=\frac{\big{\{}(1-s_{i}(n))R_{i}^{\prime}(n)+s_{i}(n)R_{i}^{c})\big{\}} }{\big{\{}\kappa f_{i}^{3}(n)+s_{i}(n)p_{i}(n)+P_{c}\big{\}}\tau}\Theta \tag{16}\]\(\varsigma_{i}(n)\) represents the total number of times that have been offloaded before time \(n\). The larger the \(\varsigma_{i}(n)\), the smaller the \(\Theta\), the smaller the priority of the user. \(\alpha\) is a coefficient.