# Compp-DDPG: Computation Offloading with Privacy Preservation in a Vehicular Edge Network
## 4 Problem Formulation  
We formulated the cooperative optimization problem of computation offloading and resource allocation with privacy preservation to minimize the weighted system cost. In this work, the cost function is negatively correlated with the ICV's satisfaction. The satisfaction function is a term in economics and has been widely used by recent studies [39]. Firstly, the total delay of the ICV's task is negatively correlated with satisfaction. With the increment of the delay, the vehicular tasks' information become less valuable. Even for some security-related tasks, delay beyond their required maximum execution deadline will endanger the safety of vehicles. When the task end-to-end delay exceeds the vehicular task's completion deadline, the satisfaction of the ICV is considered to be extremely poor, and the corresponding penalty will be imposed. Therefore, the longer the total delay of the vehicular task, the lower the satisfaction of the ICV. Secondly, there is no cost for ICVs to use their own configured computing resources. As a supplement to the ICV's own computing resources, the computing resources obtained by the ICV from the VEC or MEC server are considered to require the payment. Therefore, the more computational resources consumed that are not ICVs, the lower the satisfaction of the ICV. Thirdly, privacy is also a reference quantity that affects the ICV's satisfaction. The ICV's privacy concerns the vehicle safety and the driver's personal privacy. A low privacy level will lead to the disclosure of the ICV's related information. Therefore, the lower the amount of privacy the ICV has, the lower the satisfaction of the ICV. In addition, the sensitivity of the vehicular task priority to delay is also different. We also take the priority into the consideration. Therefore, the cost function for ICV-\(i\) to process the task locally is given by  
\[U_{i}^{ICV}=\left\{ \begin{array}{l}\beta Q_{i}\log\biggl{(}1+\left(t_{i}^{ actual}-t_{i}^{ICV}\right)^{+}\biggr{)}\\ +\gamma pf_{ICV}-(1-\beta-\gamma)P_{i}(t),t_{i}^{ICV}\leq t_{i}^{\max}\\ P,\,t_{i}^{ICV}>t_{i}^{\max}\end{array} \right., \tag{19}\]  
where \(\beta\in(0,1)\) is the weight of the delay part and \(\gamma\) represents the weigh of computational resource cost part. \((\cdot)^{+}=max(\cdot,\ 0)\) guarantees \(U_{i}^{l}\) to be non-negative. The unit cost of the computational resource unit cost is depicted as \(\rho\). Additionally, \(P\) denotes the penalty for the vehicular task's total delay exceeding its maximum execution deadline. The cost function of ICV-\(i\) offloaded the task to the VEC is  
\[U_{i}^{\text{VEC}}=\left\{ \begin{array}{l}\beta Q_{i}\log\biggl{(}1+\left(t_ {i-VEC}^{actual}-t_{i}^{VEC}\right)^{+}\biggr{)}\\ +\gamma pf_{VEC}-(1-\beta-\gamma)P_{i}(t),t_{i}^{VEC}\leq t_{i}^{\max}\\ P,\,t_{i}^{VEC}>t_{i}^{\max}\end{array} \right., \tag{20}\]  
where \(t_{i-VEC}^{actual}=min\left\{t_{ik}^{link},t_{i}^{max}\right\}\) is denoted as the delay actually generated by ICV-\(i\). As soon as the V2V transmission connection is disconnected, the task offloading process of the ICV-\(i\) to the VEC-\(k\) will be terminated. The cost function of ICV-\(i\) offloaded the task to the MEC server is  
\[U_{i}^{\text{MEC}}=\left\{ \begin{array}{l}\beta Q_{i}\log\biggl{(}1+\left(t_ {i-MEC}^{actual}-t_{i}^{MEC}\right)^{+}\biggr{)}\\ +\gamma pf_{i}^{\text{MEC}}-(1-\beta-\gamma)P_{i}(t),t_{i}^{\text{MEC}}\leq t_ {i}^{\max}\\ P,\,t_{i}^{\text{MEC}}>t_{i}^{\max}\end{array} \right.. \tag{21}\]  
Similarly, \(t_{i-MEC}^{actual}=min\left\{t_{ij}^{link},t_{i}^{max}\right\}\) is described as the actual delay of the vehicular task. The task offloading to the MEC server interrupt occurs when the V2I communication is disconnected. Combining (19), (20), and (21), the ICV-\(i\)'s cost function is generated as  
\[U_{i}=\left\{ \begin{array}{l}U_{i}^{ICV},x_{i}=0,\\ U_{i}^{VEC},x_{i}=1,\\ U_{i}^{MEC},x_{i}=2.\end{array} \right.