Cellular-D2D Resource Allocation Algorithm Based on User Fairness

: As more and more mobile multimedia services are produced, end users are increasingly demanding access to high-speed, low-latency mobile communication networks. Among them, device-to-device (D2D) communication does not need the data to be forwarded through the base station relay but allows the two mobile devices adjacent to each other to establish a direct local link under control of the base station. This flexible communication method reduces the processing bottlenecks and blind spots of the base station and can be widely used in dense user communication scenarios such as transportation systems. Aiming at the problem of high energy consumption and improved quality of service demands by the D2D users, this paper proposes a new scheme to effectively improve the user fairness and satisfaction based on the user grouping into clusters. The main idea is to create the interference graph between the D2D users which is based on the graph coloring theory and constructs the color lists of the D2D users while cellular users’ requirements are guaranteed. Finally, those D2D users who can share the same channel are grouped in the same cluster. Simulation results show that the proposed scheme outperforms the existing schemes and effectively improve system performance.

multiplex mode, and cellular mode. Among them, the multiplexing mode has received wide attention due to its high spectral efficiency [12][13][14][15]. When using multiplexing mode, if the interference between users cannot be effectively controlled, D2D communication may damage the communication quality of other users and reduce the system performance. Therefore, an effective interference management mechanism is the key to the advantages of D2D communication and the interference management is a great issue and obstacle in the proper operation of the D2D communication networks [16,17]. Reference [18] proposed a resource allocation algorithm to ensure the quality of service for cellular users and D2D users, which can be divided into three steps: D2D user access judgment, D2D user power control, and D2D user channel allocation. Reference [19] judges whether the cellular user and the D2D user can share the channel according to the capacity gain. Reference [20] proposed a resource allocation algorithm based on the interference-restricted area. An interference-restricted area was defined for each pair of D2D users, and the cellular user resources in this area could not be used by this D2D user. References [21,22] used matching theory to pair D2D users with cellular users to increase the system capacity.
In the above algorithms, the channel of each cellular user is used by a maximum of one pair of D2D users, and there are certain limitations for occasions where the number of D2D users is greater than the number of cellular users (such as concerts or stadiums). In order to use spectrum resources more efficiently, the scenario where multiple pairs of D2D users share the same cellular user channel has also been studied [23][24][25]. Reference [23] used a reverse iterative joint auction mechanism to allocate spectrum resources for D2D users. However, the amount of licensed spectrum increases exponentially with the number of D2D users, which is not suitable for scenarios with a large number of D2D users. Reference [24] allocates resources based on the interference graph among all users in the system, but the communication quality of cellular users in this scheme is not effectively guaranteed. Reference [25] proposed a resource allocation algorithm based on graph coloring theory, which defined a label for each color of each pair of D2D users and assigned channels based on the label value. However, the algorithm does not consider the fairness among users, which may cause users with poor channel quality to have no channels available.
D2D communication can support a variety of local transmission services such as file sharing and video playback. Considering the actual application scenario, resource allocation should be combined with the business needs of D2D users. None of the above studies took this into consideration, and there may be situations in which too many resources are allocated to users with low-rate needs and resources are not allocated to users with high-rate needs. Because users with different services have different requirements for speed, from the perspective of practical application, this paper introduces the concept of user satisfaction and uses the graph coloring theory to allocate the user's channel in the scenario where the number of D2D users is greater than the number of channels modeled as a vertex coloring problem for graphs. In order to solve this problem, this paper first establishes an interference graph according to the interference situation between D2D users in the system. D2D users with severe interference are connected by edges to indicate that they cannot share channels. Each D2D user establishes a list of available colors and finally clusters D2D users with different service quality requirements in the same cluster share spectrum resources.
The rest of this article is organized as follows: Section 2 gives the channel allocation problems discussed in this paper based on the system model of D2D communication. Section 3 details the proposed allocation algorithm. Section 4 is the simulation results and analysis, and Section 5 is the conclusion.

