## 7 Simulation Results and Discussion
Figure 8 shows the number of iterations required to reach a stable matching. Simulation results show that it takes only three iterations and four iterations for the proposed algorithm to converge when \(M=4\) and \(M=5\), respectively. As the number of D2D pairs increases, it takes more iterations for the proposed algorithm to converge. The reason is that both the number of matching candidates and the number of matching conflicts increase along with the number of D2D TR pairs. Thus, it takes more iterations for the proposed algorithm to find a suitable RC unit and reach a stable matching. Figure 9 shows the percentage of served users, which is defined as the number of D2D pairs served successfully by relay stations divided by the total number of D2D pairs. We compare the percentage of served users under two scenarios, i.e., with RSs and without RSs. Matching without RSs means that the D2D TX and the D2D RX communicate directly, and it reuses only one RB. The D2D TX in matching without RSs adopts the optimal transmit power by solving the power allocation problem to maximize the EE. If the QoS requirements of both D2D TR pairs and CUEs cannot be satisfied simultaneously, the D2D TR pairs are blocked and not served. Simulation results show that the proposed algorithm outperforms matching with power control, but without relay and random allocation with fixed power by 18.57% and 72.92%, respectively, when the SINR threshold of D2D links is 28 dB. Figure 9 also shows that the average percentage of served users degrades as the SINR threshold increases. The reason is that it is more difficult to find suitable RBs and RSs for the D2D pairs to satisfy the QoS requirements of both D2D pairs and CUEs simultaneously. Figure 6: A snapshot of user locations for a single cellular network with C CUEs, \(M\) D2D pairs and \(R\) RSs (\(C=8,M=4,R=4\); the cell radius is 300 m, and the size of the spot hot is 30 m, respectively). Figure 7: Energy efficiency of D2D pairs vs. the number of D2D pairs. Figures 10 and 11 show the influence of changing the number of D2D RSs or CUEs to the average energy efficiency of D2D pairs. We compare the proposed algorithm with two heuristic algorithms, i.e., matching with the fixed power algorithm and random allocation with the fixed power algorithm. In Figure 10, when \(R=10\), the proposed algorithm outperforms the matching with the fixed power algorithm and the random allocation with the fixed power algorithm by 129.82% and 567.84%, respectively. It is noted that increasing the number of RSs could significantly improve the performance of the proposed algorithm. For instance, when the number of D2D RSs is increased from 6-10, the performance of proposed algorithm is improved by 29.58%, while the performances of the other two heuristic algorithms are only improved by 24.00% and 2.58%. In Figure 11, when \(C=16\), the proposed algorithm outperforms the matching with the fixed power algorithm and the random allocation with the fixed power algorithm by 134.62% and 767.21%, respectively. Similar to Figure 10, it is clear that increasing the number of CUEs could also dramatically improve the performance of the proposed algorithm. For instance, when the number of CUEs is increased from 12-16, the performance of the proposed algorithm is improved by 47.08%, while the performances of the other two heuristic algorithms are only improved by 39.49% and 2.37%. Thus, the proposed algorithm could receive more benefits from the increasing number of RS and CUE compared to the other two heuristic algorithms. We also consider another single cellular network with a radius of \(R=100\) m, for which the D2D TRs and the RSs are deployed in a circular hot spot area with a radius of \(r=10\) m. In fact, the simulation parameters do not impact the performance results of the proposed algorithm. In other words, the proposed algorithm is adapted to other scenarios, including an indoor scenario. Figure 8: Energy efficiency of D2D pairs vs. the number of matching iterations.