## 3 System Model and Problem Formulation
However, if the primary MECS \(i\) is in the sleep state, the BS \(b\) distributes the tasks among secondary MECSs in proportion to their processing capacities. Thus, the workload newly imposed on a MECS \(i\) during a time slot \(t\) denoted by \(\lambda_{i}(t)\) is influenced by \(\eta_{i}(t)\) and \(\eta_{j}(t)\) (\(\forall j\in\mathcal{M}-\{i\}\)). If \(\eta_{i}(t)=0\), \(\lambda_{i}(t)=0\) regardless of \(\eta_{j}(t)\). Since a MECS goes into a sleep state after processing \(Q_{i}(t)\), \(Q_{i}(t+1)=0\) when \(\eta_{i}(t)=0\). On the contrary, when \(\eta_{i}(t)=1\), a MECS \(i\) accommodates the tasks requested by users in the service area of the base stations in \(B_{i}\). If we denote the set of users connected to a BS \(b\in B_{i}\) during a time slot \(t\) by \(U_{i,b}(t)\) and the workload imposed by a user \(u\in U_{i,b}(t)\) by \(w_{i,b,u}(t)\), the workload of tasks sent to the BS \(b\) during a time slot becomes \(w_{i,b}(t)=\sum_{u\in U_{i,b}(t)}w_{i,b,u}\). Therefore, the workload newly imposed by the users in the service area of the BSs in \(B_{i}\) during a time slot is given as \(\bar{\lambda}_{i}(t)=\sum_{b\in B_{i}}w_{i,b}(t)\). In addition, \(i\) should accommodate some of the tasks that should have been offloaded to a MECS \(j\) in a sleep mode when \(\eta_{j}(t)=1\). We denote by \(\bar{\lambda}_{i,j}(t)\) the workload imposed by the tasks that are assigned to an active MECS \(i\) because a MECS \(j\) is in a sleep mode. When the primary MECS of a BS is in a sleep mode, the BS distributes the tasks requested by users to the secondary MECSs in proportion to their task processing capabilities. Therefore, \(\bar{\lambda}_{i,j}(t)\) is given as  
\[\bar{\lambda}_{i,j}(t)=\frac{C_{i}}{\sum_{k\in\mathcal{M}\wedge\eta_{k}(t)=1} C_{k}}\bar{\lambda}_{j}(t). \tag{2}\]  
Then, \(\lambda_{i}(t)\) is given as follows:  
\[\lambda_{i}(t)=\bar{\lambda}_{i}(t)+\sum_{j\in\mathcal{M}-\{i\}}(1-\eta_{j}(t ))\bar{\lambda}_{i,j}(t). \tag{3}\]  
Accordingly, \(Q_{i}(t+1)\) of an active MECS \(i\) is determined as  
\[Q_{i}(t+1)=\max\{Q_{i}(t)+\lambda_{i}(t)-C_{i},0\}. \tag{4}\]  
Since a task queue is served in a FIFO manner, \(Q_{i}(t)\) is larger than \(Q_{i}(t+1)\) for a time slot \(t\) when \(\lambda_{i}(t)\leq C_{i}\). Accordingly, the maximum delay that a MECS \(i\) can provide during the time slot becomes \(Q_{i}(t)/C_{i}\). If \(\lambda_{i}(t)>C_{i}\), \(Q_{i}(t+1)\) becomes larger than \(Q_{i}(t)\). Therefore, the longest delay that a task experiences during a time slot occurs when the tasks are assigned to a MECS \(i\) consecutively after the beginning of a time slot. In other words, among the tasks consecutively offloaded to a MECS \(i\) after the start of a time slot, the last task experiences the longest delay \(Q_{i}(t+1)/C_{i}\) during the time slot. Therefore, the maximum delay that a MECS \(i\) can provide during a time slot \(t\) becomes  
\[\delta_{i}(t)=\frac{\max\{Q_{i}(t),Q_{i}(t+1)\}}{C_{i}}. \tag{5}\]  
For a MEC system to provide a reasonable task service delay to users, the maximum service delay during each time slot should be bounded. In other words, for each time slot \(t\), a MEC system needs to satisfy the following delay constraint. \[\delta(t)=\max\{\delta_{i}(t)\}\leq\delta_{th},\forall i\in\mathcal{M}, \tag{6}\]  
where \(\delta_{th}\) is a delay threshold that is configured by a MEC operator. To determine the energy consumed by a MECS during a time slot, we adopt the energy consumption model in [34]. If we denote the load of a MECS \(i\) during a time slot \(t\) as \(\rho_{i}(t)\), the amount of energy consumed by \(i\) is given as follows:  
\[\zeta_{i}(t)=\alpha P_{m}+(1-\alpha)P_{m}\rho_{i}(t),(0\leq\alpha\leq 1). \tag{7}\]  
\(P_{m}\) is the maximum power that a MECS uses when its load is the highest, and \(\alpha\) determines the fraction of power consumed when a MECS does not have a task to process while it is in an active state.