# An Efficient Resource Allocation Algorithm for Device-To-Device Communications

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

- (a)
- Establishing a user’s preference list based on distance is not the best option;
- (b)
- It does not take into account the limitations of cellular subscriber quality when assigning resources to cellular users at one time;
- (c)
- Only one D2D pair is allowed to share the spectrum resources of one cellular user, so as the number of D2D users increases, the spectrum utilization cannot be improved;
- (d)
- The simulation environment only considers a single-cell cellular network and does not consider the case of heterogeneous cellular networks.

- It effectively solves the resource allocation shortcomings of D2D users multiplexed with cellular user channels in heterogeneous cellular network environments.
- The algorithm allows multiple D2D users to share the channel resources of one cellular user and ensures the quality of service (QoS) of the cellular users and D2D users by setting the signal to interference and noise ratio (SINR) threshold, in order to improve the utilization of the wireless spectrum.
- A D2D user and channel preference list are established based on the implemented system capacity to maximize the system total capacity objective function.
- The KM algorithm is used to allocate channels for D2D clusters to maximize the total capacity of D2D users [21].

## 2. System Model and Problem Planning

#### 2.1. System Model

#### 2.2. Problem Planning

## 3. Proposed Algorithm

- (a)
- A collection Association of channels and D2D users, the Association(k) indicates that channel k contains already matched D2D users;
- (b)
- $\mathit{D}$ list of channels that D2D users most want to multiplex, $\mathit{P}\mathit{r}\mathit{e}=\left[{\mathit{\delta}}_{\mathbf{1}},{\mathit{\delta}}_{\mathbf{2}},\dots ,{\mathit{\delta}}_{\mathit{k}},\dots ,{\mathit{\delta}}_{\mathit{D}}\right]$, the user preference list shows that ${\mathit{\delta}}_{\mathit{k}}$ is the first element of the Due_list(k) list;
- (c)
- Define Cluster(k) as the set of D2D user pairs that currently want to multiplex channel k. For example, Cluster(k) = {1, 3, 4} means that the current 1, 3, and 4 D2D user pairs most want to multiplex channel k, i.e., $\mathit{\delta}\left(\mathit{d}\right)\mathit{=}k\text{}\left(\forall \text{}\mathit{d}\in \right)$ Cluster(k);
- (d)
- No matching D2D user representation of the set as UNMATCH;
- (e)
- The total number of channels N, the number of iterations is Iteration, and the maximum number of iterations is MAXGEN.

Algorithm 1 M21GS Algorithm |

1: Initialization: Set system parameters such as the number of users, transmit power, path loss, etc., to allocate channels for macro cell users and micro cell users. |

2: Establish user preference list Due_list, channel preference list Channel_list, initialization parameters Association, Cluster, UNMATCH. |

3: While iteration < MAXGEN do |

4: if UNMATCH = Ø |

5: for k = 1 to N do |

6: Set D2D user k on current channel S = 0 |

7: if Cluster(k) ≠ Ø and S ≤ 2 |

8: Find from the set Cluster(k) according to the channel k preference list Channel_list(k) to the highest priority D2D user d |

9: Calculate the objective function of the macrocell, microcell and D2D users using Equation (6) |

10: Determine the SINRs of the macrocell user, microcell and D2D user using Equation (7)–(9) |

11: Assign the channel to the microcell user if Equations (10) is satisfied |

12: Assign the channel to the D2D users if Equation (11) is satisfied |

13: if the constraints of Equations (7)–(11) are satisfied |

14: Association(k) = Association(k) $\cup $ {d} |

15: UNMATCH = UNMATCH$-${d} |

16: S = S + 1 |

17: else |

18: Due_list(d) = Due_list(d) $-{\mathit{\delta}}_{\mathit{d}}$, update $\mathit{P}\mathit{r}\mathit{e}$ and Cluster(k) |

19: end |

20: Cluster(k)=Cluster(k) $-$ {d} |

21: end |

22: for r ∈ Cluster(k) |

23: Due_list(r) = Due_list(r) $-{\mathit{\delta}}_{\mathit{r}}$ |

24: end |

25: end |

26: if Due_list(w) = Ø (w ∈ H) |

27: UNMATCH=UNMATCH$-${w} |

28: end |

29: end |

30: Iteration = Iteration+1 |

31: End |

