Social-Aware-Based Resource Allocation for NOMA-Enhanced D2D Communications

: In mobile communication systems, device-to-device (D2D) communication and nonorthogonal multiple access (NOMA) are e ﬀ ective ways to improve spectrum e ﬃ ciency and system throughput. In the NOMA-based D2D system, social relationship among D2D users is introduced to form D2D clusters, and NOMA is used for many-to-one communication in each D2D cluster. This paper proposes a joint channel allocation and power control algorithm which decomposes the resource allocation problem into two subproblems: channel allocation and power control. Matching theory is utilized to allocate channels for D2D clusters and sequential convex programming is applied to transform the optimization target to a convex problem before solving it via genetic algorithm. Simulation results indicate the superiority of our algorithm in improving the system throughput on the basis of meeting users’ needs for ﬁles.

• Social relationships among D2D users are considered. One D2D content requester form a D2D cluster with multiple D2D content providers according to social relationship and other factors. NOMA is used to realize many-to-one D2D communication. An optimization model is constructed to maximize the throughput of all D2D users who communicate through NOMA-enhanced D2D while ensuring all the users' QoS on each channel. • D2D users communicate through cellular users' uplink channels, and the many-to-one matching game is used to allocate channels for D2D clusters. We prove the convergence of the matching game and optimize the channel allocation problem for D2D users.

•
The successive convex approximation (SCA) method is used to convert the nonconvex optimization problem into a convex problem, and the convexity of the optimization problem is proved based on the negative semidefiniteness of the Hessian matrix. The genetic algorithm (GA) is used to optimize the transmit power of D2D content providers and the convergence of the algorithm is proved.
The remainder of this paper is organized as follows. Section 2 shows the system model. Section 3 defines the utility function of D2D content requesters to form D2D clusters, allocates cellular channels for D2D clusters, and optimizes the transmit power for D2D content providers in the cluster. We also prove that the algorithm can converge to a stable solution. Section 4 plots and analyzes the simulation results. Section 5 summarizes the whole paper.

System Model
System model in this paper is shown in Figure 1. M cellular users, N D2D content requesters and K D2D content providers are randomly distributed in the cell which centered in the base station (BS). Cellular users {C 1 , C 2 , . . . , C M } communicate with the BS through dedicated channels {SC 1 , SC 2 , . . . , SC M }. Each cellular user is assigned with a dedicated and orthogonal channel. Hence, it can be assumed that cellular user C m is assigned with the channel SC m without loss of generality. {DR 1 , DR 2 , . . . , DR N } is the set of D2D content requesters (receivers) and {DT 1 , DT 2 , . . . , DT K } is the set of D2D content providers (transmitters). There are F files that can be requested in the system. D2D content requesters ask for each file with a probability of p. The request file set can be represented as req n = {e s } s∈F . e s = 1 indicates File s is requested, otherwise e s = 0. Assume that all files are cached at the base station. D2D content providers cache each file with a probability q. The cache file set can be represented as {cache} k = {e s } s∈F . e s = 1 indicates File s is cached, otherwise e s = 0.
A D2D content requester can obtain contents in two ways: (1) from D2D content providers around him through D2D communication. Through establishing D2D communication links with D2D content providers by reusing cellular user's channel, he can get content files from users in proximity. (2) From the BS through traditional cellular communication. The D2D content requester would choose the first way preferentially in order to reduce the cellular traffic pressure. By selecting appropriate D2D content providers to form a D2D cluster, D2D content requester can receive several desired contents from multiple D2D content providers in the cluster simultaneously through NOMA. D2D content requester correctly demodulates the received content from different D2D content providers with serial interference cancellation (SIC) technology and NOMA transmission protocol. If none of the D2D content provider in proximity has cached any file the requester wants, D2D content requester should choose the second way to obtain contents. After D2D clusters have been formed, each D2D cluster reuses the uplink cellular channel for D2D communication. We assume that each cellular channel can be reused by multiple D2D clusters while each D2D cluster can only reuse one cellular channel. D2D communication can be established through coordinating interference between cellular users and D2D users. This paper does not consider cellular users' power optimization problem, and the transmit power can be set to a fixed value. and   K DT DT DT , , , 2 1  is the set of D2D content providers (transmitters). There are F files that can be requested in the system. D2D content requesters ask for each file with a probability of p . The request file set can be represented as      A D2D content requester can obtain contents in two ways: (1) from D2D content providers around him through D2D communication. Through establishing D2D communication links with D2D content providers by reusing cellular user's channel, he can get content files from users in proximity. (2) From the BS through traditional cellular communication. The D2D content requester would choose the first way preferentially in order to reduce the cellular traffic pressure. By selecting appropriate D2D content providers to form a D2D cluster, D2D content requester can receive several desired contents from multiple D2D content providers in the cluster simultaneously through NOMA. D2D content requester correctly demodulates the received content from different D2D content providers with serial interference cancellation (SIC) technology and NOMA transmission protocol. If none of the D2D content provider in proximity has cached any file the requester wants, D2D content requester should choose the second way to obtain contents. After D2D clusters have been formed, each D2D cluster reuses the uplink cellular channel for D2D communication. We assume that each cellular channel can be reused by multiple D2D clusters while each D2D cluster can only reuse one cellular channel. D2D communication can be established through coordinating interference between cellular users and D2D users. This paper does not consider cellular users' power optimization problem, and the transmit power can be set to a fixed value. Due to the fact that mobile devices are dominated by users, it is more reasonable to pair D2D users by considering social relationship between them. According to the system model in physical domain in Figure 1, a corresponding system model in social domain can be established as shown in Figure 2. Due to the fact that mobile devices are dominated by users, it is more reasonable to pair D2D users by considering social relationship between them. According to the system model in physical domain in Figure 1, a corresponding system model in social domain can be established as shown in Figure 2. Appl. Sci. 2020, 10,   In practical network environment, channel conditions along with system interference can be described with physical domain. In this paper, D2D users in D2D clusters communicate by reusing the uplink cellular channels. Therefore, D2D content providers may cause interference to the BS and D2D content requesters may suffer interference from cellular users. We can represent the system model in physical domain as a graph

