## 2 System Model and Problem Formulation
If we denote the set of tasks in \(S_{i}(t)\) whose \(c_{i,x}>0\) as \(S_{i}^{\prime}(t)\), the load imposed by a task \(x\in S_{i}^{\prime}(t)\) in terms of the number of CPU cycles per second is given as:  
\[f_{i,x}^{\prime}=\frac{w_{x}}{c_{i,x}}. \tag{4}\]  
Therefore, the load imposed by the tasks in \(S_{i}(t)\) is obtained as follows:  
\[\rho_{i,s}(t)=\frac{\sum_{x\in S_{i}^{\prime}(t)}f_{i,x}^{\prime}}{C_{i}}. \tag{5}\]  
The first step to balance the loads among MECSs is to determine whether a MECS will have a higher load than the other MECSs. At the end of each time slot \(t\), the set of tasks received by MECS \(i\) is \(O_{i}(t)\cup S_{i}(t)\). Thus, if \(\rho_{i,w}(t)+\rho_{i,s}(t)\) is larger than \(\rho_{j,w}(t)+\rho_{j,s}(t)\), MECS \(i\) will have a higher load than MECS \(j\) if no other action is taken. Therefore, using Equations (3) and (5), we define the load of MECS \(i\) at the end of time slot \(t\) as:  
\[\rho_{i}(t)=\rho_{i,w}(t)+\rho_{i,s}(t). \tag{6}\]  
We can observe that \(\rho_{i}(t)\) depends on many factors such as the attribute of a task \((d_{x},w_{x},T_{x})\), the uplink transmission rate \((r_{i,x}(t))\), the computing power of a MECS \((C_{i})\), and the number of tasks in a MECS \((|O_{i}(t)|,|S_{i}(t)|)\). The attribute of a task depends on the application services. Thus, \(\rho_{i}(t)\
eq\rho_{j}(t)\) even when all the other variables affecting \(\rho_{i}(t)\) and \(\rho_{j}(t)\) are the same. As we can see in Equation (1), \(r_{i,x}(t)\) influences the heterogeneity of the task attribute by changing the delay requirement of a task when it arrives at a MECS. The number of tasks in a MECS \(i\) depends on the task input rate and the task service rate. The task input rate to a MECS \(i\) during a time slot \(t\), which we denote by \(a_{i}(t)\), is mainly affected by the number of devices offloading their tasks to a MECS \(i\). Generally, \(a_{i}(t)\
eq a_{j}(t),(i,j\in N)\) because devices are not evenly distributed over the region that a MEC system serves. In addition, the association method that a device selects a MECS to which the device offloads its tasks also influences \(a_{i}(t)\). Usually, it is difficult for a device to know the load situation of each MECS. Thus, following [9], we assumed that a device offloads tasks to the MECS colocated with the BS, which gives it the highest signal strength. By selecting the BS giving the highest signal strength, a task may obtain high \(r_{i,x}(t)\). However, it was shown in [15; 16] that the number of devices associated with each BS is not evenly distributed when a device determines its association according to the signal strength from a BS, which results in \(a_{i}(t)\
eq a_{j}(t),(i,j\in N)\). The task service rate of a MECS is determined by \(C_{i}\) and the workload imposed by a task \((w_{x})\), which are not the same for all tasks. Therefore, \(\rho_{i}(t)\
eq\rho_{j}(t),(i,j\in N)\) in general, which means the \(\rho_{i}(t)\)s of some MECSs are high, while those of the other MECSs are low, as shown in Figure 1a. If a task is offloaded to a MECS whose load is high, it is highly probable that the delay requirement of the task is violated. However, we can avoid the situation if we redirect the tasks from a highly loaded MECS to a lightly loaded MECS, as we depict in Figure 1. Thus, our goal is to balance loads among MECSs by redirecting tasks so that:  
\[\rho_{i}=\rho_{j}=\bar{\rho}=\frac{1}{|N|}\sum_{k\in N}\rho_{k},\forall i,j\in N, \tag{7}\]  
where \(|N|\) is the cardinality of set \(N\). To balance the loads between a highly loaded MECS \(i\) and a lightly loaded MECS \(j\), MECS \(i\) must determine the amount of workload to redirect to MECS \(j\). Generally, to make such a decision, MECS \(i\) needs to know the local information of MECS \(j\) such as \(O_{j}(t)\) and \(S_{j}(t)\). However, by including \(\rho_{i,w}(t)\) in \(\rho_{i}(t)\), we enable MECS \(i\) to determine the amount of workload to redirect to MECS \(j\) without the local information of MECS \(j\). We detail our task redirection method in Section 3.