# Social-Aware-Based Resource Allocation for NOMA-Enhanced D2D Communications
## 3 Social-Aware-Based Resource Allocation
### Optimization Model
#### 3.2.1 Channel Allocation  
In this section, we assume that the transmit power of D2D content providers in the D2D cluster is a constant: \(P_{d}^{k}=P_{d}^{k*},\forall k\in\{D\}\). However, if the D2D content provider has not been selected by any D2D content requester, then we have \(P_{d}^{k}=0,\forall k\
otin\{D\}\). Therefore, the channel allocation problem can be modeled as  
\[P_{1} :\ \max_{\eta}\sum_{k\in\{D\}}R_{d}^{k}\Big{(}\eta,P_{d}^{k*}\Big{)}\] (17) s.t. \[\gamma_{\rm m}\geq\gamma_{m}^{th}\quad\forall m \tag{18}\] \[\gamma_{d}^{k}\geq\gamma_{d}^{th}\quad k\in\{D\}\] (19) \[\eta_{m,n}\in\{0,1\}\quad\forall m,n\] (20) \[\sum_{m}\eta_{m,n}\leq 1\quad\forall n\] (21) \[\sum_{n}\eta_{m,n}\leq w\quad\forall m\] (22) \[\rho_{n,n^{\prime}}\in\{0,1\}\quad\forall n \tag{23}\]  
The channel allocation problem can be constructed as a many-to-one matching problem. A D2D cluster can only access one cellular channel and a cellular channel can be reused by no more than \(w\) D2D clusters. The cellular channel chooses to accept or reject the D2D cluster according to its own preference. When all D2D clusters are stably matched or there exist unmatched D2D clusters, but they have been rejected by all cellular channels, the matching ends. The D2D cluster set \(D\) and the cellular channel set \(SC\) form two sets of vertices in the matching game. The matching can be represented as \((D,SC,>_{D},>_{SC})\), where \(>_{D}=\{>_{n}\}_{n\in D}\) indicates the preference relations of the D2D cluster over the cellular channel and \(>_{SC}=\{>_{m}\}_{m\in SC}\) indicates the preference relations of the cellular channel over the D2D cluster. **Definition 1**. : _In the many-to-one matching game, a matching \(\Omega\) is a function from the set \(D\cup SC\) into all subsets of \(D\cup SC\), such that (1) \(\big{|}\Omega(D_{n})\big{|}=1,\Omega(D_{n})\in SC\) and \(\Omega(D_{n})=\phi\) if \(D_{n}\) does not match to any cellular channel; (2) \(0\leq\left|\Omega(SC_{m})\right|\leq w,\Omega(SC_{m})\subset D\) and \(\Omega(SC_{m})=\phi\) if \(SC_{m}\) does not match to any D2D cluster; and (3) \(D_{n}\subset\Omega(SC_{m})\) if only if \(\Omega(D_{n})=SC_{m}\)._  
During the matching game, D2D clusters and cellular channels constantly make new decisions. In order to characterize the behavior of each player, the concept of a preference list can be denoted as  
\[PL=\left\{P(D_{1}),\ldots,P(D_{N}),P(SC_{1}),\ldots P(SC_{M})\right\} \tag{24}\]  
where \(P(D_{n})\) represents the preference list of D2D clusters over cellular channels and \(P(SC_{m})\) represents the preference list of cellular channels over D2D clusters. The order in the preference list is based on the descending order of the utility of players. Therefore, the utility function has a great impact on forming the preference list. For the D2D cluster, whether to reuse the certain cellular channel depends on his data rate on this channel. Therefore, the utility function of the D2D cluster can be defined as  
\[U_{n}=\sum_{k\in D_{n}}R_{d}^{k} \tag{25}\]  
It can be seen from Equation (25) that the utility of the D2D cluster is not only related to the matched cellular channel but also to other D2D clusters that reuse the same cellular channel. Therefore, the preference list of the D2D cluster can be established according to  
\[(SC_{m},\Omega)>_{n}(SC_{m^{\prime}},\Omega^{\prime})\Leftrightarrow U_{n}(SC_{ m},\Omega)>U_{n}(SC_{m^{\prime}},\Omega^{\prime}) \tag{26}\]  
where \(U_{n}(SC_{m},\Omega)\) represents the utility of \(D_{n}\) when reusing \(SC_{m}\) in the matching \(\Omega\). For the cellular channel, whether to accept a D2D cluster depends on the sum rate on the channel. Considering that the optimization goal of this paper is to maximize the throughput of all D2D users, we set the utility of the channel consistent with the optimization goal which is the sum rate of D2D clusters.