Social-Aware-Based Resource Allocation
The social-aware-based NOMA-enhanced D2D resource allocation proposed in this paper includes three steps: (1) form D2D clusters according to certain rules, (2) allocate channels for D2D clusters, and (3) optimize transmit power for D2D users in D2D clusters. The formation of clusters mainly considers the user's content requirements, physical location, and social relationship with other users. When D2D clusters are formed, the many-to-one matching game is utilized to allocate channels for D2D users. After converting the nonconvex optimization problem to a convex problem via SCA, GA is performed to solve the D2D transmit power optimization.

Cluster Formation
N D2D content requesters are randomly distributed in the cell. They choose D2D content providers within their D2D communication range to join them and form D2D clusters. The utility function of D2D content requesters can be defined as In practical network environment, channel conditions along with system interference can be described with physical domain. In this paper, D2D users in D2D clusters communicate by reusing the uplink cellular channels. Therefore, D2D content providers may cause interference to the BS and D2D content requesters may suffer interference from cellular users. We can represent the system model in physical domain as a graph G V p , E p , where V p indicates users and E p denotes the data transmission quality for channel. G V p , E p indicates if user's communication requirement can be met in physical domain.
Users' social attributes can be represented as social domain G(V s , E s ), where V s indicates the users corresponding to users in physical domain and E s denotes the social relationship between D2D users. Social relationship can be defined as S k,n , S k,n ∈ [0, 1]. A larger S k,n means a closer social relationship and users should be more willing to cooperate with each other.