32: Use the KM algorithm to achieve the optimal matching between D2D clusters and cellular users’ channels [21]. |

- (a)
- First initialize the D2D user and channel preference list, set Association, unmatched D2D pair set UNMATCH, transmit power, and other parameters.
- (b)
- Lines 3–27 are the core part of the algorithm, and the loop will only terminate if the maximum number of iterations is reached. Lines 7–17 of the algorithm indicate that for each subchannel k, first find a D2D user pair d that currently wants to multiplex channel k from the set Cluster(k), and then check if the user pair satisfies Equations (7)–(11) constraints. If the condition is met, continue to add to the Association(k) according to the preference list of channel k D2D users until there are two D2D pairs and channel k share resources, otherwise update the D2D user preference list, Cluster(k) and Pre.
- (c)
- Lines 18–20 of the algorithm indicate that there are already two D2D pairs on channel k. If there is a D2D pair r in the set Cluster(k) that wants to multiplex channel k, then channel k refuses to allocate resources to the D2D pair r, updating the D2D pair r preference list.
- (d)
- Lines 22~24 of the algorithm indicate that in the final stage of the algorithm, some D2D users cannot find suitable channel resources due to the limitation of the signal-to-noise ratio threshold. This article also assumes that such users have found the right resources to remove these D2D users from the collection UNMATCH.

## 4. Simulation Results

#### 4.1. Simulation Environment Establishment

#### 4.2. Complexity and Performance Analysis

#### 4.2.1. Complexity Analysis

- (a)
- The complexity of the random resource allocation algorithm increases linearly with the increase of the number of cellular users, that is, $\mathit{\mathcal{O}}\left(\mathit{C}\right)$ (where $\mathit{C}$ is the number of macro cellular users), and the algorithm calculates the lowest amount.
- (b)
- The worst-case complexity of the DARA scheme [16] is $\mathit{\mathcal{O}}\left({\mathit{C}}^{\mathbf{2}}\right)$, and the average complexity is $\mathit{C}\mathbf{log}\left(\mathit{C}\right)$.
- (c)
- The optimal algorithm is an exhaustive search algorithm that satisfies the constraints, and needs to traverse all possible allocation methods with the highest computational amount.
- (d)
- The complexity of the CG algorithm [20] is $\mathit{\mathcal{O}}\left(\mathit{N}\right)$ where $\mathit{N}$ is the number of channels.
- (e)

#### 4.2.2. Performance Analysis

## 5. Discussion

^{8}bps capacity. When the number of channels is 20, the proposed algorithm reaches its peak capacity of 1.25 × 10

^{8}bps at Iteration = 7. Finally, when the number of channels is 30, the proposed allocation algorithm reaches the peak capacity of 1.9 × 10

^{8}bps at Iteration =12. Such results give us important information about the impact of the number of iterations on the total system capacity. It means that for a higher system capacity requirement when the number of channels is increased, the number of iterations should also be increased to reach the peak capacity value. On the other hand, the existing algorithms require a large number of iterations to give the same capacity, which makes them unsuitable for the D2D communications. The impact of the number of iterations on energy efficiency is illustrated in Figure 7. The results indicate the effectiveness of the proposed algorithm over the existing algorithms. The energy efficiency of the proposed algorithm is almost independent of the number of iterations and stable at 58 Mbit/J which makes it robust against hardware impairments and channel limitations. On the other hand, the scheme in reference [20] reaches an energy efficiency of 50 Mbit/J at Iteration = 13. The algorithm in reference [16] requires MAXGEN= 10 to reach its peak energy efficiency of 43 Mbit/J, whereas the random resource allocation algorithm requires MAXGEN=15 to reach its peak energy efficiency of 33Mbit/J. By comparative assessment of both results in Figure 6 and Figure 7, the proposed scheme requires a smaller number of Iterations to provide an improved performance than the other competing alternatives. Therefore, system performance can be controlled to an optimal outcome by setting the number of Iterations to a particular required value. Figure 9 and Figure 10 further elaborate on the effectiveness of the proposed algorithm.

