# MADDPG-Based Offloading Strategy for Timing-Dependent Tasks in Edge Computing
## 3 System Model
### Problem Formulation  
In realistic IoT environments, each node has its fixed computing resource which forms the basis for supporting responses to UE service requests. The main goal of this paper is to efficiently utilize the computing resources of the MEC to minimize the total offloading delay of global IoT device service requests. An additional goal is maximizing the node resource utilization to optimize the response efficiency of the system in handling concurrent service requests from multiple IoT devices per unit of time. To achieve this goal, this paper establishes the objective function and constraints denoted by Equation (12). This means that the execution location of a task is determined by the offloading delay of the equipment to be processed for that task and the current resource utilization of the equipment to be processed. The offloading delay and resource utilization are combined and weighed to determine the optimal offloading location for this task. The total offload delay and the resource utilization are defined as Equations (13) and (14), respectively:  
\[w_{1}\text{min}T_{total}+w_{2}\text{max}U_{total},w_{1}+w_{2}=1\,, \tag{12}\]  
\[T_{total}=\sum_{i=1}^{\left|Q\right|}\underset{j=1}{\overset{\left|Q\right|}{ \max}}T_{ij}+\sum_{i\in F}t_{i},\,t_{i}=\left\{\begin{array}{l}0\,,\,\,\text {if}\,i\,\text{is}\,\,\text{in}\,\,\text{the}\,\,\text{parallel}\,\,\text{ set}\\ t_{i},\,\,\text{otherwise}\end{array}\right.\,, \tag{13}\]  
\[U_{total}=\sum_{j=1}^{l}\alpha_{j,k}^{util}=\sum_{j=1}^{l}\frac{\alpha_{j}^{util }}{\alpha_{k}^{util,\text{max}}}\,, \tag{14}\]  
\[s.t.C1:0<T_{d,j}^{sum}\leq T_{d,j}^{tol}\]  
\[C2:T_{i\_finish}\leq T_{j+1,start},1\leq i\leq I,1\leq j,j+1\leq J\]  
\[C3:x_{k,j}^{util}+x_{k,j}^{util}=1,1\leq k\leq K,1\leq j\leq J\]  
\[C4:f_{L}\leq f_{L}^{max},f_{N}\leq f_{N}^{\max}\]  
\[C5:P_{d,m}+P_{d,n}\leq p^{\max}\]  
\[C6:\alpha_{j,n}^{util}\leq\alpha_{j,n}^{util,\max},\forall n\in N\]  
where \(F\) denotes the set of all serial tasks, \(Q\) denotes the set of all parallel tasks, \(Q_{i}\) denotes the \(i\)th subset of the parallel set, \(T_{i,j}\) denotes the \(i\)th subtask latency in the \(j\)th parallel set, and \(t_{i}\) denotes the execution latency of the \(i\)th serial task. \(\alpha_{j,k}^{util}\) denotes the resource utilization when offloading task \(j\) to node \(k\). \(\alpha_{k}^{util\_max}\) denotes the maximum available computing resource on node \(k\), and \(\alpha_{j}^{util}\) denotes the computing resource required for task \(j\).  
Equation (13) indicates that the offloading delay of a dependency request service is equal to the sum of the offloading delay of the longest task in all parallel sets and the offloadingdelay of all serial tasks. Constraint C1 indicates that the offloading delay of each task is less than its maximum tolerable delay. Constraint C2 indicates that the precondition for task \(j\) to start offloading is that all of its predecessors with dependencies have finished executing. Constraint C3 indicates that the task has only the possibility of being executed on one device, which includes the UE and the MEC server. Constraint C4 is a power constraint for the UE and the MEC server. Constraint C5 indicates that the transmission power of the UE \(d\) can guarantee the normal offloading of the application tasks. Constraint C6 indicates that the remaining computing resources of the edge server are fully available when the tasks are offloaded.