A Joint Algorithm for Resource Allocation in D2D 5G Wireless Networks

With the rapid development of Internet technology, users have an increasing demand for data.The continuous popularizationof traffic-intensive applications such as high-definition video, 3D visualization, and cloud computing has promoted the rapid evolution of the communications industry. In order to cope with the huge traffic demand of today’s users, 5G networks must be fast, flexible, reliable and sustainable. Based on these research backgrounds, the academic community has proposed D2D communication. The main feature of D2D communication is that it enables direct communication between devices, thereby effectively improve resource utilization and reduce the dependence on base stations, so it can effectively improve the throughput of multimedia data. One of the most considerable factor which affects the performance of D2D communication is the co-channel interference which results due to the multiplexing of multiple D2D user using the same channel resource of the cellular user. To solve this problem, this paper proposes a joint algorithm time scheduling and power control. The main idea is to effectively maximize the number of allocated resources in each scheduling period with satisfied quality of service requirements. The constraint problem is decomposed into time scheduling and power control subproblems. The power control subproblem has the characteristics of mixed-integer linear programming of NP-hard. Therefore, we proposed a gradual power control method. The time scheduling subproblem belongs to the NP-hard problem having convex-cordinality, therefore, we proposed a heuristic scheme to optimize resource allocation. Simulation results show that the proposed algorithm effectively improved the This work is licensed under a Creative Commons Attribution 4.0 International License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. 302 CMC, 2021, vol.69, no.1 resource allocation and overcome the co-channel interference as compared with existing algorithms.

However, when multiple D2D links reuse the same resource, co-channel interference problems will occur. How to solve this problem becomes the key to D2D communication. The resource allocation can coordinate user interference and effectively alleviate the above problems [31,32]. In the existing literature, the authors [33] puts forward a channel selection strategy that maximizes the signal-to-interference-noise ratio in the single-link multiplexed single-channel scenario, with the system throughput as the goal, and observes that the system throughput is affected by the number of channels. In order to maximize the total transmission rate of the system, the authors in [34] proposed a reverse iterative combined auction mechanism for multi-link multiplexing single-channel scenarios, which reduced the algorithm complexity. The authors in [35] proposed a method for optimizing the power of D2D users from the perspective of power control in the single-link multiplexing single-channel scenario, and optimized the transmission rate. The authors in [36] optimizes the overall throughput of the system through channel allocation and greedy algorithm for the multi-user multiplexing single channel scenario. In [37], in order to optimize the spectrum utilization, in the single link multiplexing single channel scenario, power control and mode selection are combined to maximize spectrum utilization. In [38], in order to ensure the QoS of D2D users while minimizing the total energy consumption of the system, for the singlelink multiplexing single-channel scenario, the joint mode selection, power control and channel allocation are optimized. The authors in [39] combined power control and resource allocation in the single-link multiplexing single-channel scenario, and proposed a resource allocation mechanism based on graph theory to ensure the quality of service for cellular users and D2D users. Minimize system energy consumption under the premise. Reference [40] aims at multi-user multiplexing single-channel resource scenarios, joint access control, power control and channel allocation to maximize the system throughput, and ensure the existing cellular link users and D2D users QoS. Reference [41] considers the best power allocation in the multi-link multiplexing single channel scenario and proposes a mechanism to maximize the system throughput under the premise of ensuring the QoS of D2D users. Reference [42] aims at the single-link multiplexing single-channel scenario, combined power control and mode selection, and uses an exhaustive search method to ensure the user transmission rate.
Based on addressing the above problem, this paper proposes a user-centric resource allocation method. The original problem can be broken down into the following two parts: The power control part of the access control maximizes the number of D2D user's resources that can reuse the same spectrum resource in a single time slot while ensuring the minimum bit error rate requirement. It belongs to a mixed integer linear programming problem, which is an NP-hard problem in a general sense. Therefore, a stepwise power control algorithm is proposed to achieve a compromise between algorithm performance and complexity. Based on the above results, the time scheduling part of the time domain is ensuring the transmission of user data. Based on the transmission rate, we determine the user's scheduling times so as to maximize the number of D2D links. It is equivalent to the convex-cardinality problem, which also belongs to the NP-hard problem, and then proposes a low-complexity heuristic algorithm. The simulation results show that the method proposed in this paper is necessary for resource optimization, and verifies the effectiveness of the proposed algorithm.

