## 2 System Model
### Resource Allocation Algorithm  
Each available RB in the network needs to select a D2D pair in its intended user set to act as the actual user aimed to achieve a high system throughput performance. One intended user set may have multiple D2D pairs in accordance with the clustering rules, and some RBs have few intended users due to poor uplink states. To reduce the complexity of the algorithm, we have the following definition. Definition 5: Each row and column of the matching matrix \(\beta^{CD}\)have one '\(T\)' at most after resource allocation, so the number of RBs allocated to a D2D pair is no more than one whilst one RB only can be reused by one D2D pair simultaneously in a scheduling period as well. \[\sum_{i=1}^{N}\beta^{CD}_{i,j}\leq 1,\forall j\in X \tag{17}\]  
\[\sum_{j=1}^{M}\beta^{CD}_{i,j}\leq 1,\forall i\in Y \tag{18}\]  
Accordingly, D2D pairs would never reuse the same RB and the interference between D2D pairs do not exist, that is \(I_{id}^{i}=0\). The actual user set of one cluster is denoted as \(U_{j}^{D}\) and the number of D2D pairs in \(U_{j}^{D}\) shall be no more than 1, according to the definition given as \(\text{card}\left(U_{j}^{D}\right)\leq 1\) and \(U_{j}^{D}\subseteq S_{j}\) for \(\forall j\in X\). Thus, the optimization problem of system throughput in (6) can be rewritten as  
\[\text{max}R_{i,j}^{B} \tag{19}\]  
s.t. (7)-(10), (17) and (18). **Definition 6**. : _The efficient allocation that maximizes the system throughput is denoted as \(B^{*}=argmax\Big{(}R_{i,j}^{B}\Big{)}\)._  
D2D pairs share RBs with CUs to promote the system throughput on the premise that the performance of CUs is ensured to be normal. To describe the allocation result of D2D pairs and RBs intuitively, we have the example of allocation with \(M=6\) and \(N=5\) as  
\[\beta^{CD}=\left[ \begin{array}{cccccc}0&1&0&0&0&0\\ 1&0&0&0&0&0\\ 0&0&0&1&0&0\\ 0&0&0&0&1&0\\ 0&0&1&0&0&0\end{array} \right]\]  
Recalling that corresponding receivers obtained the CSI of D2D pairs and CUs and fed back to the BS, the resource allocation is implemented based on the acceptable interference for both D2D pairs and CUs, which is accompanied by interference problem. The BS selects proper RBs to D2D pairs whenever SINR of D2D links and cellular links are satisfied. The details of resource allocation are shown in Table 1 as follows. Note that, if weight value of D2D pairs is equal to 1 in some clusters, this signifies that these clusters have only one D2D pair, so the RBs corresponded to these clusters have only one intended user. In such a case, these clusters have priority to reuse RBs for fairness. Thus, steps 8 and 9 are implemented for clusters with one D2D pair. From the steps of the algorithm shown above, we can note that the weight value of D2D pairs is not fixed in different allocation periods. If a D2D pair is chosen by one RB and eliminated in other intended user sets, the weight of the remaining D2D pairs in those intended user sets are changed in the next period. Thus, the allocation of RBs is implemented once in an allocation period and implemented \(M\) times at most for all RBs after allocation. The matching matrix that can denote the efficient allocation is obtained as well as the actual user set \(U_{j}^{D}\) of each RB.