## 5 Methodology
### Max-Min Fairness Oriented Offloading Approach
Finally, the proportion allocated to vehicle \(sv_{j}\) can be calculated as \(O^{final}_{j}=\sum O^{k}_{j}\), where \(k\) stands for the number of allocation rounds. The pseudo-code of this method is shown in Algorithm 1. Lines 3-9 of Algorithm 1 show the subset filtering process, where \(vol\) represents the maximum task proportion volume that each subset can complete, and only subsets that can complete the whole task can be kept for further consideration. Lines 10-15 show the specific process for determining the offloading proportions and costs on the subsets filtered by the above process. Finally, lines 16-23 sort the executable subsets according to the cost they charge for the UV and the subset with the lowest cost is returned as the final offloading decision. ```
0:\(T_{0}\), \(\boldsymbol{SV}\), \(O^{max}_{j}\), \(p_{j}\)
0: the offloading decision
1: Divide \(\boldsymbol{SV}\) into \((2^{K}-1)\) subsets, denoted as \(\boldsymbol{SV}=\{\boldsymbol{sb_{1}},\boldsymbol{sb_{2}},\ldots,\boldsymbol{ sb_{2}}\boldsymbol{r_{-1}}\}\);
2:\(i=1\);
3:while\((i\leq 2^{K}-1)\)do
4:\(vol=\sum_{sv_{j}\in\boldsymbol{sb_{l}}}O^{max}_{j}\);
5:if\(vol<1\)then
6:\(\boldsymbol{SV}=\boldsymbol{SV}\backslash\{\boldsymbol{sb_{l}}\}\);
7:endif
8:\(i=i+1\);
9:endwhile
10:\(m=1\);
11:while\((m\leq|\boldsymbol{SV}|)\)do
12: determine the final proportions allocated on vehicles in subset \(sb_{m}\) according to Equation (22)-(24), and denote the proportion allocation vector as \(\boldsymbol{pv}=(O^{final}_{1},O^{final}_{2},\ldots,O^{final}_{|\boldsymbol{ sb_{m}}|})\);
13:\(P_{m}=\sum_{j=1}^{|\boldsymbol{sb_{m}}|}p_{j}\cdot O^{final}_{j}\cdot D_{0}\);
14:\(m=m+1\);
15:endwhile
16:\(P^{*}=P_{1}\), \(ns=1\), \(i=2\);
17:while\((i\leq|\boldsymbol{SV}|)\)do
18:if\(P^{*}>P_{i}\)then
19:\(P^{*}=P_{i}\), \(ns=i\);
20:endif
21:\(i=i+1\);
22:endwhile
23:The \(ns^{th}\) subset with the corresponding proportion allocation result is the final offloading decision. The Max-Min fairness task allocation requires to be executed \([|\mathbf{s}\mathbf{b}_{\mathbf{m}}|\cdot(|\mathbf{s}\mathbf{b}_{\mathbf{m}}|+1)]/2\) times for subset \(\mathbf{s}\mathbf{b}_{\mathbf{m}}\), and \(2^{K}\cdot K^{2}\) times for the whole set \(\mathbf{SV}\), thus, the complexity of Algorithm 1 is of the order \(\mathcal{O}(2^{K})\). To further reduce the complexity, we propose a heuristic algorithm as shown in Algorithm 2, whose complexity is reduced to the order of \(\mathcal{O}(K^{2})\), where \(K\) is the number of vehicles that respond to \(u_{0}\)'s request. ```
0:\(T_{0},\mathbf{SV},O_{j}^{max},\,p_{j}\)
0: the offloading decision
1: Sort vehicles in \(\mathbf{SV}\) ascendingly according to their asking prices;
2:\(vol=0\), \(j=1\);
3:while\((j\leq|\mathbf{SV}|\)&&\(vol<1)\)do
4:\(vol=vol+O_{j}^{max}\);
5:\(j=j+1\);
6:endwhile
7:\(J=j-1\);
8: determine the final proportions allocated on vehicles in subset \(\mathbf{ns}=\left\{sv_{1},sv_{2},\ldots,sv_{J}\right\}\) according to Equations (22)-(24), and denote the proportion allocation vector as \(\mathbf{pv}=(O_{1}^{final},O_{2}^{final},\ldots,O_{l}^{final})\);
9: The subset \(ns\) with the corresponding proportion allocation result is the final offloading decision. ```

**Algorithm 2** A heuristic algorithm for task allocation

The vehicles in \(\mathbf{SV}\) are sorted ascendingly according to the prices asked by them (line 1). After that, vehicles are sequentially checked and the sum of the proportions that are allocated to them is compared with the total size of the computation task. The checking stops when the checked vehicles can complete the computation task together (lines 2-6). Finally, the Max-Min fairness allocation is performed on these vehicles and the final offloading decision is made (lines 7-9). ## 6 Performance Evaluation

In this section, we evaluate the performance of the proposed approach and compare it with referenced algorithms as follows:

1.