## 6. Conclusions and Future Recommendations

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Alemaishat, S.; Saraereh, O.A.; Khan, I.; Choi, B.J. An Efficient Resource Allocation Algorithm for D2D Communications Based on NOMA. IEEE Access
**2019**. [Google Scholar] [CrossRef] - Lee, B.M.; Patil, M.; Hunt, P.; Khan, I. An Easy Network Onboarding Scheme for Internet of Things Networks. IEEE Access
**2019**, 7, 8763–8772. [Google Scholar] [CrossRef] - Jameel, F.; Risniemi, T.; Khan, I.; Lee, B.M. Simultaneous Harvest-and-Transmit Ambient Backscatter Communications Under Rayleigh Fading. EURASIP Jour. Wir. Com. and Net.
**2019**, 166, 1–9. [Google Scholar] [CrossRef] - Al-Sharif, M.H.; Kelechi, A.H.; Kim, S.; Khan, I.; Kim, J.; Kim, J.H. Enabling Hardware Green Internet of Things: A Review of Substantial Issues. IEEE Access
**2019**. [Google Scholar] [CrossRef] - Jabeen, T.; Ali, Z.; Khan, W.U.; Jameel, F.; Khan, I.; Sidhu, G.A.S.; Choi, B.J. Joint Power Allocation and Link Selection for Multi-Carrier Buffer Aided Relay Network. Electronics
**2019**, 8, 686. [Google Scholar] [CrossRef] - Trigui, I.; Affes, S. Unified Analysis and Optimization of D2D Communications in Cellular Networks Over Fading Channels. IEEE Trans. Commun.
**2019**, 67, 724–736. [Google Scholar] [CrossRef] - Shamaei, S.; Bayat, S.; Hemmatyar, A.M.A. Interference Management in D2D-Enabled Heterogeneous Cellular Networks Using Matching Theory. IEEE Trans. Mob. Comput.
**2019**, 18, 2091–2102. [Google Scholar] [CrossRef] - Lee, W.; Ban, T.W.; Jung, B.C. Distributed Transmit Power Optimization for Device-to-Device Communications Underlying Cellular Networks. IEEE Access
**2019**, 7, 87617–87633. [Google Scholar] [CrossRef] - Gui, J.; Zhou, K. Cellular Throughput Optimization by game-based power adjustment and outband D2D communication. EURASIP J. Wirel. Commun. Netw.
**2018**, 254, 1–25. [Google Scholar] [CrossRef] - Kim, S. A New Multicasting Device-to-Device Communication Control Scheme for Virtualized Cellular Networks. Wirel. Commun. Mob. Comput.
**2019**, 3550674, 1–9. [Google Scholar] [CrossRef] - Ramezani-Kebrya, A.; Dong, M.; Liang, B.; Boudreau, G.; Seyedmehdi, S.H. Joint power optimization for device-to-device communication in cellular networks with interference control. IEEE Trans. Wirel. Commun.
**2017**, 16, 5131–5146. [Google Scholar] [CrossRef] - Wang, F.; Li, Y.; Wang, Z.; Yang, Z. Social-community-aware resource allocation for D2D communication underlying cellular networks. IEEE Trans. Veh. Technol.
**2016**, 65, 3628–3640. [Google Scholar] [CrossRef] - Tang, F.; Fadlullah, Z.M.; Kato, N.; Ono, F.; Miura, R. AC-POCA: Anticorrelation game based partially overlapping channels assignment in combined UAV and D2D-based networks. IEEE Trans. Veh. Technol.
**2018**, 67, 1672–1683. [Google Scholar] [CrossRef] - Ma, R.; Xia, N.; Chen, H.H.; Chiu, C.Y.; Yang, C.S. Mode selection radio resource allocation, and power coordination in D2D communications. IEEE Wirel. Commun.
**2017**, 24, 112–121. [Google Scholar] [CrossRef] - Islam, M.T.; Taha, A.E.M.; Akl, S.; Choudhury, S. A Local Search Algorithm for Resource Allocation for Underlying Device-to-Device Communication. In Proceedings of the IEEE Global Communication Conference (GLOBECOM), San Diego, CA, USA, 6–10 December 2015; pp. 1–6. [Google Scholar]
- Islam, M.T.; Taha, A.E.M.; Akl, S.; Abu-Elkheir, M. A Stable Matching Algorithm for Resource Allocation for Underlying Device-to-Device Communications. In Proceedings of the IEEE International Conference on Communications (ICC), Kuala Lumpur, Malaysia, 23–27 may 2016; pp. 1–6. [Google Scholar]
- Hasan, M.; Hossain, E. Distributed Resource Allocation in D2D-enabled multi-tier cellular networks: An auction approach. In Proceedings of the IEEE International Conference on Communications (ICC), London, UK, 8–12 June 2015; pp. 2949–2954. [Google Scholar]
- Zhang, R.; Cheng, X.; Yang, L.; Jiao, B. Interference-aware graph-based resource sharing for Device-to-Device communications underlying cellular networks. In Proceedings of the IEEE Wireless Communications and Networking Conference, Shanghai, China, 7–10 April 2013; pp. 140–145. [Google Scholar]
- Sun, H.; Wildemeersch, M.; Sheng, M.; Quek, T.Q. D2D enhanced heterogeneous cellular networks with dynamic TDD. IEEE Trans. Wirel. Commun.
**2015**, 14, 4204–4218. [Google Scholar] [CrossRef] - Gurobi. Optimization—The Best Mathematical Programming Solver. Available online: http://www.gurobi.com (accessed on 13 June 2019).
- Gale, G.; Shapley, L.S. College admissions and the stability of marriage. Am. Math. Mon.
**1962**, 69, 9–15. [Google Scholar] [CrossRef] - Feng, D.; Lu, L.; Yuan-Wu, Y.; Li, G.Y.; Feng, G.; Li, S. Device-to-Device Communications Underlaying Cellular Networks. IEEE Trans. Commun.
**2013**, 61, 3541–3551. [Google Scholar] [CrossRef] - Recommendation, I.R. Guidelines for Evaluation of Radio Transmission Technologies for IMT-2000; International Telecommunication Union: Geneva, Switzerland, 1997. [Google Scholar]
- Saleem, U.; Jangsher, S.; Qureshi, H.K.; Hassan, S.A. Joint Subcarrier and Power Allocation in the Energy-Harvesting-Aided D2D Communication. IEEE Trans. Ind. Inform.
**2018**, 14, 2608–2617. [Google Scholar] [CrossRef] - Chen, Y.; Ai, B.; Niu, Y.; Guan, K.; Han, Z. Resource Allocation for Device-to-Device Communications Underlaying Heterogeneous Cellular Networks Using Coalitional Games. IEEE Trans. Wirel. Commun.
**2018**, 17, 4163–4176. [Google Scholar] [CrossRef] - Abdallah, A.; Mansour, M.M.; Chehab, A. Power Control and Channel Allocation for D2D Underlaid Cellular Networks. IEEE Trans. Commun.
**2018**, 66, 3217–3234. [Google Scholar] [CrossRef] [Green Version]