Network Structure
This article considers the uplink of a single-cell cellular network and assumes that the interference between cells is effectively controlled. In addition, assuming that the system has set dedicated access resources for the D2D link, there is no problem of cellular user interference to D2D users, but the same resources can be reused between D2D users, and co-channel interference will occur at this time. The set of D2D users is D = {1, 2, . . ., M}, where the M represents the total number of D2D users. This article considers a system based on time division multiple access. The time slot structure is shown in Fig. 1a. The frame is the smallest scheduling period, and each frame contains several time slots. In each time slot, multiple links simultaneously reuse the same resources for communication, as shown in Fig. 1b. For any time slot, the signal-to-interference and noise ratio SINR (Signal to Interference plus Noise Ratio) value is: where p D i represents the transmit power of the i-th D2D transmitter, g D i represents the path gain from the i-th D2D transmitter to the receiver, g DD i,l represents the path gain from the l-th D2D transmitter to the i-th D2D receiver, and N D i represents the Gaussian white noise received by the i-th D2D receiver.

User Demand Model
As shown in Fig. 1a, assume that the time domain width of each scheduling period is t f , and the frequency domain width is S f . In addition, each scheduling period can be divided into time slots, and we denote the time slots as T 1 , T 2 , . . . , T N f . For the i-th D2D user, it is necessary to ensure that its transmission rate is greater than the transmission threshold during the entire scheduling period, so as to ensure the user's QoS requirements. In a single time slot, the admission control part guarantees the lowest bit error rate, that is, the lowest SINR requirement, such as i-th D2D user. If the SINR threshold value is set to D i , the number of times that the i-th D2D user access must meet the Eq. (2) in the scheduling period: Among them, the vector ω = [ω i ] M×1 means that each D2D user needs to reuse the resources in the scheduling period to meet its transmission rate the minimum number of times; ceil (·) means the smallest positive integer not less than a. Fig. 2 shows a possible scheduling result, among them, DT 1 and DR 1 , and DT 2 and DR 1 link access time slot T 1 , can guarantee the minimum of the above two links Bit error rate requirement (equivalent to minimum SINR threshold requirement). In the entire scheduling period, time-domain scheduling is performed according to the scheduling results to meet the user's QoS.

Problem Description
Define the reuse pattern B = S ⊆ D | γ D i ≥ D i , ∀i ∈ S represents the D2D set of resources that meet its minimum bit error rate in a certain time slot; set F is composed of multiplexing pattern B, which represents all D2D accesses. |F| represents the size of F, and G is the matrix form of F, where G represents the element in the i-th row and k-th column of G. If the i-th D2D link is connected in the k-th time slot, then , then the corresponding G is: Define the vector α = [α k ] |F|×1 Represents the number of times that the multiplexing pattern is scheduled in the entire scheduling, then Gα represents the total number of multiplexing resources for each D2D users in the scheduling period. If ω − Gα ≤ 0, it means that the rate requirement of the i-th D2D user is met in the entire scheduling period. Then ω − Gα > 0 means the i-th D2D user rate requirement is not met. Therefore, the auxiliary variable q = [q i ] M×1 is introduced, and ω − Gα ≤ q is introduced into the restriction condition. Among them, q = 0 means the D2D user meets the speed requirement, and q i > 0 means the D2D user does not meet the rate requirement. Therefore, maximizing the number of D2D users in any time slot is equivalent to minimizing the number of non-zeros in the variable q, and we can minimize the cardinality function card (q) as the optimization target value of this problem. In summary, the proposed algorithm can be described as Problem 1: Subject to: where 1 1× |F| represents the row vector with all elements l; Eq. (5) indicates that the rate requirement of the i-th D2D user is met within the scheduling period; Eq. (5) indicates that the total number of time slots cannot exceed N f .