Social-Aware-Based Resource Allocation
The social-aware-based NOMA-enhanced D2D resource allocation proposed in this paper includes three steps: (1) form D2D clusters according to certain rules, (2) allocate channels for D2D clusters, and (3) optimize transmit power for D2D users in D2D clusters. The formation of clusters mainly considers the user's content requirements, physical location, and social relationship with other users. When D2D clusters are formed, the many-to-one matching game is utilized to allocate channels for D2D users. After converting the nonconvex optimization problem to a convex problem via SCA, GA is performed to solve the D2D transmit power optimization.
where req n indicates the request content of D2D content requester DR n , cache k indicates the cache content of D2D content provider DT k . d k,n represents the distance between DT k and DR n , whereas d th indicates the D2D communication range. S k,n denotes the social relationship between DT k and DR n . (•) represents the dot product between vectors and • 1 represents the 1-norm of a vector (the sum of all elements in the vector). |•| represents the number of elements in •. The first term on the right side of Equation (1) indicates the degree of content matching between DT k and DR n . The second term indicates their physical distance factor and the third term indicates their social relationship factor. All influencing factors are normalized according to other D2D content providers in the cluster D n .(ω 1 , ω 2 , ω 3 ) is the weighting factor which satisfies ω 1 + ω 2 + ω 3 = 1.
According to the utility function in Equation (1), the D2D content requester selects the D2D content provider with the largest utility within the D2D communication range and adds it to his cluster until no D2D content provider nearby can increase his utility. If a D2D content provider is selected by several D2D content requesters, he will choose the one with the largest utility. After every D2D content requester has drawn up a shortlist for his cluster, the cluster formation is done. The proposed cluster formation algorithm is shown in Algorithm 1. For k = 1:K 3: If d k,n < d th 4: Calculate the utility U n DR of DT k and DR n according to Equation (1) 5: End if 6: End for 7: Compare and select DT k who obtains the largest U n DR to join D n 8: If DT k has been selected by DR n 9: Compare U n DR and U n DR , select the one with larger utility and restart the loop 10: End if 11: While Equation (1) 12: For k = 1:K 13: If d k,n < d th 14: Calculate the increased utility ∆U n,k DR according to Equation (1)

Optimization Model
After D2D clusters have been formed, users in the cell are divided into five categories: (1) cellular users whose channel resources can be reused by D2D users, (2) D2D content requesters in D2D clusters, (3) D2D content providers in D2D clusters, (4) D2D content requesters who failed to find a D2D content provider and can only request BS for content files via traditional cellular communication, and (5) unselected D2D content providers.
Assume that each cellular user is assigned with a dedicated channel. A D2D cluster can only reuse one cellular channel while each cellular channel can be reused by multiple D2D clusters. Therefore, the signal received by BS on the cellular channel SC m can be defined as where P c and P k d represent the transmit power of the cellular user and the D2D content provider. g m,B and g k,B are the channel gain between cellular user C m and BS and D2D content provider DT k and BS, respectively. η m,n indicates whether D2D cluster D n reuse cellular channel SC m , i.e., SC m is reused by D n , η m,n = 1; otherwise η m,n = 0. µ n,k indicates whether DT k belongs to D n , i.e., DT k belongs to D n , µ n,k = 1; otherwise µ n,k = 0. x m and x k are the signals sent by C m and DT k . ζ m denotes the additive white Gaussian noise (AWGN) on SC m . Hence, the signal-to-interference-plus-noise-ratio (SINR) and data rate of C m are defined as where σ 2 represents the noise power.
Considering that multiple D2D content providers send files to the D2D content requester simultaneously with NOMA in D2D clusters, the signal received by the D2D content requester can be defined as where g n,k and g m,n are the channel gain between DT k and D2D content provider DR n , C m , and DR n . ρ n,n represents whether D n and D n use the same cellular channel, i.e., D n and D n use the same cellular channel, ρ n,n = 1; otherwise ρ n,n = 0. ζ n represents the AWGN at DR n . Using SIC in NOMA, the optimal decoding order is the descending order of channel gain. Therefore, the SINR and data rate of D2D content provider DT k in D2D cluster D n can be defined as k ∈ D n g n,k < g n,k P k d g n,k + n k ρ n,n µ n ,k P k d g n,k + P c g m,n + σ 2 This paper maximizes D2D users' throughput by optimizing the D2D channel and power allocation problem. Hence, the throughput maximization problem can be modeled as where Equation (8) is the optimization goal we set to maximize the sum rate of all D2D content providers in D2D clusters. Constraint (9) limits the interference D2D users cause to cellular users and ensures the cellular users' QoS. Constraint (10) ensures the D2D users' QoS. Constraint (11) indicates η m,n should be either 1 or 0, representing whether reusing SC m . Constraint (12) represents each D2D cluster can be assigned with one cellular channel. Constraint (13) represents each cellular channel can be reused by no more than w D2D clusters in order to reduce interference on cellular channels and decrease computational complexity. Constraint (14) indicates µ n,k should be either 1 or 0, and it shows the members of the D2D cluster. Constraint (15) indicates ρ n,n should be either 1 or 0, indicating whether two D2D clusters reuse the same cellular channel. Constraint (16) limits D2D content providers' transmit power.
Considering that the optimization problem is a nonconvex mixed integer nonlinear programming (MINLP) problem which is usually NP-hard and there is no systematic and effective method to directly solve such problems, we decompose the optimization problem into two subproblems to solve the D2D resource allocation problem. We solve the channel allocation problem by many-to-one matching game and power control problem by SCA and GA.

