## 4 Problem Solution
### Problem Conversion
\begin{array}{c}\text{PS}:\underset{q}{\max}\sum\limits_{t=1}^{N}\sum \limits_{i=1}^{K}\sum\limits_{i=1}^{K}E_{i}^{rem}(t)(q_{i}(t))s_{i}(t)\\ s.t.C16:\frac{\zeta_{i}C_{i}^{3}(Z_{i}(t)-q_{i}(t))^{3}}{T^{2}}+((\eta_{i}P_ {d}(t)g_{i,d}(t)+p_{i,\rho}(t)+p_{c,\lambda})(\frac{q_{i}(t)}{\beta_{i\mu}^{*} (t)\log_{2}\left(1+\frac{p_{i\mu}(t)h_{i\mu}(t)}{\sigma^{2}}\right)})\\ \leq\eta_{i}TP_{d}(t)g_{i,d}(t),\forall i\in K,\forall t\in\mathcal{T}\end{array}  \tag{38}\]  
P5 is convex and can be optimally solved by the existing optimization algorithms such as SQP, Newton method, and gradient descent method. In problem P5, the objective function is polynomial form, C16 is a polynomial constraint, and C4 and C7 are both simple linear forms. Therefore, we can solve P5 with the following algorithm. Solving the simplified problem by SUMT and BFGS, we adopt sequential unconstrained minimization technology (SUMT) to reformulate the constraint problem into an unconstrained problem. We can solve the unconstrained optimization problem through some previous algorithms. Barrier method, one of the methods based on SUMT, is used to solve P5. To apply this method, we consider the constraints in P5 to define the penalty function as follows:  
\[M(q)=\frac{1}{-\sum_{l=1}^{N}\sum_{i=1}^{K}E_{i}^{rem}(t)(q_{i}(t))+\sum_{l=1 }^{N}\sum_{i=1}^{K}(q_{i}(t)-Z_{i}(t))-\sum_{l=1}^{N}\sum_{i=1}^{K}(q_{i}(t))+ \sum_{l=1}^{N}\sum_{i=1}^{K}(q_{i}(t)-Q_{max})} \tag{39}\]  
In addition, the initial candidate point \(q^{(0)}\), the termination limit \(\epsilon 1\), the initial penalty factor \(\mu_{0}\), the reduction coefficient of penalty factor \(\omega\), and the iteration counter \(k\) are given. We can get an unconstrained problem as follows:  
\[\underset{q}{\min}\text{Y}(q)+\mu_{k}M(q) \tag{40}\]where, \(\mathrm{Y}(q)\) is defined as:  
\[\mathrm{Y}(q)=-\sum_{t=1}^{N}\sum_{i=1}^{K}E_{i}^{rem}(t)(q_{i}(t))s_{i}(t) \tag{41}\]  
In each iteration, we choose the BFGS method to solve the unconstrained problem and the optimal solution is defined as \(q^{(k^{\star})}\). The penalty factor will be updated by iteration until the iteration time \(k\) is larger than 50 or the termination condition \(\mu_{k}M(q)<\varepsilon 1\) is satisfied, and the current \(q^{(k^{\star})}\) is the optimal solution. The details of the method are as follows:  
```
0:\(q^{(0)}\): initial candidate point; \(\mu_{k}\): penalty factor; \(\varepsilon_{1}\): termination limits; \(\omega\): reduction coefficient of penalty factor; k=0: iteration times; Output: The optimal offloading bits \(q^{k^{\star}}\);
1:repeat
2: solving the unconstrained problem (40) by BFGS method, get \(q^{(k^{\star})}\);
3:\(\mu_{k+1}=\omega\mu_{k}\);
4:\(k=k+1\);
5:until\(\mu_{k}M(q)<\varepsilon_{1}\) or \(k==50\)
6:return\(q^{k^{\star}}\)
```  
**Algorithm 2** Barrier Method  
Based on the optimal number of offloaded bits, we can get the optimal harvesting time by (25). As a result, the primary problem P1 is solved. The proposed method converts the primary problem from a nonconvex problem to a convex problem, reduces optimization variables from 3*K*N to K*N, brings down computation complexity, and improves computation efficiency.