System Model
The system model studied in this paper is shown in Figure 1. Considering the single-cell scenario, the cell radius is , and the base station is located in the cell center. There are cellular users and pairs of D2D users randomly distributed in the area. Each pair of D2D users consists of a transmitter and a receiver with a fixed distance between them. The cellular user communicates with the base station through the traditional cellular mode, while the D2D user multiplexes the downlink resources of the cellular user for communication. Assume that cellular users use independent orthogonal subchannels and the subchannels have been allocated. Without loss of generality, it is considered that cellular user uses the th subchannel. Considering dense D2D communication scenarios, the number of D2D users is greater than the number of cellular users. This paper allows multiple pairs of D2D users to utilize the channel of a cellular user, and a pair of D2D users to use channels of multiple cellular users.  In order to facilitate the following description, the relevant parameters are defined as follows: represents the set of cellular users, = { 1 , 2 , … , }, where represents the cellular user ; represents the set of D2D users, = { 1 , 2 , … , , … , }, where represents the D2D user th pair; represents the total transmit power of the base station. All D2D users have the same transmit power on all subchannels, which is represented by s ; g , represents the channel power gain between the base station and ; g represents the channel power gain of the through link; ℎ , represents the channel power gain of the receiver from the base station to ; ℎ , represents the channel power gain from 's transmitter to ; ℎ , represents the channel power gain from the transmitter of to the receiver of . The large-scale fading model for all users in the small area uses the single-slope path loss model in [26], that is, = − , where and are the path loss constant and path loss index, respectively, and represents the distance between the sender and receiver. Small-scale fading is Rayleigh fading [23], that is, the channel response obeys an independent and identically distributed complex Gaussian distribution.
represents the bandwidth of the subchannel; 0 represents the noise power received by all users; , ∈ {0,1} is an indicator variable for channel allocation. If multiplexes the channel of , , = 1, otherwise Assuming that the base station distributes the transmit power on each sub-channel equally, the cellular users are interfered by the D2D users who multiplex their channels, so the signal-tointerference-to-noise ratio received by is When multiplexes the channel of , it receives interference from the base station and other D2D users using the same channel. The received signal-to-interference and noise ratio is According to Shannon's formula, the rate (bit/s) of the two is Where , = log 2 (1 + SINR , D ) represents the transmission rate of on the th subchannel. Considering that the quality-of-service requirements of each D2D user are different, the demand vector for its data rate is Dem = {Dem 1 , Dem 2 , … , Dem , … , Dem } (5) Define the satisfaction of D2D users as

Problem Description
The channel allocation problem of D2D users in multiplexing mode is similar to the resource allocation problem of secondary users in the underlying scenario of cognitive radio. Cellular users are similar to primary users and enjoy higher priority. Therefore, the quality of service of cellular users needs to be guaranteed first, that is, it should meet its minimum rate requirement in the channel allocation process C ≥ C_min , ∀ ∈ (7) The goal of channel allocation is to improve the satisfaction of D2D users as much as possible, but because users with low rate requirements can occupy fewer spectrum resources and achieve higher satisfaction if the total satisfaction of D2D users in the system is pursued blindly, it may result in users who have limited access to limited spectrum resources and high rate requirements cannot allocate channels, and resource allocation is extremely unfair. In order to solve the problem of fairness, this paper uses the variance of user satisfaction To measure the fairness of channel allocation, reflects the degree of dispersion of user satisfaction. The smaller the , the better the fairness of the system. The optimal algorithm for the above problem can be obtained by traversal search. At this time, each pair of D2D users (using at least one subchannel) has: ( 1 + 2 + ⋯ + M ) = 2 − 1 possible channel allocation results, then pairs of D2D users need to traverse (2 − 1) possible situations in total. The high computational load of the optimal algorithm should be avoided in practical applications. In the next section, a suboptimal algorithm is proposed to solve this problem.