Channel Allocation
In this section, we assume that the transmit power of D2D content providers in the D2D cluster is a constant: However, if the D2D content provider has not been selected by any D2D content requester, then we have P k d = 0, ∀k {D}. Therefore, the channel allocation problem can be modeled as The channel allocation problem can be constructed as a many-to-one matching problem. A D2D cluster can only access one cellular channel and a cellular channel can be reused by no more than w D2D clusters. The cellular channel chooses to accept or reject the D2D cluster according to its own preference. When all D2D clusters are stably matched or there exist unmatched D2D clusters, but they have been rejected by all cellular channels, the matching ends.
The D2D cluster set D and the cellular channel set SC form two sets of vertices in the matching game. The matching can be represented as (D, SC, D , SC ), where D = { n } n∈D indicates the preference relations of the D2D cluster over the cellular channel and SC = { m } m∈SC indicates the preference relations of the cellular channel over the D2D cluster.

Definition 1.
In the many-to-one matching game, a matching Ω is a function from the set D ∪ SC into all subsets of D ∪ SC, such that (1) Ω(D n ) = 1, Ω(D n ) ∈ SC and Ω(D n ) = φ if D n does not match to any During the matching game, D2D clusters and cellular channels constantly make new decisions. In order to characterize the behavior of each player, the concept of a preference list can be denoted as where P(D n ) represents the preference list of D2D clusters over cellular channels and P(SC m ) represents the preference list of cellular channels over D2D clusters. The order in the preference list is based on the descending order of the utility of players. Therefore, the utility function has a great impact on forming the preference list. For the D2D cluster, whether to reuse the certain cellular channel depends on his data rate on this channel. Therefore, the utility function of the D2D cluster can be defined as It can be seen from Equation (25) that the utility of the D2D cluster is not only related to the matched cellular channel but also to other D2D clusters that reuse the same cellular channel. Therefore, the preference list of the D2D cluster can be established according to where U n (SC m , Ω) represents the utility of D n when reusing SC m in the matching Ω.
For the cellular channel, whether to accept a D2D cluster depends on the sum rate on the channel. Considering that the optimization goal of this paper is to maximize the throughput of all D2D users, we set the utility of the channel consistent with the optimization goal which is the sum rate of D2D clusters. Therefore, we can obtain the utility function of the channel as It can be seen from Equation (27) that the utility of the channel is related to each D2D cluster accessing itself. Therefore, the preference list of the cellular channel can be established according to where Ω(SC m ) represents the set of D2D clusters reusing SC m in the matching Ω. U m (Ω(SC m ), Ω) represents the utility of SC m when being reused by multiple D2D clusters in the matching Ω.
The utility of the D2D cluster can be calculated according to Equation (25) and sorted in descending order to obtain the preference list of the D2D cluster over the cellular channel. The utility of the channel can be calculated according to Equation (27) and sorted in descending order to obtain the preference list of the cellular channel. It can be seen from the two utility functions that as the matching pair changes, the decision of one D2D cluster will affect the decision of other D2D clusters, and the preference list of the cellular channel will also dynamically change. We can call this phenomenon as externality. Externality can affect the stable matching. Considering the concept of swap-matching proposed in [12], the stability of the matching game can be defined as During the matching process, the D2D cluster can be a vacant position, so that the D2D cluster can access the cellular channel that still has vacancies. Definition 2 states that two conditions must be met during the swapping process: (1) the utility of all players involved in the swapping process cannot be reduced and (2) there must be a player whose utility will increase after swapping. A matching Ω is a stable matching if it meets Definition 2.
In order to find the stable matching, we should first initialize the channel allocation. The D2D cluster access the cellular channel which provides it with the highest data rate. If the cellular channel has been reused by w D2D clusters, w + 1 cluster rate should be compared and the cluster with the lowest data rate should find the other channel. When a user accesses the cellular channel and makes someone else on this channel unable to meet the QoS, the suboptimal cellular channel should be searched until all D2D clusters are matched to form an initial match Ω 0 . Then we swap the matching pair according to the utility function of all players until the matching is stable. The proposed channel allocation based on many-to-one matching game is described in Algorithm 2.
Algorithm 2 Channel allocation based on many-to-one matching game.
Proof. Suppose that the matching Ω n,n m,m becomes Ω n ,n m,m after the swap operation, which means U m Ω n ,n m,m ≥ U m Ω n,n m,m and U m Ω n ,n m,m ≥ U m Ω n,n m,m according to Definition 2. Because the utility of the channel is related to the sum rate of D2D clusters, we have Proof. The number of D2D clusters and cellular channels in the cell is limited, and the number of D2D clusters allowed to access a cellular channel is limited. Therefore, the number of swap operations is limited. According to Theorem 1, the sum D2D rate is increased after each swap operation. After a limited number of iterations, the matching converges because there is an upper bound on the sum D2D rate due to the limited spectrum resources. In addition, assume that there still exists a swapping pair that can improve the utility of the users when the matching is stable. According to Definition 2, the user will definitely exchange the pairing to maximize the utility, which is contradictory to the assumption.
The computational complexity of the many-to-one matching game mainly depends on the number of iterations when converging. However, it is uncertain that when the matching converges. Hence, we only discuss the upper bound of the computational complexity here. According to Theorem 1, the sum rate of D2D users is increased after each swap operation. Then, we can define the rate difference between the initial match and the final match as Ψ Ω 0 →Ω * ; the minimum rate difference after each swap operation as ∆min. Therefore, the computational complexity of the matching game is O Ψ Ω 0 →Ω * ∆min in the worst case.

