# Mobility- and Energy-Aware Cooperative Edge Offloading for Dependent Computation Tasks +
## 5 Solution of Dynamic Computation Offloading Optimization Problem
### Conversion of \(Op1\) into QCQP
The vector \(n_{T_{s}}\) of the sojourn times has the same dimension as \(n_{T}\). Thus, the QCQP transformation of \(OP2\) can be written as  
\[+e_{(1+l+M+IM)k}+e_{(1+l+M+IM)K+k}\]2 \[+e_{(1+l+M+IM)k}+e_{(1+l+M+IM)K+k}\]3 \[+e_{(1+l+M+IM)k}+e_{(1+l+M+IM)K+k}\]4 \[+e_{(1+l+M+IM)k}+e_{(1+l+M+IM)K+k}\]5 \[+e_{(1+l+M+IM)k}+e_{(1+l+M+IM)K+k}\]6 \[+e_{(1+l+M+IM)k}+e_{(1+l+M+IM)K+k}\]7 \[+e_{(1+l+M+IM)k}+e_{(1+l+M+IM)K+k}\]8  
For the further change to the _homogeneous_ QCQP \(OP4\), we define \(g=[v^{T}1]\), \(n_{1}^{\prime}=\text{diag}(n_{1k})\), \(n_{3}^{\prime}=\text{diag}(n_{3})\), \(a=(2+I+M+IM)K\), \(b=(1+I+M+IM)K+1\), and \(c=(1+I+M+IM)K+k\). In order to convert the necessary constraints for the variety of device roles into the standard form for QCQP solvers, we convert all constraints into the matrix form \[M_{0}= \left[ \begin{array}{cc}0_{(a+1)\times(a+1)}&\frac{1}{2}n_{0}\\ \frac{1}{2}(n_{0})^{T}&0\end{array} \right];\] \[M_{1}= \left[ \begin{array}{cc}\text{diag}(e_{j})&-\frac{1}{2}e_{j}\\ -\frac{1}{2}(e_{j})^{T}&0\end{array} \right];\] \[M_{2}= \left[ \begin{array}{cc}0_{(a+1)\times(a+1)}&\frac{1}{2}n_{1k}\\ \frac{1}{2}(n_{1k})^{T}&0\end{array} \right];\] \[M_{3}= \left[ \begin{array}{cc}0_{(a+1)\times(a+1)}&\frac{1}{2}e_{b}\\ \frac{1}{2}(e_{b})^{T}&0\end{array} \right];\] \[M_{3}^{\prime}= \left[ \begin{array}{cc}0_{a\times a}&-\frac{1}{2}((n_{T})^{T}n _{3}^{\prime})^{T}&\frac{1}{2}(e_{c})^{T}\\ -\frac{1}{2}((n_{T})^{T}n_{3}^{\prime})&0&0\\ \frac{1}{2}(e_{c})^{T}&0&0\end{array} \right];\] \[M_{4}= \left[ \begin{array}{cc}0_{(a+1)\times(a+1)}&\frac{1}{2}(n_{2})\\ \frac{1}{2}(n_{2})^{T}&0\end{array} \right];\] \[M_{5}= \left[ \begin{array}{cc}0_{(a+1)\times(a+1)}&\frac{1}{2}[(n_{T} -n_{T_{s}})^{T}n_{1k}^{\prime}]^{T}\\ \frac{1}{2}[(n_{T}-n_{T_{s}})^{T}n_{1k}^{\prime}]&0\end{array} \right].\]  
Then,  
\[OP4:\quad\min_{g}\quad g^{T}(M_{0})g\] \[s.t: C1:g^{T}M_{1}g=0,\,j=1,\ldots,(1+I+M+IM)K;\] \[C2:g^{T}M_{2}g=1,\forall k\in\mathcal{K}, \tag{30}\] \[C3_{0}:g^{T}M_{3}g=0,\,\forall j\in\mathcal{P}(k),\mathcal{P}(k )=\emptyset,\,\forall k\in\mathcal{K};\] \[C3_{1}:g^{T}M_{3}^{\prime}g\geq 0,\,\forall j\in\mathcal{P}(k), \mathcal{P}(k)\
eq\emptyset,\,\forall k\in\mathcal{K};\] \[C4:g^{T}M_{4}g\leqslant T_{d}^{\max};\] \[C5:g^{T}M_{5}g\leq 0,\quad\forall k\in\mathcal{K}.\]  
For the final conversion step, we define the symmetric, positive semidefinite matrix \(G=gg^{T}\) and write with \(\text{Tr}(\cdot)\) denoting the trace of a square matrix:  
\[OP5:\quad\min_{G}\quad\text{Tr}(M_{0}G) \tag{31}\] \[s.t: C1:\text{Tr}(M_{1}G)=0,\,\,\,j=1,\ldots,(1+I+M+IM)K;\] \[C2:\text{Tr}(M_{2}G)=1,\,\,\,\forall k\in\mathcal{K};\] \[s.t: C1:g^{T}M_{1}g=0,\,j=1,\ldots,(1+I+M+IM)K;\]0 \[s.t: C1:g^{T}M_{1}g=0,\,j=1,\ldots,(1+I+M+IM)K;\]1 \[s.t: C1:g^{T}M_{1}g=0,\,j=1,\ldots,(1+I+M+IM)K;\]2 \[s.t: C1:g^{T}M_{1}g=0,\,j=1,\ldots,(1+I+M+IM)K;\]3 \[s.t: C1:g^{T}M_{1}g=0,\,j=1,\ldots,(1+I+M+IM)K;\]4 \[s.t: C1:g^{T}M_{1}g=0,\,j=1,\ldots,(1+I+M+IM)K;\]5 \[s.t: C1:g^{T}M_{1}g=0,\,j=1,\ldots,(1+I+M+IM)K;\]6 \[s.t: C1:g^{T}M_{1}g=0,\,j=1,\ldots,(1+I+M+IM)K;\]7 \[s.t: C1:g^{T}M_{1}g=0,\,j=1,\ldots,(1+I+M+IM)K;\]8While this problem \(OP5\) has a few additional constraints, the single constraints are much easier to handle for the solver. For example, constraints C6-C9 are simple checks for single elements of the matrix \(G\).