## 2 System Models
Similarly, the SINR of the \(l\)th relay station to the receiver of D2D pair can be expressed by:  
\[\gamma_{l,u_{l},2}^{(n)}~{}=~{}\frac{P_{l,u_{l}}^{(n)}h_{l,u_{l}}^{(n)}}{\sum \limits_{ \begin{array}{c}\forall u_{j}\in U_{j}\\ j\
eq l,j\in L\end{array} }x_{u_{j}}P_{j,u_{l}}^{(n)}g_{j,u_{l}}^{(n)}+\sigma ^{2}}. \tag{5}\]  
In Equations (3) and (5), the SINR for all links will be obtained. After this, After this, the throughput (Kbps) of the first hop can be derived by:  
\[r_{u_{l},1}^{(n)}~{}=~{}B_{RB}\log_{2}(1+\gamma_{u_{l},l,1}^{(n)}). \tag{6}\]  
Similarly, the throughput of the second hop can be obtained by:  
\[r_{u_{l},2}^{(n)}~{}=~{}B_{RB}\log_{2}(1+\gamma_{u_{l},l,2}^{(n)}). \tag{7}\]  
Thus, the throughput for the \(n\)th RB by the user \(u_{l}\) can be obtained by:  
\[R_{u_{l}}^{(n)}~{}=~{}\frac{1}{2}\text{min}\Big{\{}r_{u_{l},1}^{(n)},r_{u_{l},2}^{(n)}\Big{\}}. \tag{8}\]  
According to Equation (8), the total throughput of \(N\) RBs is \(\sum\limits_{l\in L}\sum\limits_{u_{l}\in U_{l}}\sum\limits_{n=1}^{N}x_{u_{l} }^{(n)}R_{u_{l}}^{(n)}\). All UEs are desired to obtain the RBs to reach the maximal throughput. Therefore, to avoid deterioration of the communication quality, a threshold \(Q_{u_{l}}\) is set to meet the required throughput for most UEs. Some constraints are set to perform the optimization problem as:  
\[s.t.\left\{\begin{array}{ll}\sum\limits_{\begin{array}{c}u_{l}\in U_{l} \\ \sum\limits_{ \begin{array}{c}u_{l}\in U_{l}\\ \sum\limits_{\begin{array}{c}N\\ n\equiv 1\end{array}}x_{u_{l}}^{(n)}P_{u_{l},l}^{(n)}\leq P_{u_{l}}^{\max},\\ \sum\limits_{\begin{array}{c}N\\ n\equiv 1\end{array}}x_{l}^{(n)}P_{l,u_{l}}^{(n)}\leq P_{l}^{\max},\\ R_{u_{l}}\geq Q_{u_{l}},\end{array} \right.\forall u_{l}\in U_{l} \tag{9}\]  
where Equation (9) set the constraints for that each UE use only one RB and the constraints on the minimum power for UEs and relay stations. Moreover, Equation (9) is the minimum throughput requirements of QoS for UEsMoreover, the interference of the first hop and the second hop for system is expressed by:  
\[I_{u_{l},l,1}^{(n)}\ =\ \ \sum_{ \begin{array}{c}\forall u_{j}\in U_{j}\\ j\
eq l,j\in L\end{array} }\ \ x_{u_{j}}P_{u_{j}j}^{(n)}\mathcal{S}_{u_{j},l}^{(n)} \tag{10}\]  
and  
\[I_{u_{l},l,2}^{(n)}\ =\ \left\{ \begin{array}{c}\sum\limits_{\begin{array}{c} \forall u_{j}\in U_{j}\\ j\
eq l,j\in L\\ \sum\limits_{\begin{array}{c}\forall u_{j}\in U_{j}\\ j\
eq l,j\in L\end{array}}x_{u_{j}}P_{j\mu_{j}}^{(n)}\mathcal{S}_{j\mu_{l}}^{ (n)},\end{array}}\ \ u_{l}\in\{D\cap U_{l}\}\\ \end{array} \right.\, \tag{11}\]  
respectively. In the system model, it is assumed that the base station coverage area is a circle with a radius of 175 m. In this area, there are three relay stations that are uniformly deployed with a triangle, as shown in Figure 1. The coverage area of each relay station is a circle with a radius of 100 m. The cellular UEs are uniformly and randomly distributed around the relay station. D2D pairs are deployed on a circle with a radius of 80 m around each relay station as shown in Figure 2. The numbers of UEs in the relay station are the same. It is assumed that the CSI of the links are known to the base station. The simulation parameters are listed in Table 1.