Power Control
In this section, we need to solve the power allocation problem for D2D content providers according to the channel allocation result η * . The power allocation problem can be described as The optimization problem is a nonconvex NP-hard problem because of the interference between D2D clusters. So as to reduce the computational complexity, we use SCA [13] to transform the optimization problem into a convex problem, and find the suboptimal solution of it.
Equation (30) can be rewritten as max P k d k∈{D} The optimization problem conforms to the following inequality according to [14]: where α k d and β k d are defined as The equality is satisfied when γ k d =γ k d . Then the lower bound of the optimization problem can be represented as where f P k d can be defined as Appl. Sci. 2020, 10, 2446

of 19
The original optimization problem can be transformed into maximizing its lower bound. We set P k d = 2P k d in order to transform the optimization problem into a convex problem. The original optimization problem can be rewritten as In the transformed optimization problem, both the optimization goal and the constraint conditions are formed by log-sum-exp function. As the log-sum-exp function is a convex structure [15], the transformed optimization problem is a convex problem. In order to prove the convexity of the optimization problem (Equation (40)), we can make the following proposition.

Proposition 1.
Assume that there are two D2D clusters in the cell reusing the same cellular channel. One D2D cluster contains one D2D content requester and one D2D content provider. They communicate via one-to-one D2D communication. The other contains one D2D content requester and two D2D content providers. They communicate via many-to-one D2D communication with NOMA in Figure 3. In such scenario, the optimization problem (Equation (40)) is convex.
The original optimization problem can be transformed into maximizing its lower bound. We set In the transformed optimization problem, both the optimization goal and the constraint conditions are formed by log-sum-exp function. As the log-sum-exp function is a convex structure [15], the transformed optimization problem is a convex problem. In order to prove the convexity of the optimization problem (Equation 40), we can make the following proposition.   Proof. The data rate of D2D content provider DT 1 , DT 2 , and DT 3 can be represented as According to previous analysis, the data rate can be rewritten as In order to maximize the sum rate of all D2D content providers in D2D clusters, the optimization goal can be defined as max P 1 ,P 2 ,P 3 We can obtain the Hessian matrix by seeking the second partial derivative of Equations (47)-(49) as We can draw the conclusion that the optimization goal is concave because Moreover, Constraints (41) and (43) are linear function about e P k d . Constraint (42) has a similar structure to the optimization goal, and the convexity will not be proofed again. As a consequence, the optimization problem is convex.
Since the optimization problem has been transformed into a convex problem, we can solve it via GA. GA searches for the optimal solution by simulating the natural evolutionary process. It finds the solution with the highest fitness through encoding, selection, crossover, and mutation. Because of the convexity of the optimization problem, we can use GA to solve the power allocation problem so as to reduce the time complexity and quickly obtain the optimal solution. The proposed power allocation method based on SCA and GA is described in Algorithm 3.
Proof. Assume the optimal solution is P k d (t) after t iterations, then we can obtain the following inequality: The first equality holds because γ k d (t) is derived from α k d (t) and β k d (t). The second inequality holds because f P k d (t + 1) is the optimal solution of the t + 1 iteration. The third inequality holds because of the lower bound theory in Equation (38). Since the sum rate of D2D users in the cell is limited, the power allocation algorithm will finally converge.
The computational complexity of the power allocation algorithm consists of two parts. The complexity of SCA depends on the number of iterations when it converges. In each iteration, the relevant parameters of each D2D content provider are calculated. Therefore, the complexity of SCA is O(T 1 |D|). The complexity of GA mainly depends on the complexity of the fitness function O( f ). Assume that population size is Q, the maximum number of iterations is T 2 , and the complexity of GA is O(T 2 QO( f )). Therefore, the total computational complexity is O(T 1 |D| + T 2 QO( f )).

