# Prioritization Based Task Offloading in UAV-Assisted Edge Networks +
## 4 Problem Formulation  
The problem that we address is the minimization of the average task penalty weighted by task priority in a software-defined edge network with integrated UAVs. Due to departures, some tasks may not be fulfilled even in the optimal scenario which prevents us from using a deadline as a constraint so we introduce a penalty scoring system in which an extra penalty score is added for unfilled tasks in order to encourage the completion of all tasks. The list of time-related notations that we utilize in the problem formulation is given in Table 2. In addition, we utilize indicator function \(1_{w}\) that is assigned to one if \(w\) is true, zero, otherwise. Figure 2: Task offloading sequence diagram. A task's lifetime in our edge network is composed of various components due to pool wait, transmission time, processor queue wait and processing time. \(C_{i}\) variable represents if \(i^{th}\) task \(K_{i}\) is successfully processed. Parameter \(x_{ij}\) is equal to one if \(K_{i}\) is decided to be offloaded to \(P_{j}\) and, similarly, \(y_{i}\) is equal to one if \(K_{i}\) is decided to be offloaded to the cloud. These decision variables are equal to zero otherwise. \(t_{total,i}\) is the total time needed to complete \(K_{i}\) and defined as follows if and only if (\(\leftrightarrow\)) the task is completed, which is the case when \(C_{i}\) equals 1:  
\[C_{i}=\sum_{j=1}^{N_{p}}x_{ij}+y_{i}\hskip 28.452756 pt\forall i \tag{1}\]  
\[t_{total,i}=t_{pool,i}+t_{tx,i}+t_{queue,i}+t_{process,i}\ \leftrightarrow\ C_{i}=1 \tag{2}\]  
\[t_{process,i}=S_{K_{i}}/(\sum_{j=1}^{N_{p}}\beta_{i}x_{ij}+\beta_{cloud}y_{i})\ \leftrightarrow\ C_{i}=1 \tag{3}\]  
\[t_{tx,i}=S_{K_{i}}/(\sum_{j=1}^{N_{p}}L_{K_{i},P_{j}}(t)x_{ij}+L_{K_{i},cloud}( t)y_{i})\ \leftrightarrow\ C_{i}=1 \tag{4}\]  
Equation (1) ensures that, in the best scenario, a task is processed only by a single processor. In Equation (2), the required time to complete \(K_{i}\) is calculated by summing all the related time components. The related components, processing time \(t_{process,i}\) and data transmission time \(t_{tx,i}\), are calculated in Equations (3) and (4). \(D_{i}\) is the penalty for \(K_{i}\) and calculated as:  
\[D_{i}=\left\{ \begin{array}{ll}max(t_{total,i}-t_{deadline,i},0)&\mbox{if $C_{i}=1$}\\ 0&\mbox{if $(C_{i}=0)\wedge(O_{i,V_{j}}=1)\wedge(b_{V_{j}}<a_{K_{i}}+t_{deadline,i} )$}\\ b_{V_{j}}-a_{K_{i}}-t_{deadline,i}+z\\ &\mbox{if $(C_{i}=0)\wedge(O_{i,V_{j}}=1)\wedge(b_{V_{j}}>a_{K_{i}}+t_{deadline,i} )$}\end{array} \right. \tag{5}\]  
The weighted penalty point of \(K_{i}\) is calculated as:  
\[w_{i}= \alpha_{i}\cdot D_{i}\hskip 28.452756 pt\forall i \tag{6}\]  
where \(\alpha_{i}\) is the task priority. Now, let us present the optimization problem, which will be solved by the orchestrator application to decide on the task offloading at each time slot as follows: \begin{table}
\begin{tabular}{l l} \hline \hline
**Symbol** & **Definition** \\ \hline \(T\) & The number of time slots \\ \hline \(t_{total,i}\) & The time elapsed to complete \(K_{i}\) \\ \hline \(t_{pool,i}\) & The time elapsed to be assigned for \(K_{i}\) \\ \hline \(t_{tx,i}\) & The time elapsed to transmit \(K_{i}\) \\ \hline \(t_{queue,i}\) & The time elapsed on processor queue for \(K_{i}\) \\ \hline \(t_{process,i}\) & The time elapsed to process \(K_{i}\) \\ \hline \(t_{deadline,i}\) & The time budget for \(K_{i}\) to be processed without any QoS violation, i.e., penalty \\ \hline \(a_{P_{i}}\) & The arrival time slot of \(P_{i}\) \\ \hline \(b_{P_{i}}\) & The departure time slot of \(P_{i}\) \\ \hline \(a_{K_{i}}\) & The arrival time slot of \(K_{i}\) \\ \hline \(c_{K_{i}}\) & The completion time slot of \(K_{i}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Time-related notations in problem formulation.