Proposed Algorithm
Graph theory, as one of the foundations of computer science, can provide an effective system modeling method and is widely used in resource allocation. The vertex coloring of the graph refers to assigning one color to each vertex with colors so that the colors of adjacent vertices are different [27]. Using the point coloring model of the graph, this article abstracts each user as a vertex, uses edges to represent the interference between users, and treats each cellular user's channel as a color, which can convert the user's channel allocation problem into the vertex coloring of the graph problem.
The traditional point coloring problem mainly studies the minimum number of colors required for vertex coloring. At this time, each user can only get one color [28]. In order to improve the spectral efficiency, this article allows a pair of D2D users to use the channels of multiple cellular users, that is, each pair of D2D users can use multiple colors. In view of this difference, this section introduces the concept of clusters, that is, all D2D users who can use the same color form a cluster. There are colors in the system to form clusters. By continuously adding D2D users to the cluster until no users can be added, eventually, the same channel is shared between the users in the same cluster. The channel allocation algorithm includes three steps: establishing an interference map between D2D users, establishing a list of available colors for D2D users, and clustering D2D users. The specific content of each step is described below.

Establishment of D2D Inter-User Interference Diagram
According to the interference situation between D2D users in the system, an interference graph On the one hand, from the perspective of D2D users, the higher the rate requirement, the more they want to obtain a higher received signal-to-interference-to-noise ratio or use more channels, so a fixed signal-to-interference-and-noise ratio cannot be used to determine whether D2D users exist which is the basis for severe interference. On the other hand, from a system perspective, resource reuse can bring throughput gains. When resources are seriously insufficient, even if the interference between users is slightly larger and the throughput gain brought by multiplexing is small, allowing more users to access will make the resource allocation fairer and more reasonable. So, this article uses the following formula as the basis for judging whether there is an edge between and If Equation (9) is satisfied, the two cannot share channels and establish edges. The parameter ∈ ( , ) reflects the system's tolerance for interference between D2D users. The larger the is, the more restrictive the interference between users is, the more the number of edges in the interference graph is, the lower the value will be.

List of Available Colors for D2D Users
Each pair of D2D users has a color list, and each color corresponds to the channel of the available cellular users. Initially, D2D users can use all colors. When the D2D user interferes greatly with the cellular user if the D2D user does not recognize the color of the cellular user, the communication quality of the cellular user can be effectively improved. The outage probability of a cellular user is defined as Out = Pr( C < C_min ) (10) Among them, ( ) is the probability that the condition is satisfied. The reuse criterion of D2D users in [25] is: If a pair of D2D users use the channel of a cellular user and cause the interruption of the cellular user, then it cannot use the channel of the cellular user. This solution does not take into account the cumulative nature of interference, even if the interference of a single D2D user to the cellular user is not enough to cause the interruption of the cellular user, when there are multiple pairs of D2D users in the system using the channel of a certain cellular user at the same time, the accumulated total interference may be much larger than the upper limit of interference that can be tolerated by cellular users, resulting in disruption to cellular users.
Aiming at the problems in [25], in order to ensure that the interruption probability of cellular users is 0, this article first calculates the upper limit of interference that each cellular user can withstand according to its minimum rate requirement Then by continuously adding edges to remove the D2D users who interfere the most, until the total interference they meet meets the threshold requirement. In addition, in order to add fewer edges for D2D users to have more available colors, the interference should be removed in descending order.