Joint Optimization Method for Resource Allocation
The resource allocation is a process of allocating channel and power for D2D users in a D2D cluster. The channel allocation and power control results are continuously iterated and eventually converge. According to the previous description, the joint optimization method for resource allocation is shown in Algorithm 4. Perform channel allocation for D2D clusters in Algorithm 2 4: If channel allocation results ⊂ H i (t) i∈N 5: Perform D2D power allocation in Algorithm 3 for P k d * 6: Break 7: Else 8: Save the channel allocation result to H i (t) i∈N 9: Perform D2D power allocation in Algorithm 3 for P k d *

10:
End if 11: End while 12: Output: η * , P k d * Theorem 4. The joint resource allocation algorithm can converge to the optimal strategy.
Proof. It can be proved that there is a convergence solution for each subproblem according to the previous sections. Considering that the algorithms in each subproblem can ensure that the sum D2D rate will not decrease, and the resources in the cell are limited, we can draw a conclusion that the joint resource allocation algorithm which combines channel and power allocation will finally converge.
The computational complexity of the joint resource allocation algorithm is composed of the complexity of the two subproblems. Assume that the maximum number of iterations between the two subproblems is G, the computational complexity of the channel allocation subproblem is O 1 , and the computational complexity of the power control subproblem is O 2 . The computational complexity of the joint resource allocation is O(G (O 1 + O 2 )).