Joint Access Control and Time Domain Scheduling
In order to maximize the number of D2D users and minimize the number of multiplexed resources while ensuring user QoS, a joint resource allocation scheme is proposed. First, the admission control part determines the D2D user set that meets the minimum bit error rate condition in a single time slot, thereby determining the access matrix G; according to the result of admission. The time-scheduling part adjusts the resources of different time slots. In order to minimize the number of resources reused, the time-scheduling is the optimized result based on admission control.

Access Control
The purpose of the access control is to generate the multiplexing matrix G. According to the definition of the multiplexing pattern in Section 1.3, we can see that with as the number of D2D users increases, the dimension of G will grow exponentially. In addition, as shown in Eq. (3), compared to {1}, {2}, {3}, the multiplexing patterns {1, 2}, {1, 3} can make full use of the resources of each time slot. Using it as the maximum multiplexing pattern is more conducive to maximizing the number of links meeting QoS requirements in the entire scheduling period. In order to better explain the nature of the specific reuse pattern in G, we first introduce the following definitions.
Definition: Maximum reuse pattern A n , where n is the maximum number of multiplexing patterns, which meets the following two conditions: where |·| represents the collection size.
Satisfying condition 1 means that the D2D link i has the opportunity to access the system, and satisfying condition 2 means that each time slot resource is multiplexed by the maximum number of D-L, thereby creating the most multiplexing opportunities and ensuring the maximum number of D2D link can access the system. In order to solve A n , We assume that the vector x = [x i ] M×1 represents the D2D users that can be accessed in a certain time slot. If i-th D2D user is accessed in this time slot, x i = 1; otherwise, x i = 0. In order to optimize Problem 1, it is necessary to maximize the access of D2D users in any time slot. That is, maximize the sum of the elements of x. After obtaining x, it can be integrated into matrix G, so that Problem 1 can be further optimized. According to the single time slot, in order to guarantee D2D users, the QoS of D2D users and the maximum number of access resources can be described as Problem 2: Eq. (7) represents the i-th D2D user upper limit of the transmitting power; p max i represents the maximum transmitting power of the i-th D2D transmitting end. Eq. (8) represents the D2D user access resources QoS constraints; Eq. (9) indicates that the j-th D2D link has been connected to channel resources.

Traditional Algorithms and Drawbacks
It is easy to know that Problem 2 is a mixed integer linear programming problem, which belongs to the NP-hard problem. In the optimization theory, the branch and bound method (BB) can be used to obtain the optimal solution, but the above process requires a long calculation time [43]. If the number of nodes in the traversal tree when the optimal solution is found, the complexity of the BB algorithm is O β (2M) 3 . The (2M) 3 represents the average complexity of using the simplex method to solve the linear programming problem at any node on the traversal tree. With the increase of the problem dimension M, β will also increase to a certain extent, and there will be a situation of β → ∞. However, in LTE-A, the actual deployment of the communication system, resource allocation needs to be completed in several time slots (millisecond level). Therefore, the traditional BB algorithm is not suitable for the problem considered in this article.
For the convenience of calculation, the optimization target variable of Problem 2 is transformed into the l 0 -norm function form that can be described as Problem 3: Subject to: where y = [y i ] M×1 , y i = 1 − x i . The above objective function is l 0 -norm that represents the number of non-zero elements in a vector. Problem 3 is a mixed integer linear programming problem, which can further transform the l 0 -norm function form the target variable into the l 1 -norm function form, which is described as Problem 4: Subject to: Problem 4 is a linear programming problem, which can be solved by the simplex method, but the solution result is quite different from the theoretical value.