D2D User Clustering
For any color , as long as there are no adjacent vertices assigned to , they can be used by . The cost function ( , ) used to assign color to is defined as follows ( , ) = |neigh , | (12) Where | , | is the number of elements in the set , which represents the total number of edges between other D2D users of available color and . The cost function reflects the influence of on the other users after using color . The greater the cost, the more the color is allocated to for use, and the more D2D users in the system with the available color cannot use the color, the lower the spectrum utilization.
In addition, define the utility , brought by adding to cluster (cluster_ ) is Among them, , represents the rate at which joins cluster which is expressed as The utility has the following characteristics: 1. For D2D users who do not meet the rate requirements, the higher the rate , obtained by joining a cluster, the higher the satisfaction, the higher the priority is to join the cluster. 2. The term ( − ) in the numerator considers the fairness among users: the smaller the satisfaction of D2D users, the higher the priority to use the color to reduce the gap with other users. 3. The cost function plus the constant in the denominator avoids the possibility that the denominator is zero. At the same time, it is cooperative. It considers the impact of the use of color on the spectrum utilization of other users and systems.
Based on Equations (12) and (13) for cluster D2D users. Because each D2D user can use multiple colors, a D2D user can belong to multiple clusters. Initially, the candidate members of cluster are all D2D users with color in the list of available colors. The basic idea of clustering is: For a certain color, each time a candidate member is selected from the candidate member set of its corresponding cluster to be added to the cluster, and at the same time, the candidate member with the added user edge is removed from the candidate member set, and the next round of selection is continued until the candidate member set is empty. The basis for selecting a user added to a cluster each time is to preferentially select a candidate member added to the cluster to bring the most utility, and if there are multiple, a random member is selected.
In Figure 2, eight pairs of D2D users are clustered to share the channels of three cellular users. For the first color, the candidate members of the first cluster are firstly found according to the list of available colors of the D2D user as {1, 3, 4, 6, 7}. By calculation, it is known that the most effective use of color 1 is User 3, then User 3 is first added to the first cluster, and at the same time removed from the candidate member set. At this time, there is an edge between User 3 and User 1. Obviously, the two cannot be in the same cluster, so User 1 is also removed from the candidate member set and so on until there are no candidate members that can be added to the first cluster. In the end, D2D users use the channel of cellular User 1 for 3, 6, and 7 in common. It is worth noting that after the end of each round of selection, the utility of the candidate member changes due to changes in the interference within the cluster, so its utility should be updated before entering the next round of selection. At the same time, in the process of channel allocation, once the user reaches the required rate, even if there are still other channels available, the list of available colors is left blank and does not participate in the allocation of these colors. Because further increasing the rate does not bring about an increase in satisfaction, it may also consume the resources of other users in need. The specific process of the proposed scheme is described in Algorithm 1.
Algorithm 1 Proposed Algorithm 1. Initialize the list of available colors for D2D users = { , , … , }, ≤ ≤ 2. for = 3. Calculate the upper limit of interference that can withstand according to equation (10), and calculate the total interference from D2D users 4. While( > ) 5. Select the D2D user th pair 6. Update by = \{ }, and interference on becomes 0 7. end While 8. end for 9. Initialize = and = , ≤ ≤ 10. for = 11. Initialize the candidate member of the -th cluster according to , and initialize member cluster_ of the -th cluster. 12. While( ≠ ) 13. Calculate the utility members , , ∈ according to equation (12)  For each color, the candidate member set contains a maximum of pairs of D2D users. Each time a pair of users is selected to join the corresponding cluster, there are a total of colors, so a maximum of cycles are required to complete the clustering process.

Signaling Overhead and Complexity Analysis
The signaling overhead is a bottleneck in the D2D communication systems since the overhead is overweight in the central BS to obtain the channel state information (CSI) and some CSI is difficult to obtain in a real-time networking environment such as the links between the D2D and cellular receivers. The aim of the proposed scheme is to acquire the CSI and allocate the channel resources with limited overhead, therefore, the signaling overhead for CSI measurement obtained in terms of complexity using the proposed and traditional scheme is mentioned below in Table 1. Table 1. Impact of the proposed algorithm on the signaling overhead.

Algorithm
Signaling Overhead/Complexity With Proposed Algorithm ( )

Without Proposed Algorithm ( )
Where is the number of D2D user pairs and is the number of subcarriers.