Simulation and Performance Analysis
This section investigates the performance of the proposed resource allocation algorithm with MATLAB. Figure 1 presents the system model, and the cell radius is 300 m. The channel gain is composed of large-scale fading and small-scale fading. The large-scale fading is based on distance loss and can be defined as κd −α , where d denotes the transmission distance and κ and α denote the possible fading and pathloss exponent. The small-scale fading is based on Rayleigh fading which follows CN(0, 1) [16]. We list the simulation parameters in Table 1.  Figure 4 shows the impact of the number of D2D content requesters on the average number of swap operations in the matching game. As the number of D2D content requesters increases, the number of swap operations also increases, which indicates that the number of swap-blocking pairs in the system increases. In the meanwhile, the number of cellular channels could affect the number of D2D users who can access the cellular channel. Hence, the number of potential swap-blocking pairs increases as the number of cellular channels increases. Therefore, both the cellular channel and D2D content requester could affect the swap operations. When there are 6 D2D content requesters and 5 cellular channels in the cell, the average number of swap operations is about 15. As a consequence, the matching game converges with a small number of iterations.  Figure 5 shows the impact of the number of D2D content providers on the accessed probability of D2D content requesters. D2D accessed probability indicates that D2D users communicate through D2D mode, which depends on two conditions: (1) the D2D content requester succeeds in finding D2D content providers within the D2D communication range, and filters them into the D2D cluster and (2) the D2D cluster communicates by reusing the cellular channel, and each user's QoS must be ensured on the cellular channel. If any user's QoS cannot be ensured, the D2D content requester in this D2D cluster cannot communicate in the D2D mode. It can be seen from Figure 5 that as the number of D2D content providers increases, the D2D accessed probability continues to increase while the trend slows down. This is because D2D content providers correspond to the first condition we proposed. As the number of D2D content providers increases, the possibility of forming the D2D clusters increases. Hence, the D2D accessed probability increases. However, it becomes saturated for D2D content requesters with more and more D2D content providers, and more D2D content providers are less meaningful for clustering. As a consequence, the curve tends to be flat. Moreover, the number of cellular channels corresponds to the second condition. The more cellular channels, the more channels D2D users can choose, which also has a certain impact on D2D accessed probability.  Figure 5 shows the impact of the number of D2D content providers on the accessed probability of D2D content requesters. D2D accessed probability indicates that D2D users communicate through D2D mode, which depends on two conditions: (1) the D2D content requester succeeds in finding D2D content providers within the D2D communication range, and filters them into the D2D cluster and (2) the D2D cluster communicates by reusing the cellular channel, and each user's QoS must be ensured on the cellular channel. If any user's QoS cannot be ensured, the D2D content requester in this D2D cluster cannot communicate in the D2D mode. It can be seen from Figure 5 that as the number of D2D content providers increases, the D2D accessed probability continues to increase while the trend slows down. This is because D2D content providers correspond to the first condition we proposed. As the number of D2D content providers increases, the possibility of forming the D2D clusters increases. Hence, the D2D accessed probability increases. However, it becomes saturated for D2D content requesters with more and more D2D content providers, and more D2D content providers are less meaningful for clustering. As a consequence, the curve tends to be flat. Moreover, the number of cellular channels corresponds to the second condition. The more cellular channels, the more channels D2D users can choose, which also has a certain impact on D2D accessed probability.   Figure 5 shows the impact of the number of D2D content providers on the accessed probability of D2D content requesters. D2D accessed probability indicates that D2D users communicate through D2D mode, which depends on two conditions: (1) the D2D content requester succeeds in finding D2D content providers within the D2D communication range, and filters them into the D2D cluster and (2) the D2D cluster communicates by reusing the cellular channel, and each user's QoS must be ensured on the cellular channel. If any user's QoS cannot be ensured, the D2D content requester in this D2D cluster cannot communicate in the D2D mode. It can be seen from Figure 5 that as the number of D2D content providers increases, the D2D accessed probability continues to increase while the trend slows down. This is because D2D content providers correspond to the first condition we proposed. As the number of D2D content providers increases, the possibility of forming the D2D clusters increases. Hence, the D2D accessed probability increases. However, it becomes saturated for D2D content requesters with more and more D2D content providers, and more D2D content providers are less meaningful for clustering. As a consequence, the curve tends to be flat. Moreover, the number of cellular channels corresponds to the second condition. The more cellular channels, the more channels D2D users can choose, which also has a certain impact on D2D accessed probability.  Figure 6 illustrates the impact of the number of D2D content providers on the D2D accessed probability. Along with the increase of the number of D2D content requesters, the channel resources are relatively decreased, and the interference between D2D clusters is relatively increased. Hence, the D2D accessed probability is continuously decreased. When the channel resources are sufficient, the impact of D2D content requesters on the accessed probability is much smaller than when the channel resources are scarce.  Figure 6 illustrates the impact of the number of D2D content providers on the D2D accessed probability. Along with the increase of the number of D2D content requesters, the channel resources are relatively decreased, and the interference between D2D clusters is relatively increased. Hence, the D2D accessed probability is continuously decreased. When the channel resources are sufficient, the impact of D2D content requesters on the accessed probability is much smaller than when the channel resources are scarce.  Figure 7 shows the impact of the number of D2D content providers on the D2D throughput. As the number of D2D content providers increases, D2D throughput continues to increase, but the trend slows. The more D2D content providers in the cell, the more users may exist in the D2D cluster. Hence, the D2D throughput can be further increased with NOMA. However, with more users in the D2D cluster, the interference between them also becomes more complicated. Moreover, there are certain standards when D2D users are clustered. As the number of D2D content providers in the cell increases, the number of users in the cluster may increase as well, but it will not increase infinitely. As users in the cluster gradually become saturated, D2D throughput increases with a slower trend. Moreover, the more cellular channels represent the more available channel resources. More D2D clusters can access in the cellular channel with small interference when channel resources are sufficient. Therefore, more the cellular channels, the faster the D2D throughput increases.  Figure 7 shows the impact of the number of D2D content providers on the D2D throughput. As the number of D2D content providers increases, D2D throughput continues to increase, but the trend slows. The more D2D content providers in the cell, the more users may exist in the D2D cluster. Hence, the D2D throughput can be further increased with NOMA. However, with more users in the D2D cluster, the interference between them also becomes more complicated. Moreover, there are certain standards when D2D users are clustered. As the number of D2D content providers in the cell increases, the number of users in the cluster may increase as well, but it will not increase infinitely. As users in the cluster gradually become saturated, D2D throughput increases with a slower trend. Moreover, the more cellular channels represent the more available channel resources. More D2D clusters can access in the cellular channel with small interference when channel resources are sufficient. Therefore, more the cellular channels, the faster the D2D throughput increases. Figure 8 illustrates the impact of the number of D2D content requesters on the D2D throughput. Along with the increase of the number of D2D content requesters, the D2D throughput continues to increase. It can be seen that D2D throughput increases at a faster rate when the channel resources are sufficient because of the relatively small interference. Moreover, our algorithm is obviously superior to that in Reference [17] because of the one-to-one D2D communication Reference [17] uses. Since [17] did not consider NOMA in D2D groups, the throughput is lower than that in this paper, and our advantage becomes larger with more D2D users.   Figure 8 illustrates the impact of the number of D2D content requesters on the D2D throughput. Along with the increase of the number of D2D content requesters, the D2D throughput continues to increase. It can be seen that D2D throughput increases at a faster rate when the channel resources are sufficient because of the relatively small interference. Moreover, our algorithm is obviously superior to that in Reference [17] because of the one-to-one D2D communication Reference [17] uses. Since [17] did not consider NOMA in D2D groups, the throughput is lower than that in this paper, and our advantage becomes larger with more D2D users.