Progressive Access Control Algorithm
Based on the shortcomings of traditional algorithms, this paper proposes a progressive access control algorithm to reduce complexity while ensuring system efficiency and solving Problem 2. The algorithm is divided into two parts: priority access and feasibility detection. The priority access goal is to maximize the number of access links on the premise of satisfying Eq. (8), and introduce the measured value of D2D link. The goal of feasibility detection is to satisfy the Eq. (7) in Problem 2, so as to solve Problem 2 with low complexity.
a) The first part is to give priority to receiving users. j represents the D2D received resource, U j represents the D2D user collection of the received resource, V j represents the remaining D2D sets, then U j ∪ V j = D. The main idea of this part is to calculate the measured value of the D2D link one by one, and select the D2D link with the smallest measured value. The measured value of the i-th D2D link is: where z DD i,l means the i-th normalized path gain between l of the D2D user; p D * l represents the optimal transmit power of the l-th D2D link; p D * i represents the i-th item in the calculation of the received access measurement value D2D optimal transmit power. The first half of Eq. (17) indicates that the D2D user receives effective interference in the current time slot. The second half represents the effective interference caused by this D2D user to other in the current time slot. The smaller θ D i it is, the smaller the interference between it and the connected link. Therefore, the i-th D2D link is considered to be connected to the resource first.
b) The second part is feasibility testing. First, find the optimal transmit power of D2D link that gives priority to access resources in the first part, and determine whether its optimal transmit power satisfies Eq. (6). Secondly, if it is satisfied, it is judged whether the minimum bit error rate is satisfied. For the constraint conditions of Eq. (8), it can be expressed as: The corresponding matrix form is: where p represents the transmit power vector of D2D link; E represents the unit matrix modulo U j of U j ; represents the diagonal matrix of the SINR threshold corresponding to the minimum QoS requirement of D2D link; Z represents the normalized path gain matrix between D2D users; n represent the normalized noise power vector. The specific definition is as follows: From Eq. (20) to Eq. (23), it is positive and irreducible, Eq. (19) can meet the lowest QoS condition as (E − Z) p ≥ n, namely: If Eq. (24) makes sense, then p * = (E − Z) k n is meaningful, that is, when the matrix Z maximum eigenvalue λ < 1, there is a power vector p * , when the i-th D2D is p D * i transmit power during transmission, the lowest QoS is met, so it is deleted from one and added to U j . When λ ≥ 1, the i-th D2D link does not meet the access resource conditions and is deleted from V j . Return to the first part until V j = Ø .
After each update of U j , it is converted into matrix x (the process is similar to F to G), and x is stored in matrix G. If x ⊂ G, it is not stored. After traversing all j ∈ D, the final access matrix G is obtained.
In summary the main steps of the proposed algorithm are shown in Algorithm 1.
and select the smallest measured value. 6: Feasibility test 7: Calculate the optimal transmit power for preferential access to D2D users using P * = (E − Z) −1 N According to the priority access link obtained in steps 2∼5 8: if P * < maximum transmit power 9: Calculate the maximum characteristic value λ of Z 10: if λ < 1, determine the D2D access link, delete it from V j and add it to U j to obtain the matrix representation of the set U j , similar to the process of transforming F to G 11: Otherwise, delete it from V j and return to Steps 2∼5 Algorithm 1 first determines the preferential access link under the premise of satisfying Eq. (8), and then uses feasibility detection to determine whether the Eq.

Time-Domain Scheduling
The above part is coordinated by power control and interference to solve D2D access problem in a single time slot access matrix G. According to this, how to solve Problem 1 under the condition of known G becomes the key. But Problem 1 is a mixed-integer linear programming problem, see Theorem 1, which is an NP-hard problem in the general sense.
Theorem 1: Given the matrix G, the optimization Problem 1 is a mixed integer linear programming problem.
Proof: Problem 1 can be rewritten as Problem 5: Subject to: where l i is the minimum value of q i , and its value can be solved by Eq. (30), u i is the maximum value of q i , and its value can be solved by Eq. (31). When π i = 0, q i = 0; and when π i = 1, l i ≤ q i ≤ u i , so i∈D π i is minimized in the target variable. It is equal to maximizing the number of zero elements in q, that is, minimizing card (q). This problem is a mixed integer linear programming problem. min α k ∈{0,1,2,...}, Subject to: Subject to: It is known that Problem 1 is a mixed-integer linear programming problem, which is an NPhard problem in the general sense. The optimal solution similar to Problems 4 and 5 can also be obtained using the BB algorithm, but requires a longer calculation time. Therefore, this paper proposes a heuristic algorithm. The main idea of the proposed algorithm is a process of selecting the largest multiplexing pattern step by step in the order of time slots. In the first time slot, traverse all the largest multiplexing patterns j, and select the smallest target value μ (j) = card(q) in Problem 1 and reuse pattern j, i.e., j * = arg min j μ (j). Observe whether all D2D link multiplexing time slots are met. If they are met, the algorithm ends. Otherwise, continue to perform the above steps until all time slots are allocated to the largest pattern or all D2D user's QoS requirements are all satisfied. Among them, in order to reduce the complexity of access, before the first time slot access by the D2D users, we start to delete some links with poor channel conditions, that is, delete the D2D users set of ω (i) − N f > 0, because even if all time slots are allocated to the above D2D users, their QoS requirements cannot be met, and α = [α (j)] |F|×1 = 0, j ∈ ∅ is initialized.
The above algorithm is shown in Algorithm 2. The complexity of the initialization part is O (M), assuming that I g is the number of time slots allocated for this part, and |A n | is the number of D2D user that can receive the most access in a single time slot, so the algorithm is complicated and the complexity is O |A n | I g , where |A n | ≤ M, since there are at most N f time slots, so