**Figure 2.**Comparison of the total system capacity under different number of channels of the algorithms.

**Figure 10.**Comparison of the sum rate of the algorithms under the average transmission power of D2D users.

D2D User Pair | Preference Level | ||||
---|---|---|---|---|---|

1 | 2 | 3 | 4 | 5 | |

1 | 3 | 4 | 5 | 1 | 2 |

2 | 3 | 5 | 2 | 4 | 1 |

3 | 1 | 2 | 3 | 5 | 4 |

Parameter | Value |
---|---|

Cell Radius | 1000 m |

Number of channels that D2D users can share | 2 |

Macrocell subscribers (number of channels) | 10~50 |

Microcell base station density | 10^{−5}/m^{2} |

Channel bandwidth | 0.18 MHz |

D2D user transmit power | 20 dBm |

Macro and micro cell user transmit power | 20 dBm |

Gaussian white noise density | −174 dBm/Hz |

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Saraereh, O.A.; Mohammed, S.L.; Khan, I.; Rabie, K.; Affess, S.
An Efficient Resource Allocation Algorithm for Device-To-Device Communications. *Appl. Sci.* **2019**, *9*, 3816.
https://doi.org/10.3390/app9183816

**AMA Style**

Saraereh OA, Mohammed SL, Khan I, Rabie K, Affess S.
An Efficient Resource Allocation Algorithm for Device-To-Device Communications. *Applied Sciences*. 2019; 9(18):3816.
https://doi.org/10.3390/app9183816

**Chicago/Turabian Style**

Saraereh, Omar A., Saleem Latteef Mohammed, Imran Khan, Khaled Rabie, and Sofeine Affess.
2019. "An Efficient Resource Allocation Algorithm for Device-To-Device Communications" *Applied Sciences* 9, no. 18: 3816.
https://doi.org/10.3390/app9183816