Conclusions
We propose a D2D cluster resource allocation method which combines channel allocation and power control in this paper. First, we present the system model of cellular users and D2D users which includes D2D content requesters and D2D content providers. The utility function of D2D   Figure 8 illustrates the impact of the number of D2D content requesters on the D2D throughput. Along with the increase of the number of D2D content requesters, the D2D throughput continues to increase. It can be seen that D2D throughput increases at a faster rate when the channel resources are sufficient because of the relatively small interference. Moreover, our algorithm is obviously superior to that in Reference [17] because of the one-to-one D2D communication Reference [17] uses. Since [17] did not consider NOMA in D2D groups, the throughput is lower than that in this paper, and our advantage becomes larger with more D2D users.

Conclusions
We propose a D2D cluster resource allocation method which combines channel allocation and power control in this paper. First, we present the system model of cellular users and D2D users which includes D2D content requesters and D2D content providers. The utility function of D2D content requesters is defined combined with the social relationship among D2D users in order to form D2D clusters. D2D users in D2D clusters communicate by reusing cellular channels. NOMA is

Conclusions
We propose a D2D cluster resource allocation method which combines channel allocation and power control in this paper. First, we present the system model of cellular users and D2D users which includes D2D content requesters and D2D content providers. The utility function of D2D content requesters is defined combined with the social relationship among D2D users in order to form D2D clusters. D2D users in D2D clusters communicate by reusing cellular channels. NOMA is used in D2D clusters for many-to-one communication. In order to ensure the QoS of each user, we also set the SINR threshold. Second, the resource allocation problem is decoupled into two subproblems. Many-to-one matching game is used to allocate channels for D2D clusters. The nonconvex optimization problem is transformed into a convex problem which can be solved by GA through SCA. Hence, we can easily obtain the optimal D2D transmit power. We also discuss the convergence and the computational complexity, respectively. Finally, we set historical channel allocation set and obtain the stable solution through iterating over the two subproblems. The simulation results show the superiority of our algorithm for it can significantly improve the system throughput. Moreover, by considering social relationship between users, we can obtain a more realistic resource allocation scheme.
Author Contributions: W.G. conceived the proposal of the paper, analyzed the data, and performed experiments using MATLAB. Q.Z. provided guidance, key suggestions, and finalized the paper. All authors have read and agreed to the published version of the manuscript.
Funding: This work is supported by the National Natural Science Foundation of China (61971239 and 61631020) and Postgraduate Research and Practice Innovation Program of Jiangsu Province (KYCX19_0945).

Conflicts of Interest:
The authors declare no conflicts of interest.