# A Hierarchical Resource Allocation Scheme Based on Nash Bargaining Game in VANET
## 2 Hierarchical Resource Allocation Scheme Based on Nash Bargaining Game
### The Formulation of Hierarchical Resource Allocation Scheme in VANET
#### 2.2.2 Resources Allocation for VUEs in the Second Layer  
According to the spectrum resources allocated in the first layer, the spectrum resources obtained by the \(k\)th RSU is \(b_{k}^{*}\). In order to improve the utilization of spectrum resources, each RSU network adopts the multiuser orthogonal frequency-division multiplexing (OFDM) systems [21]. Hence, continuous spectrum resources are divided into several slices of virtual resources in the form of orthogonal subcarriers in the RSUs cloud. Meanwhile, transmission power is distributed to each VUEs. We assume that each RSU's subcarrier has the same bandwidth, the subcarrier bandwidth of the \(k\)th RSU is \(\omega_{k}^{0}\). The number of subchannel resources in the \(k\)th RSU is  
\[C^{k}=\left\lfloor\frac{b_{k}^{*}}{w_{k}^{0}}\right\rfloor \tag{10}\]  
\(\lfloor\cdot\rfloor\) means the integer down. We use \(\mathcal{N}_{k}=\{1,2,...,N_{k}\}\) to represent the set of VUEs in the \(k\)th RSU. We assume that the benefits set of VUEs in bargaining cooperation is \(\mathbf{r}\). \(\mathbf{r}_{min}=\{r_{1}^{min},r_{2}^{min},...,r_{N_{k}}^{min}\}\) is the disagreement point, which is the minimum benefit set that VUEs are willing to accept. Therefore, the Nash bargaining game of the second layer resource allocation issue can be represented by \((N_{k},\mathbf{r},\mathbf{r}_{min})\). In order to guarantee the efficiency and fairness of the resources allocation at the VUEs layer, we formulate the resource allocation optimization problem as  
\[ \begin{split}&\text{max }\ f_{2}(\mathbf{c}^{k},\mathbf{p}^{k})=\prod\limits_{i=1}^{N_{k}}\left( \sum\limits_{j=1}^{c_{i}^{k}}a_{i,j}w_{k}^{0}\text{log}_{2}\left(1+\eta\frac{ p_{ij}|g_{ij}|^{2}d_{ij}^{-\beta}}{\sigma^{2}}\right)-r_{i}^{min}\right)\\ & s.t.\ C4:\ \sum\limits_{j=1}^{c_{i}^{k}}w_{k}^{0}\text{log}_{2} \left(1+\eta\frac{p_{ij}|g_{ij}|^{2}d_{ij}^{-\beta}}{\sigma^{2}}\right)\geq r _{i}^{min}\\ &\ C5:\ \sum\limits_{i=1}^{N_{k}}\sum\limits_{j=1}^{c_{i}^{k}}p_{ij} \leq p^{max}\\ &\ C6:\ \sum\limits_{i=1}^{N_{k}}c_{i}^{k}\leq C^{k}\\ & C7:\ \ c_{i}^{k}\in{}^{+},\ \ p_{i,j}\in\mathbb{R}^{+}\\ & C8:\ \ P_{i}^{k}=\sum\limits_{j=1}^{c_{i}^{k}}P_{i,j}^{k}\\ & C9:\ \ a_{i,j}\in\{0,1\}\end{split}  \tag{11}\]  
Formula (11) represents the optimization problem of resource allocation to VUEs at the second layer. \(\mathbf{c}^{k}=\{c_{1}^{k},c_{2}^{k},...,c_{N_{k}}^{k}\}\) is the strategy vectors of VUEs in the \(k\)th RSU for subcarrier allocation. \(\mathbf{p}^{k}=\{p_{1}^{k},p_{2}^{k},...,p_{N_{k}}^{k}\}\) is the strategy vector of VUEs in the \(k\)th RSU for transmission power allocation. \(a_{i,j}\in\{0,1\}\) denotes whether subchannel \(j\) is assigned to VUE \(i\) or not (i.e., if subchannel \(j\) is assigned to VUE \(i\), \(a_{i,j}=1\); otherwise, \(a_{i,j}=0\)). \(|g_{i,k}|^{2}\) and \(d_{ij}^{-\beta}\) represent the channel gain and transmission distance between RSUs and VUEs, respectively. \(\beta\) is the decay coefficient of distance. \(\eta\) is the modulation coefficients of subcarriers, we assume that this coefficient is equal to \(c_{1}\) in Formula (2). According to the above analysis, we can achieve a proportional fairness resources allocation in VANET. However, the above resource allocation analysis does not take into account the differences of VUEs, that means the services requested from RSUs by VUEs are different from each other. On the other hand, the performance of RSUs is different with each other. Different VUEs should have different performance requirements in different RSUs. For example, latency and jitter may be more important than throughput for a VUE requested the online game. A low-latency RSU is more suitable for transmitting voice services, and the low jitter RSU is more suitable for video stream transmission services. However, in most previous studies, the benefit function of VUEs just depend on the power and the number of subcarriers allocated. As shown in formula 11, VUEs obtaining the same amount of resources have the same benefits, which does not take into account differences of VUEs.