# Joint Optimization of Service Migration and Resource Allocation in Mobile Edge-Cloud Computing
## 3 System Model and Problem Definition
### Problem Formulation  
With the above notation and modeling, we can obtain the response delay of the task as  
\[T_{t}^{k}=\begin{cases}&r_{t}^{k}\cdot\tau+\phi_{t+r_{t}^{k},\mathbf{v}_{t+r_{t} ^{k}}^{k}}+\frac{\kappa_{W}W_{t+r_{t}^{k}}^{k}}{p_{t+r_{t}^{k}}^{k}}+T_{t+r_{t} ^{k}}^{ret,k};\\ &\\ T_{W}+T_{t+r_{t}^{k}}^{ret,k},\quad\text{if result from cloud}.\end{cases} \tag{16}\]  
In this paper, we minimize the average response delay of tasks by optimizing the service migration and resource allocation policies. The combined challenge of optimizing  
\begin{table}
\begin{tabular}{c l} \hline \hline
**Symbol** & **Definition** \\ \hline \(S\) & The set of ESs \\ \(U\) & The set of users \\ \(T\) & The set of time slots \\ \(\tau\) & The duration of the time slot \(t\) \\ \(\Lambda\) & Number of task types generated by users \\ \(Task\) & A list of tasks offloaded by users at different time slots \\ \(Task_{t}\) & List of offloaded task information for a single time slot \(t\) \\ \(task_{t}^{k}\) & The state about task \(k\) during time slot \(t\) \\ \(T_{W}\) & The response time constraints of application \(W\) \\ \(Rst_{t}^{k}\) & Remaining time of \(task_{t}^{k}\) in time slot \(t\) \\ \(V_{t}^{k}\) & Remaining size of \(task_{t}^{k}\) in time slot \(t\) \\ \(p^{i}\) & The total computing resources possessed by server \(s_{i}\) \\ \(loc_{t}^{k}\) & The ES associated with the user who offloaded \(task_{t}^{k}\) \\ \(X_{t}^{k}\) & The allocation of \(task_{t}^{k}\) on ESs in time slot \(t\) \\ \(Z_{t}^{k}\) & Indicator of task completion \\ \(\Psi_{t}^{k}\) & ES where the \(task_{t}^{k}\) is located \\ \(D_{t}^{k}\) & Migration delay of \(task_{t}^{k}\) in time slot \(t\) \\ \(h_{t}^{k}\) & Suspension delay of \(task_{t}^{k}\) in time slot \(t\) \\ \(w_{t}^{k}\) & Synchronization delay of \(task_{t}^{k}\) in time slot \(t\) \\ \(r_{t+1}^{k}\) & Restoration delay of \(task_{t}^{k}\) in time slot \(t+1\) \\ \(p_{\Psi_{t}^{k}}\) & The computational resources allocated to \(task_{t}^{k}\) \\ \(\phi_{W}^{k}\) & The computational intensity required to suspend service \(W\) \\ \(\sigma_{W}^{k}\) & The computational intensity required to restore service \(W\) \\ \(V_{W}^{m}\) & The context size to be migrated for service \(W\) \\ \(B_{\Psi_{t}^{k},\Psi_{t}^{k},i}^{k}\) & The wired bandwidth between service \(s_{\Psi_{t}^{k}}\) and target service \(s_{\Psi_{t+1}^{k}}\) \\ \(C_{t,i}\) & The average migration delay for services migrating to server \(s_{i}\) \\ \(V_{t,i}\) & The average migration delay for services migrating out of server \(s_{i}\) \\ \(\phi_{t,i}\) & The average migration delay of server \(s_{i}\) \\ \(\mu\) & Propagation delay between ESs and cloud server \\ \(R_{t}^{l}\) & Wireless transmission rate of user \(j\) in time slot \(t\) \\ \(V_{W}\) & Average task data size for application \(W\) \\ \(T_{t}^{tram,k}\) & The uplink transmission delay of \(task_{t}^{k}\) \\ \(\omega_{t}^{out}\) & The ratio of the result data size to the \(V_{W}\) \\ \(T_{t+r_{t}^{k}}^{back,k}\) & The delay in returning task results to the ES \(s_{loc_{t+r_{t}^{k}}}\) \\ \(T_{t+r_{t}^{k}}^{down,k}\) & The delay in downlinking the task results to the user \\ \(\kappa_{W}\) & The computational intensity of the task generated by application \(W\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: List of defined notation.  
service migration and resource allocation in the MECC environment can be expressed as follows:  
\[\mathcal{P}: \min_{\mathbf{X},\mathbf{P}}\,\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t= 1}^{T}\frac{1}{|task_{t}|}\sum_{k=1}^{|task_{t}|}T_{t}^{k}, \tag{17a}\] \[\text{s.t.}\,\,\sum_{i=1}^{n}x_{k,t}^{i}=1,\,\forall k\leq K_{t}, \forall t\in T,\] (17b) \[\sum_{k=1}^{K_{t}}p_{\mathbf{v}_{t}^{k}}\leq p^{i},\forall i\in\{1, \ldots,n\},\,\forall t\in T. \tag{17c}\]