# An Efficient Resource Allocation Algorithm for Device-To-Device Communications
## 4 Simulation Results
### Complexity and Performance Analysis
#### 4.2.2 Performance Analysis  
The simulation in Figure 2 compares the total system capacity of the five resource allocation algorithms. As can be seen from the figure, the total system capacity becomes larger as the number of channels increases. When the number of channels is constant, the total system capacity of the proposed algorithm is better than that of references [16; 20] and the random resource allocation algorithm that approximates the optimal solution. Because the proposed algorithm allows multiple D2D users to multiplex the same cellular user channel resource, the total system capacity obtained is better than the algorithm in references [16; 20], and the random resource allocation algorithm is only random under the premise of guaranteeing the quality of user communication service. Resource allocation is not optimized for system capacity, so performance is the worst. The simulation in Figure 3 compares the maximum allowable number of D2D users allowed by the five allocation algorithms. It can be seen from Figure 3 that the maximum number of D2D users allowed by the proposed algorithm is better than that of the algorithm [16; 20] and the random allocation algorithm, but it does not reach the theoretical (optimal) value. Because the proposed  
Figure 2: Comparison of the total system capacity under different number of channels of the algorithms. algorithm can achieve one-to-many matching between the channel and D2D users, it can enable more D2D users to communicate at the same time. However, due to the limitation of the SINR threshold, the number of allowable D2D users cannot reach the theoretical value. Figure 4 shows the comparison of the sum rate of the five algorithms under different number of D2D pairs. It can be seen from Figure 4 that as the number D2D pairs increases, the sum rate of all the algorithm increases. Moreover, as can be seen from the Figure, the sum rate of the proposed M2 IGS algorithm shows better sum-rate performance than DARA algorithm [16], CG algorithm [20] and Random Resource Allocation Algorithm under the same number of D2D pairs which makes it more suitable in D2D deployment scenarios. The results also show that the proposed algorithm has a close relation with optimal results, which also validates the analytical derivations. The simulation results in Figure 5 show the effect of the SINR threshold on the total system capacity. As can be seen from the figure, the total system capacity becomes smaller as the SINR threshold increases. When the SINR threshold exceeds 10 dB, the total system capacity does not change  
Figure 4: Comparison of the sum rate of the algorithms under different number of D2D users. Figure 3: Comparison of the maximum allowable number of D2D users of the algorithms. and reaches a minimum. This means that in order to guarantee the communication service quality of the cellular users, it is not allowed to allocate channel resources for D2D users to communicate, and only macro cellular users and micro cellular users can communicate. Furthermore, the results also indicate that the proposed M2 IGS algorithm gives better total system capacity for all values of SINR than CG [20], DARA [16] and Random Resource Allocation Algorithm and also has a close relation with optimal results. The simulation results in Figure 6 show that the proposed algorithm has faster convergence. It can be seen from Figure 6 that the total system capacity gradually increases with the number of iterations. When a certain number of iterations is reached, the total system capacity tends to be stable, indicating that all D2D users have been allocated. The more D2D users in the system, the more iterations are required, but in general, the number of iterations required for the algorithm to converge is small, 5-8 times can converge, and the computational complexity is low. Figure 5: Impact of SINR threshold on total system capacity. Figure 6: The convergence of the proposed algorithm.