# Lyapunov-Guided Energy Scheduling and Computation Offloading for Solar-Powered WSN
## 5 Performance Analysis of Algorithms  
In this paper, we use Lyapunov optimization to convert a long-term optimization problem into an online single-time slot optimization problem and subsequently obtain a near-optimal solution to the original problem by solving the single-time slot optimization problem optimally at each time slot. This section analyses the gap between the optimal energy efficiency obtained by the proposed online algorithm and the optimal value of the original problem, together with revealing that the queueing backlog and network utility follow the trade-off of \([\mathcal{O}(V),\mathcal{O}(1/V)]\) as shown in Theorem 2. The optimal network utility and the average queue backlog satisfy the following equation. \[\eta_{EE}^{t}=\lim_{T\to\infty}\frac{1}{T}\sum\limits_{t=1}^{T}\mathbb{E}\{ \eta_{EE}^{t}\}\geq\eta_{EE}^{t*}-\frac{C}{V\mathbb{E}\Big{\{}E_{total}^{t, \max}\Big{\}}} \tag{32}\]  
\[\lim_{T\to\infty}\frac{1}{T}\sum\limits_{t=1}^{T}\left(E_{S}^{t-1}+\sum \limits_{k=1}^{K}E_{k}^{t-1}+\sum\limits_{k=1}^{K}Q_{k}^{t-1}\right)\geq 2B^{ \max}+\frac{V\Big{(}\eta_{EE}^{t*}\mathbb{E}\Big{\{}E_{total}^{t,\max}\Big{\}} -\mathbb{E}\Big{\{}\eta_{EE}^{t}E_{total}^{t,\max}\Big{\}}\Big{)}-C}{\varepsilon} \tag{33}\]  
Equation (32) indicates that the time-averaged network energy efficiency increases at the rate of \(\mathcal{O}(1/V)\), and Equation (33) indicates that the time-averaged energy queue backlog increases at the rate of \(\mathcal{O}(V)\). When \(V\) is large enough, the algorithm energy efficiency approaches the optimal energy efficiency, and the queue backlog is at its worst thereafter. Thus, the network energy queue backlog and network utility follow a trade-off of \([\mathcal{O}(V),\mathcal{O}(1/V)]\). First, we assume that the mathematical expectation of the new energy provision MEC system satisfies the following constraint before proving Theorem 2  
\[0\leq E_{total}^{t}\leq E_{total}^{t,\max} \tag{34}\]  
After a certain number of iterations of Algorithm 1, the system will stabilize and there will exist arbitrarily small positive real numbers such that the following equation holds  
\[ \begin{array}{l}\mathbb{E}\bigg{\{}\sum\limits_{k=1}^{K}\overline{\Phi}_{k} ^{t}-\eta_{EE}^{t}\overline{E}_{total}^{t}\bigg{|}\mathbf{G}^{t}\bigg{\}}= \mathbb{E}\bigg{\{}\sum\limits_{k=1}^{K}\overline{\Phi}_{k}^{t*}-\eta_{EE}^{t} \overline{E}_{total}^{t*}\bigg{\}}\leq-\varepsilon_{1}\leq-\varepsilon\\ \mathbb{E}\Big{\{}E_{S,har}^{t}-E_{MEC}^{t}-P_{S}^{t}\tau_{0}\bigg{|}\mathbf{G }^{t}\Big{\}}=\mathbb{E}\Big{\{}E_{S,har}^{t}-E_{MEC}^{t*}-P_{S}^{t*}\tau_{0} \bigg{\}}\\ =\lambda-\mathbb{E}\big{\{}E_{MEC}^{t*}+P_{S}^{t*}\tau_{0}\big{\}}\leq- \varepsilon_{2}\leq-\varepsilon\\ \mathbb{E}\{E_{k,har}^{t}-E_{k,con}^{t}\bigg{|}\mathbf{G}^{t}\}=\mathbb{E}\{E_{ k,har}^{t*}-E_{k,con}^{t*}\}\leq-\varepsilon_{3}\leq-\varepsilon\\ \mathbb{E}\{D_{k}^{t}-\[PERSON]_{k}^{t}|\mathbf{G}^{t}\}=\mathbb{E}\{D_{k}^{t*}-\[PERSON] _{k}^{t*}\}\leq-\varepsilon_{4}\leq-\varepsilon\end{array}  \tag{35}\]  
where \(\sum\limits_{k=1}^{K}\overline{\Phi}_{k}^{t*}\), \(E_{total}^{t*}\), \(E_{MEC}^{t*}\), \(P_{S}^{t*}\tau_{0}\), \(E_{k,har}^{t*}\), \(E_{k,con}^{t*}\), and \(\Phi_{k}^{t*}\) indicate the optimal solutions derived under arbitrary decisions, respectively. Substituting Equation (35) into Equation (20), we obtain Equation (36). \[ \begin{array}{l}\Delta L[\mathbf{G}^{t}]-V\,\mathbb{E}\{\sum\limits_{k=1}^{K }\overline{\Phi}_{k}^{t}-\eta_{EE}^{t}\overline{E}_{total}^{t}\bigg{|}\mathbf{G }^{t}\}\\ \leq C+\varepsilon\bigg{(}E_{S}^{t-1}-2B^{\max}+\sum\limits_{k=1}^{K}E_{k}^{t-1 }+\sum\limits_{k=1}^{K}Q_{k}^{t-1}\bigg{)}-V\big{(}\eta_{EE}^{t*}-\eta_{EE}^{t} \big{)}\mathbb{E}\{E_{total}^{t}\}\\ \leq C+\varepsilon\bigg{(}E_{S}^{t-1}-2B^{\max}+\sum\limits_{k=1}^{K}E_{k}^{t-1 }+\sum\limits_{k=1}^{K}Q_{k}^{t-1}\bigg{)}-V\big{(}\eta_{EE}^{t*}-\eta_{EE}^{t} \big{)}\mathbb{E}\Big{\{}E_{total}^{t,\max}\Big{\}}\end{array}  \tag{36}\]  
where \(E_{total}^{t,\max}\) represents the network maximum energy consumption.