Simulation Results and Performance Analysis
In this paper, we used MATLAB software to simulate the algorithm and combine the coloring algorithms proposed in [25] and [29] to conduct a comparative analysis of the following three aspects: 1. outage probability for cellular users 2. average satisfaction of D2D users 3. the variance of satisfaction of D2D users The specific simulation configuration is shown in Table 2.  Figure 3 gives the cellular user outage probability against the number of D2D users of the reference [25] algorithm and the proposed algorithm for large-scale scenario, i.e., deploying 150 D2D user pairs. The link gain in [25] algorithm only considered the influence of distance, and as long as the interference of a single D2D user to a cellular user was not enough to cause the cellular user to interrupt the two, the channel could be shared. It can be seen that the more D2D users in the algorithm in [25], the greater the possibility of interruption for cellular users. This is because the denser the distribution of D2D users, the greater the total accumulated interference to cellular users and the easier it was to exceed the interference threshold. On the other hand, the proposed algorithm considered the cumulative nature of the interference, which could effectively ensure that the interruption probability of cellular users was zero. of D2D users with the logarithm of D2D users is 20, 40 and 60 respectively. It can be seen that the average satisfaction of D2D users increased first and then decreased with the increase of and the variance of satisfaction changed in the opposite direction. reflects the system's control of interference between D2D users and the reuse of spectrum resources. When the value of was small, and the interference between D2D users was not effectively controlled, resulting in poor system performance. When the value of was large, the number of edges in the interference graph was large, the number of channels obtained by each user was small, and the system performance was also low and not ideal. The contradiction between the interference between D2D users and the number of available channels made the optimal exist, which made the system performance the best. According to the simulation results, the value range of should be between 0.5 and 0.6.   Figures 6-9 show the relationship between the average satisfaction and variance of the three D2D users and the logarithm and 0 of D2D users. Reference [25] algorithm first obtained the available colors of D2D users, and then assigned each color to D2D users with good channel conditions and high rates. Reference [29] first assigned one color for each vertex (each time the vertex with the largest number of edges is selected and the color with the smallest number [30,31]), D2D users with the same color could be divided into a cluster, and then the cellular user channel was assigned to the cluster where the highest total rate was shared by users in the cluster. Clustering and coloring first made it more difficult for users with high interference to obtain channels, which aggravated the unfairness among users. The two only considered the rate factor when coloring, and the proposed algorithm was based on the needs of users and considers both the user rate and fairness in the channel allocation process. Obviously, the proposed algorithm was superior to the other two algorithms in terms of user satisfaction and fairness. As can be seen from the figure, on the one hand, the greater the number of D2D users or the higher the service demand rate of users, the lower the average satisfaction of the three algorithms. This is because as the number of users increased or the rate of service demand increased, the limited system resources (10 subchannels) became increasingly scarce, making it more difficult to reach the user's demand rate, leading to a decrease in satisfaction. On the other hand, the variance (fairness) of satisfaction increased first and then decreased with the number of users or the rate of business demand. This is because when there were fewer users and the rate of business demand was low, system resources were relatively sufficient and users were generally satisfied. As the number of users or the demand rate increased, system resources started to become tight, and a small number of users were less satisfied. As the number of users or demand rate continued to increase, system resources became increasingly insufficient, and the number of users with low satisfaction levels continued to increase until users were generally dissatisfied.

Conclusions
This paper studies the problem of allocating channels for D2D users with different quality of service requirements when D2D users reuse the downlink resources of cellular users. Aiming at this communication scenario, the concepts of satisfaction and clustering are used in this paper to propose a clustering channel assignment algorithm based on the quality of service. The proposed algorithm clusters D2D users according to the interference map between users and the available color list of D2D users. The cellular user's channels are shared between D2D users in the same cluster. The simulation results show that the proposed algorithm can improve the satisfaction of D2D users while effectively ensuring the quality of service requirements of cellular users, and also taking into account the fairness among users. This article assumes that all users transmit data at a fixed power. Further research may consider adding power control to optimize system performance with different parameter analysis.