## 3 System Model and Problem Formulation
### Problem Formulation  
The tasks of TaVn can be executed locally, offloaded to SeVn and to BS/RSU at the same time, and the proportion of each part can be expressed as \(\alpha_{n}\), \(\beta_{n}\), and \(\theta_{n}\), which satisfy \(\alpha_{n}+\beta_{n}+\theta_{n}=1,0\leq\{\alpha_{n},\beta_{n},\theta_{n}\}\leq 1\). They can also indicate the offload modes. In other words, when a task is not executed in one terminal, the corresponding offloading ratio is 0. The local execution time can be expressed as  
\[\text{T}_{n}^{loc}=\alpha_{n}\text{C}_{n}/\text{f}_{n}, \tag{9}\]  
where \(\text{f}_{n}\) is the local execution capacity. In particular, when all parts of tasks are executed locally, i.e., in Loc mode,\(\text{T}_{n}=\text{T}_{n}^{loc}=\text{C}_{n}/\text{f}_{n}\), \(\alpha_{n}=1\). In this case, \(\text{T}_{n}\) is equal to the local execution time. Remote processing time includes transmission time and task execution time. In general, the size of the computational result is much smaller than the input data size of a task [26], and the send time is lower when one task needs to be offloaded. Then, the influence of downloading time and vehicles' mobility is negligible, and the processing time of SeVn and ES can be expressed as  
\[\text{t}_{n}^{n^{\prime}}=\beta_{n}\text{C}_{n}/\text{f}_{n^{\prime}}+\beta_{n }\text{D}_{n}\Big{/}\text{R}_{n}^{v2v}, \tag{10}\]  
\[\text{t}_{n}^{edg}=\theta_{n}\text{C}_{n}\Big{/}\rho_{n}\text{F}^{edg}+\theta_ {n}\text{D}_{n}\Big{/}\text{R}_{n}^{alg}, \tag{11}\]  
where \(\rho_{n}\text{F}^{edg}\) represents the computing resources of ES allocated to TaVn, and \(\rho_{n}\) is its indicator. When tasks are executed in TaVn and SeVn, the Loc + SeV mode is entered, and the processing time is the larger one of \(\text{T}_{n}^{loc}\) and \(\text{T}_{n}^{n^{\prime}}\), namely,  
\[\text{T}_{n}=\text{T}_{n}^{loc+sev}=\text{max}\{\{\text{t}_{n}^{loc},\text{t }_{n}^{n^{\prime}}\}=\text{max}\{\alpha_{n}\text{C}_{n}/\text{f}_{n},\beta_{n} \text{C}_{n}/\text{f}_{n^{\prime}}+\beta_{n}\text{D}_{n}\Big{/}\text{R}_{n}^{ v2v}\}. \tag{12}\]  
Due to the fact that tasks are not offloaded to ES, i.e., \(\theta_{n}=0\), thus, \(\alpha_{n}+\beta_{n}=1\), \(0<\{\alpha_{n},\beta_{n}\}<1\). Similarly, when tasks are executed in local and ES, the Loc + Edge mode is entered, and the processing time is  
\[\text{T}_{n}=\text{T}_{n}^{loc+edg}=\text{max}\{\{\text{t}_{n}^{loc},\text{t }_{n}^{edg}\}=\text{max}\{\alpha_{n}\text{C}_{n}/\text{f}_{n},\theta_{n}\text{C}_ {n}\Big{/}\rho_{n}\text{F}^{edg}+\theta_{n}\text{D}_{n}\Big{/}\text{R}_{n}^{ edg}\}, \tag{13}\]  
in the case, \(\beta_{n}=0\), so, \(\alpha_{n}+\theta_{n}=1,0<\{\alpha_{n},\theta_{n}\}<1\). The total processing time of Loc + SeV + EdgeV mode is the maximum one executed locally, offloaded to SeVn and to ES, which can be expressed as \[ \begin{split}\text{T}_{n}=\text{T}_{n}^{loc+sep+edg}=\\ \max\{\text{t}_{n}^{loc},\text{t}_{n}^{r^{\prime}},\text{t}_{n}^{alg}\} =\max\{\alpha_{n}\text{C}_{n}/\text{f}_{n},\beta_{n}\text{C}_{n}/\text{f}_{n^{ \prime}}+\beta_{n}\text{D}_{n}/\text{R}_{n}^{22p},\theta_{n}\text{C}_{n}\Big{/} \rho_{n}\text{F}^{edg}+\theta_{n}\text{D}_{n}\Big{/}\text{R}_{n}^{alg}\}\\ \text{where }\alpha_{n}+\beta_{n}+\theta_{n}=1,0<\{\alpha_{n}, \beta_{n},\theta_{n}\}<1.\end{split}  \tag{14}\]  
The total processing time of a Tav is related to its offloading ratio and the allocated computation resources of ES. We use \(a_{n}=(\alpha_{n},\beta_{n},\theta_{n},\rho_{n})\) to represent the action of a Tav, so the benefit based on the total time can be expressed as  
\[