## 2 System Model and Problem Formulation  
We considered a MEC system composed of a set \(N\) of MEC servers. We denote the capacity of MECS \(i\) in terms of the number of CPU cycles per second as \(C_{i}\). We assumed that a MECS is installed in a base station (BS) and ignored the information transfer delay between the MECS and BS. Following [9], we assumed that each device offloads its tasks to the MECS installed in the BS, giving it the highest signal strength. Time is divided into slots whose length is assumed to be the frame time between a device and a BS. A MECS maintains two queues: a waiting queue and a service queue. The set of tasks in the waiting queue of MECS \(i\) at the end of time slot \(t\) is denoted as \(O_{i}(t)\), and the set of tasks in the service queue of MECS \(i\) at the end of the time slot \(t\) is denoted as \(S_{i}(t)\). The waiting queue is used to temporarily buffer tasks offloaded from devices to a MECS during a time slot. At the end of a time slot, a MECS makes a task redirection to balance the loads among MECSs. Depending on the decision made by a MECS, the tasks in its waiting queue are either moved to its service queue or redirected to another MECS. A MECS uses its service queue to accommodate tasks until they are served in a FIFO manner. Thus, the tasks in the service queue of a MECS can be classified into two groups: a group composed of tasks moved from its waiting queue and a group composed of tasks redirected from other MECSs. Once a task is located in a service queue, it cannot be redirected to other MECSs to avoid unnecessary increases in the delay involved in transferring a task from one MECS to another. During each time slot, MECS \(i\) receives tasks offloaded from devices and places them in its waiting queue. A task \(x\) is composed of three tuples \((d_{x},w_{x},T_{x})\), where \(d_{x}\) is the data size of the task, \(w_{x}\) is the workload of the task in terms of the number of CPU cycles required to process the task, and \(T_{x}\) is the maximum delay allowed to finish the task. We denote the uplink transmission rate to send a task \(x\) from a device to its serving MECS during a time slot \(t\) as \(r_{i,x}(t)\). If we assume \(r_{i,x}(t)\) does not change during a time slot, even though it can change across time slots to satisfy the delay requirement of task \(x\), MECS \(i\) has to complete the task within:  
\[b_{i,x}=T_{x}-\frac{d_{x}}{r_{i,x}(t)}. \tag{1}\]  
Since the MECS is installed in a BS, it can be synchronized in time with the associated devices. Thus, \(\frac{d_{x}}{r_{i,x}}\) can be obtained by subtracting the time when a device sends task \(x\) from the time when the MECS receives the task. Therefore, the CPU frequency (i.e., the number of CPU cycles per second) required to finish tasks \(x\) becomes:  
\[f_{i,x}=\frac{w_{x}}{b_{i,x}}. \tag{2}\]  
Thus, at the end of time slot \(t\), the load of MECS \(i\) imposed by the tasks in \(O_{i}(t)\) is:  
\[\rho_{i,w}(t)=\frac{\sum_{x\in O_{i}(t)}f_{i,x}}{C_{i}}. \tag{3}\] \begin{table}
\begin{tabular}{l l} \hline \hline
**Notations** & **Meaning** \\ \hline \(\bar{\rho_{i}}(t)\) & Avg. load of a MEC system at the end of time slot \(t\) (i.e., \(\frac{1}{|N|}\sum_{j\in N}\rho_{j}(t)\)). \\ \(\Delta_{i}(t)\) & A set of MECSs whose loads are lower than \(\rho_{i}(t)\). \\ \(\delta_{i,j}(t)\) & Load difference between MECS \(i\) and \(j\) (specifically, \(\frac{\rho_{i}(t)-\rho_{j}(t)}{|N|}\), \(j\in\Delta_{i}(t)\)). \\ \(\alpha_{i,j}(t)\) & The amount of workload that MECS \(i\) redirects to \(j\). \\ \(\Phi_{i,j}(t)\) & A set of tasks that MECS \(i\) redirects to MECS \(j\). \\ \hline \hline \end{tabular}
\end{table} 
Table 1: _Cont._If a task \(x\) resides in the service queue of MECS \(i\) for \(d_{i,x}\), MECS \(i\) has to finish \(x\) in \(c_{i,x}=b_{i,x}-d_{i,x}\) to meet the deadline requested by \(x\). MECS \(i\) removes tasks whose \(c_{i,x}\leq 0\) from \(S_{i}(t)\) because the delay requirement of the task is not satisfied.