Simulation Results
The simulation considers a single cell with a radius of 300 m. The base station is located in the center. All cellular users and DT are evenly distributed in the cell. DR is centered on DT to form a circular area with a radius of 10-50 m. The simulation part uses The main parameter description and settings are shown in Tab. 1. The entire time length is 1,000 time slots, and the MATLAB platform is used for simulation.

Progressive Access Control
The algorithms involved in this part of the simulation include: (1) The l 1 -norm algorithm: the algorithm has low complexity but insufficient performance.
(2) Traditional BB algorithm: The theoretical optimal solution can be obtained, but exponential complexity may appear, which is difficult to apply in actual situations.
(3) Proposed access control algorithm: Aiming at the access control problem of Problem l, using the step-by-step process, determine the maximum access resources in a single time slot while ensuring the user's lowest bit error rate. The complexity of the algorithms involved in the simulation is shown in Tab. 2. Fig. 3 shows the comparison of access resources when the number of D2D users in the cell changes from 20 to 30 under the condition of 1,000 iterations. The change in the ratio of the D2D link to the total link. As the number of D2D users increases, the ratio range decreases. Because the resources required for access remain unchanged, the increase of D2D users increases the interference between systems. It can be seen from the Fig. 3 that the proposed access control algorithm shows significantly better performance than l 1 -norm algorithm. The proposed algorithm increases the performance by 31.2l%, which is only 4.09% lower than the BB algorithm.

Joint Access Control and Time Domain Scheduling
The algorithms involved in this part of the simulation include: (1) Random algorithm: based on the access control part mentioned in this article, it is solved by random method, with low complexity but insufficient performance; (2) Traditional BB algorithm: The theoretical optimal solution can be obtained on the basis of the access control part mentioned in this article, but exponential complexity may appear; (3) Proposed joint access control and time-scheduling algorithm: On the basis of the access control part proposed in this paper, the heuristic algorithm proposed in the time-scheduling stage is combined to solve Problem 1.
The algorithm complexity involved in the simulation is shown in Tab. 3.  Fig. 4 shows the system performance when number of D2D users changes from 20 to 30. The change in the ratio of the D2D link to the total number of links. As the number of D2D users increases, the ratio range decreases. Because the interference between D2D user continues to increase, the number of D2D users that can be accessed continues to decrease, resulting in missed D2D link. The number of D2D users keeps increasing, and the system performance decreases. It can be seen from the Fig. 4 that the proposed joint resource allocation method is a heuristic algorithm that is close to the optimal, which is only 1.72% less than the optimal algorithm, but it is 13.03% better than the random algorithm, which reflects its effectiveness.

Conclusions and Future Recommendations
This paper analyzes the dense distribution of D2D links and proposes a user-centric joint access control and time-domain scheduling method, which solves the problem of maximizing the number of access links while ensuring the quality of D2D link service. The simulation shows that the algorithm in this paper is an approximate optimal algorithm, which achieves a compromise between algorithm performance and complexity. Further extension to this study is to consider the energy efficiency and integrate it with mmWave communication and evaluate the performance.