Energy Efficiency of D2D Multi-User Cooperation

The Device-to-Device (D2D) communication system is an important part of heterogeneous networks. It has great potential to improve spectrum efficiency, throughput and energy efficiency cooperation of multiple D2D users with the advantage of direct communication. When cooperating, D2D users expend extraordinary energy to relay data to other D2D users. Hence, the remaining energy of D2D users determines the life of the system. This paper proposes a cooperation scheme for multiple D2D users who reuse the orthogonal spectrum and are interested in the same data by aiming to solve the energy problem of D2D users. Considering both energy availability and the Signal to Noise Ratio (SNR) of each D2D user, the Kuhn-Munkres algorithm is introduced in the cooperation scheme to solve relay selection problems. Thus, the cooperation issue is transformed into a maximum weighted matching (MWM) problem. In order to enhance energy efficiency without the deterioration of Quality of Service (QoS), the link outage probability is derived according to the Shannon Equation by considering the data rate and delay. The simulation studies the relationships among the number of cooperative users, the length of shared data, the number of data packets and energy efficiency.


Introduction
As multimedia communication develops, traditional cellular networks will not be able to handle large amounts of data and support high-speed transmission. D2D communication can help enhance data rate, system capacity and spectrum efficiency through short-range communication among users directly by reusing the spectrum of cellular network [1][2][3], which gives users a better communication experience than the traditional cellular network.
Furthermore, D2D pairs can build a self-organizing system by establishing connections with the help of a cellular network. Due to flexibility, multiple D2D users who want to receive the same data from an Evolved Node B (eNB) can organize a cluster, and a cluster head is chosen to receive the data from the eNB to share with cluster members by dividing the data into multiple data packets, which is the mesh D2D service introduced in Reference [4]. Regarded as a proximity service, D2D services are sufficiently flexible to adapt to various complex heterogeneous networks in the future.
D2D communication is an important part of heterogeneous networks. The spectrum efficiency, throughput and energy efficiency can be improved by interference suppression, resource allocation and relay selection schemes [5][6][7][8]. Many studies show that most researches on short-range communication systems focus on improving communication reliability and data rate among users [9][10][11]. As D2D users communicate directly with each other through short-range communication (which consumes a small amount of energy due to the short distance [12]), whether the users can provide enough energy for the packet transmission or not is usually ignored. In fact, though the cooperation among a large Sensors 2017, 17, 697 2 of 12 number of D2D users can effectively enhance the spectrum efficiency and throughput of heterogeneous networks [13], the amount of consumed energy of each D2D user obviously rises with the number of cooperative users. Hence, it is necessary to take the energy availability of each user into account when there are multiple cooperative users.
Traditional ways of choosing relaying users were based on the maximum SNR [14,15], which resulted in high energy consumption. On one hand, particular users are chosen by multiple users simultaneously, which results in energy waste. On the other hand, particular users will be chosen at different times, which will cost these particular users a large amount of energy. Hence, it is not appropriate to choose relaying D2D users based on the maximum SNR when there are multiple cooperative users.
In the D2D cluster, some D2D users will consume additional energy as the relaying of other D2D users to receive data from the base station and then relay the data to corresponding D2D user. Which will cost these part of relaying D2D users a large amount of energy. In order to avoid excessive energy consumption of some D2D users and decrease of the system lifetime, this paper reduces the energy consumption of the single D2D user by preventing a D2D user from being chosen as a relaying by multiple D2D user at the same time and always being chosen at different times. So, we restrict that the relaying D2D user only relays data for one of the other D2D users. Then the key is how to match multiple relaying D2D users with the rest of multiple D2D users. The Kuhn-Munkres algorithm is a classic algorithm in graph theory to find the optimal match of weighted bipartite graph. Motivated by the application of the Kuhn-Munkres algorithm in Reference [16], where the Kuhn-Munkres algorithm was introduced to solve the matching problem of maximizing transmission capacity, this paper adopts the Kuhn-Munkres algorithm to deal with this issue. Hence, the D2D multi-user cooperation issue is transformed into a MWM problem.
This paper aims to solve the energy problem of D2D users when there are multiple D2D users cooperating. In the D2D communication system, D2D users who want to receive the same data form a cluster by a self-organizing connection with the help of a cellular network. D2D users use different spectrums to provide mesh D2D service to avoid co-channel interference. The main contributions of this paper are as follows:

1.
A D2D multi-user cooperation scheme is proposed, choosing the relaying D2D users by considering both energy availability and the SNR of each D2D user. Each relaying D2D user can be prevented from being chosen by multiple D2D users at both the same time and at different times with the help of the Kuhn-Munkres algorithm.

2.
To guarantee high data rate and low delay, the outage probability of the D2D link is derived according to the Shannon Equation and the system energy efficiency is analyzed combined with the outage probability of a D2D link.

3.
To achieve D2D multi-user cooperation with high energy efficiency in different communication environments, the relationships among the number of cooperative users, the length of shared data, the number of data packets and the energy efficiency are studied in the simulation.

Cooperation of D2D Multiple Users
In a heterogeneous network which consists of a cellular and D2D network, multiple D2D users who are interested in the same data form a cluster with the help of a cellular network. The cooperation system is shown in Figure 1, where G 1 , G 2 , G 3 are different clusters and S 1 , S 2 , S 3 are their cluster heads. After receiving the data, the cluster head divides the data into several data packets and sends parts of them to cluster members, than the cluster members cooperate with each other to share what they have received from the cluster head.
Due to the limitation of energy, we have to ensure that each D2D user is prevented from being chosen as the relaying user by multiple D2D users at both the same time and at different times. Meanwhile, the length and the number of data packets can be changed according to various communication environments to reach a high energy efficiency. Sensors 2017, 17, 697 3 of 12 Figure 1. D2D multi-user cooperation within a heterogeneous network.
D2D multi-user cooperation within a cluster is shown in Figure 2. |Y| is the number of set Y. We suppose that there are K + 1 D2D users within a cluster which included one cluster head S and K cluster members. S chooses x relaying D2D users from K cluster members to receive data packet and x changes according to the various communication environments. We suppose that K = ax + b, where a, b are integers and 1,0 a b x    . Hence there are four types of cooperation situations.
, , , a x N n n n   . Next, the relaying D2D users are chosen from the set whose members have not yet received data packet. For example, x D2D users of N1 will be chosen by Y1 as relaying D2D users and relay to the rest (up to x D2D users).
The cooperation process has two parts: (1). S chooses x relaying D2D users; and (2). x relaying D2D users pair with the rest of the D2D users and relay the data packet to them.
In the first part, in order to ensure that the chosen x relaying D2D users have enough energy to relay the data packet, S chooses v D2D users whose energy is higher than energy threshold I and these v D2D users form set V: where j B is the energy of D2D user j U . We supposed that the channel state information (CSI) is known by each D2D user. S chooses x relaying D2D users from V according to remaining energy and the channel qualities of the candidates. We let SNR represent the channel quality, where are SNRs of members of V, and the bit error rates can be calculated with SNRs D2D multi-user cooperation within a cluster is shown in Figure 2. |Y| is the number of set Y. We suppose that there are K + 1 D2D users within a cluster which included one cluster head S and K cluster members. S chooses x relaying D2D users from K cluster members to receive data packet and x changes according to the various communication environments. We suppose that K = ax + b, where a, b are integers and a ≥ 1, 0 ≤ b ≤ x. Hence there are four types of cooperation situations.

1.
a = 1, b = 0, namely, K = x. S has enough energy to broadcast data packet to K D2D users and the SNR of each D2D user is good enough to decode the data packet. 2. a = 1, 0 < b < x, namely, K = x + b. The chosen x relaying D2D users form set Y 1 y 1 1 , y 1 2 , · · ·y 1 x and the rest of K -x = b D2D users form set N 1 n 1 1 , n 1 2 , · · ·, n 1 b . If we regard D2D users as nodes and communications between D2D users as lines, set Y 1 y 1 1 , y 1 2 , · · ·y 1 x and N 1 n 1 1 , n 1 2 , · · ·, n 1 b can form a bipartite graph G 1 (Y 1 , N 1 ). First, S broadcasts the data packet to Y 1 before the D2D users of N 1 pair with the relaying D2D users of Y 1 with a one to one match.

3.
a > 1, b = 0, namely, K = ax. S first broadcasts the data packet to chosen x relaying D2D users. These chosen relaying D2D users form set Y 1 y 1 1 , y 1 2 , · · ·y 1 x and the rest of (a − 1)x D2D users form set N 1 n 1 1 , n 1 2 , · · ·, n 1 (a−1)x . Next, the relaying D2D users are chosen from the set whose members have not yet received data packet. For example, x D2D users of N 1 will be chosen by Y 1 as relaying D2D users and relay to the rest (up to x D2D users).
The cooperation process has two parts: (1). S chooses x relaying D2D users; and (2). x relaying D2D users pair with the rest of the D2D users and relay the data packet to them.
In the first part, in order to ensure that the chosen x relaying D2D users have enough energy to relay the data packet, S chooses v D2D users whose energy is higher than energy threshold I and these v D2D users form set V: where B j is the energy of D2D user U j . We supposed that the channel state information (CSI) is known by each D2D user. S chooses x relaying D2D users from V according to remaining energy and the channel qualities of the candidates. We let SNR represent the channel quality, where SNR 1 , · · ·, SNR v are SNRs of members of V, and the bit error rates can be calculated with SNRs according to the modulation method. Supposing that P 1 b , · · ·, P v b are respective bit error rates and E 1 d , · · ·, E v d are consumed energy by S for sending the data packe D(bit) to V, we rank E 1 d , · · ·, E v d from the smallest to the largest and obtain the ranked sequence E 1 , E 2 , · · ·, E v . The former x D2D users are chosen as Cooperation mode of multiple D2D users within a cluster.
In the second part, the chosen x relaying D2D users of Y1 choose b (K = x + b) or x (K = ax + b, a > 1) D2D users from N1 with a one to one match. The future chosen b D2D users do not relay the same data packet, while the future chosen x D2D users do. Hence, we will analyze the outcome in two situations: . It is possible for each member of Y1 to be chosen by multiple D2D users of N1 and each member of N1 will receive the same data packet from multiple relaying D2D users of Y1, which will cost large amounts of energy for D2D users. In order to save the energy of each D2D user without the deterioration of QoS, the Kuhn-Munkres algorithm is adopted to pair Y1 and N1 with a one to one match.
The D2D users and their cooperation can be regarded as dots and lines in the bipartite graph. Y1 and N1 form a bipartite graph After paired by Kuhn-Munkres algorithm, the adjacency matrix of the paired D2D users can be expressed as:  In the second part, the chosen x relaying D2D users of Y 1 choose b (K = x + b) or x (K = ax + b, a > 1) D2D users from N 1 with a one to one match. The future chosen b D2D users do not relay the same data packet, while the future chosen x D2D users do. Hence, we will analyze the outcome in two situations: 1 , y 1 2 , · · ·y 1 x will pair with N 1 n 1 1 , n 1 2 , · · ·, n 1 b . It is possible for each member of Y 1 to be chosen by multiple D2D users of N 1 and each member of N 1 will receive the same data packet from multiple relaying D2D users of Y 1 , which will cost large amounts of energy for D2D users. In order to save the energy of each D2D user without the deterioration of QoS, the Kuhn-Munkres algorithm is adopted to pair Y 1 and N 1 with a one to one match.
The D2D users and their cooperation can be regarded as dots and lines in the bipartite graph. Y 1 and N 1 form a bipartite graph G 1 (Y 1 , N 1 ). After paired by Kuhn-Munkres algorithm, the adjacency matrix of the paired D2D users can be expressed as: and a i,j = 1 means that y 1 i is the relaying D2D user of n 1 j . The SNRs of cooperation links among Y 1 and N 1 can be calculated according to the CSI, which can be expressed as a matrix: where γ i,j , 1 ≤ i ≤ x, 1 ≤ j ≤ K − x represents the SNR of D2D user U j whose relaying D2D user is U i . Next, the SNRs of each row is ranked from the largest to the smallest and given labels K − x, · · ·, 1, which means that the larger the SNR the bigger the label is given to the respective D2D user. Thus, the corresponding label matrix can be expressed as: where l i,j represents the weight of line which connects U i and U j in bipartite graph G 1 (Y 1 , N 1 ). The larger weight means better communication quality. Hence, we adopt the Kuhn-Munkres algorithm to match Y 1 and N 1 with the maximum SNR. As the Kuhn-Munkres algorithm requires that Y 1 and N 1 should be equal, x − (K − x) zeros are added to each row of label matrix L to make a square matrix L : · · · l x,1 · · · l x,K−x 0 · · · 0 · · · · · · · · · 0 · · · 0 each column is 0 from x is smaller than that of N 1 n 1 1 , n 1 2 , · · ·, n 1 (a−1)x+b . The x D2D users chosen by Y 1 from N 1 will be the relaying D2D users of the rest of (a − 2)x + b D2D users of N 1 . Y 1 and N 1 are supposed to form bipartite graph. G 2 (Y 1 , N 1 ). Hence, before matching Y 1 and N 1 based on SNRs, it is necessary to consider the energy of the relaying candidates. v D2D users whose maintaining energy B i is bigger than energy threshold I are chosen from N 1 to form set V : Then, Y 1 is matched with V according to the SNRs as in Situation A. The corresponding expanding label matrixL can be expressed as: 1,1 · · ·l 1,v · · · · · · · · · l x,1 · · ·l x,v 0 · · · 0 · · · · · · · · · 0 · · · 0 each row is 0 from The adjacency matrix of the paired D2D users can be expressed as: a 1,1 · · · a 1,m · · · · · · · · · a m,1 · · · a m,m    , m = min(x, K − x) There is only one 1 in each row and each column, which means that a i,j = 1 and a h,c = 1 when i = h, j = c. The rest of the elements are all zero. Hence users U i , U h of Y 1 pair with U j , U c of N 1 , respectively.

Analysis of System Energy Efficiency
Different users have various requirements regarding the same service and one user has different requirements for different services. These differences lead to differences of energy consumption because of the outage probability, which is affected by requirements of QoS in terms of delay and data rate. Hence, it is necessary to take delay and data rate into account when analyzing link outage probability to examine system energy efficiency.

Link Outage Probability
The link is supposed to interrupt when delay τ min is bigger than threshold τ th or data rate R is higher than the maximum data rate R m , which is defined by the Shannon Equation.
Hence, the outage probability can be expressed as P out = 1 − P{R ≤ R m , τ min ≤ τ th }, where R m = B log 2 1 + Pow|h| 2 /N 0 B , τ min = τ tmin + τ rmin + τ p . N 0 is single side band noise power spectral density; h is channel gain and |h| 2 follows independent exponential distribution whose variance is 1/λ 2 [17]. B is bandwidth and Pow is transmission power. τ min = τ tmin + τ rmin + τ p . τ tmin , τ rmin and τ p are minimum transmission delay, reception delay and propagation delay, respectively. We ignore the propagation delay because of the short distance and suppose that the transmission delay is equal to the reception delay. τ tmin = τ rmin = D/R m . D is the length of the packet. The outage probability P out can be expressed as: The energy consumption E of sharing a data packet between two D2D users includes transmission energy E t , reception energy E r and procession energy E p . We suppose that E tr = E t + E r = 2E t = 2E r , so E = E tr + E p because E t = D · E bit /(1 − P out ), and the total energy consumption of each link can be expressed as E = 2D · E bit /P pass + E p , where E bit is the consumed energy for 1 bit.

System Energy Efficiency
In order to analyze the energy efficiency of the whole cooperation process of sharing data L, we have to sum up the energy consumption of each link according to the cooperation scheme analyzed in Section 2. We suppose that cluster head S divides data L into n data packets and share with K D2D users within the cluster. The length of each data packet is D d and L = n ∑ d=1 D d . S broadcasts data packet D d to x d D2D users first and then these x d D2D users will be the relaying D2D users to relay data packet to the rest of K − x d D2D users.
There are two types of links within a cluster including head-to-member links and member-to-member links, namely, S − to − U m and U m − to − U j . The outage probabilities of S − to − U m and U m − to − U j can be expressed as: Hence the energy consumption of S sending data packet D d to D2D user U m can be expressed as E m = 2D d · E m−bit /(1 − P m−out ) + E mp , where E mp is the energy consumption of U m for processing data packet D d . Thus, the total energy consumption of S for broadcasting data D d to x d D2D users can be expressed as: The energy consumption of D2D user U m for sending data packet D d to D2D user U j can be where E jp is the energy consumption of U j for processing data packet D d .
The total energy consumption of K D2D users for sharing data packet D d should be analyzed in two situations: A. a = 1, 0 ≤ b < x d . According to the adjacency matrix of the paired D2D users of G 1 (Y 1 , N 1 ), the corresponding energy consumption matrix can be expressed as: where E m j is the energy consumption for relaying data packet from U m to U j . E m j = 0 means that U m does not relay the data packet to U j . There is only one member bigger than zero in each column and up to one member who is bigger than zero in each row. Furthermore, there are b rows where there is only one member bigger than zero in each row and the rest of x d − (K − x d ) are all zeros. In other words, if E m j = 0 and E i n = 0 only when m = i and j = n. The total energy consumption of cooperation between Y 1 and N 1 can be expressed as: (14) where E m j = 0 only when a m,j = 0. B. a > 1, 0 ≤ b < x d . D2D users will be paired by using Kuhn-Munkres algorithm for a + 1 times. The adjacency matrixes of the paired D2D users can be expressed as:  (16) There is one 1 in each row and each column. In other words, (g) b m,j = 1 and (g) b i,n = 1 only when m = i, j = n, g ∈ (1, · · ·, a + 1). The B a+1 will be an empty matrix if b = 0. Thus, the energy consumption matrixes of paired D2D users of G g Y g , N g can be expressed as: , g ∈ (1, · · ·a + 1) (17) There is only one member bigger than zero in each row and each column and there are x d columns, where there is only one member bigger than zero in each column. The rest of the |(K − g · x d ) − x d | columns are all zeros. In other words, (g) E m j = 0 and (g) E i n = 0 when m = i, j = n. The total energy consumption of cooperation between Y 1 and N 1 can be expressed as: j represents the energy consumption of the cooperation between user U m and U j . U m and U j are paired by using the gth Kuhn-Munkres.
Hence, the total energy consumption of sharing one packet D d among K users can be expressed as: If S divides data L into n packets and the length of each packet is D d , the total energy consumption of sharing L with K users can be expressed as The energy efficiency will be expressed as: where E L represents the total energy consumption when all the outage probabilities of links are 0.

Simulation Results
In order to achieve D2D multi-user cooperation with a high energy efficiency in different communication environments, the relationships among the number of cooperative users K, the length of shared data L, the number of date packets n, and energy efficiency are studied in this section. We evaluate the system performance in terms of link outage probability and system energy efficiency.
Note that the bandwidth consumed in the D2D communication is 5 MHz and single side band noise power spectral density N 0 is −174 dB/Hz. We suppose that all channel gains followed independent exponential distribution (IED) where variance is 1. The packet error rate can be calculated according to the SNR. We adopt binary quadrature amplitude modulation (QAM) in the Additive Gaussian White Noise (AWGN) channel. Other simulation parameters are listed in Table 1.

Parameters Values
Distances between D2D users (m) 10-25 Transmission power (dBm) 15-30 Average SNR of D2D link (dB) 10 Total length of data L (bits) 256, 512, 1024 Average delay threshold τth (µs) 1, 2, 3 The number of D2D users within cluster K 10-300 The number of data packets n τ n imin 1, 3, 6 Transmission power of cluster head S (dBm) 24 Constant overhead of each data packet (bits) 10 Figure 3 shows the relationships between the average SNR, average delay threshold of D2D link and outage probability. We suppose that the total length of data is L = 512 bits, the number of D2D users within cluster is K = 100, and the number of data packets was n = 6. Figure 3 shows that the outage probability decreased as average SNR increased since the higher SNR indicates better channel quality, which is conducive to successful transmission. The higher delay constraint led to higher outage probability since the link is interrupted when the delay is beyond the maximum delay the D2D user willing to tolerate.
of shared data L, the number of date packets n, and energy efficiency are studied in this section. We evaluate the system performance in terms of link outage probability and system energy efficiency.
Note that the bandwidth consumed in the D2D communication is 5 MHz and single side band noise power spectral density N0 is −174 dB/Hz. We suppose that all channel gains followed independent exponential distribution (IED) where variance is 1. The packet error rate can be calculated according to the SNR. We adopt binary quadrature amplitude modulation (QAM) in the Additive Gaussian White Noise (AWGN) channel. Other simulation parameters are listed in Table 1. Transmission power of cluster head S (dBm) 24 Constant overhead of each data packet (bits) 10 Figure 3 shows the relationships between the average SNR, average delay threshold of D2D link and outage probability. We suppose that the total length of data is L = 512 bits, the number of D2D users within cluster is K = 100, and the number of data packets was n = 6. Figure 3 shows that the outage probability decreased as average SNR increased since the higher SNR indicates better channel quality, which is conducive to successful transmission. The higher delay constraint led to higher outage probability since the link is interrupted when the delay is beyond the maximum delay the D2D user willing to tolerate.  Figure 4 shows the relationships between the total length of data L, the number of data packets n and the energy efficiency. The number of D2D users within the cluster is K = 100, the average SNR of D2D link is 10 dB, and the average delay threshold of D2D link is τth = 2 μs. Figure 4 shows that when the total length of data L is less than a certain value, the energy efficiency of one data packet is  Figure 4 shows the relationships between the total length of data L, the number of data packets n and the energy efficiency. The number of D2D users within the cluster is K = 100, the average SNR of D2D link is 10 dB, and the average delay threshold of D2D link is τ th = 2 µs. Figure 4 shows that when the total length of data L is less than a certain value, the energy efficiency of one data packet is higher than the others. This behavior can be attributed to excessive data packets leading to more extraordinary relaying energy consumption on overhead, which wastes energy rather than improving energy efficiency.
Meanwhile, the energy efficiency of a six data packet is higher than that of the others when the total length of data L is larger than a certain value. This is due to the shorter data packet, which reduces the outage probability and ensures a reliable transmission for a long data stream. Figure 5 shows the relationships between the number of D2D users within cluster K, the total length of data L and energy efficiency. The number of data packets is n = 6, the average SNR is 10 dB and the average delay threshold is τ th = 2 µs. Figure 5 shows that the energy efficiency of the proposed D2D multi-user cooperation scheme for the case of L = 512 bits outperforms other cases in the AWGN environment. This occurs when the number of data packets n is constant as the excessive long data sequence leads to long data packets creating a high outage probability, which results in decreasing energy efficiency. Meanwhile, when the data sequence is short, excessive data packets leads to wasted energy for relaying overhead.
Sensors 2017, 17, 697 10 of 12 higher than the others. This behavior can be attributed to excessive data packets leading to more extraordinary relaying energy consumption on overhead, which wastes energy rather than improving energy efficiency. Meanwhile, the energy efficiency of a six data packet is higher than that of the others when the total length of data L is larger than a certain value. This is due to the shorter data packet, which reduces the outage probability and ensures a reliable transmission for a long data stream.  Figure 5 shows the relationships between the number of D2D users within cluster K, the total length of data L and energy efficiency. The number of data packets is n = 6, the average SNR is 10 dB and the average delay threshold is τth = 2 μs. Figure 5 shows that the energy efficiency of the proposed D2D multi-user cooperation scheme for the case of L = 512 bits outperforms other cases in the AWGN environment. This occurs when the number of data packets n is constant as the excessive long data sequence leads to long data packets creating a high outage probability, which results in decreasing energy efficiency. Meanwhile, when the data sequence is short, excessive data packets leads to wasted energy for relaying overhead.
Furthermore, Figure 5 also shows that for the case of L = 1024 and L = 512, the energy efficiency almost keeps stable when K increases. For the case of L = 216, when the number of cluster D2D users K is smaller than a certain value, energy efficiency rises very slowly with the increase of K, but also decreases quickly when K is larger than a certain value. This is because the amount of consumed energy for relaying excessive short data packets with constant overhead to many D2D users is excessive. Figure 5. Relationships between the number of cluster D2D users K, the total length of data L and energy efficiency, n = 6, SNR = 10 dB and τth = 2 μs.   . Relationships between the total length of data L, the number of data packets n and the energy efficiency (EE), and K = 100, SNR = 10 dB, τth = 2 μs. Figure 5 shows the relationships between the number of D2D users within cluster K, the total length of data L and energy efficiency. The number of data packets is n = 6, the average SNR is 10 dB and the average delay threshold is τth = 2 μs. Figure 5 shows that the energy efficiency of the proposed D2D multi-user cooperation scheme for the case of L = 512 bits outperforms other cases in the AWGN environment. This occurs when the number of data packets n is constant as the excessive long data sequence leads to long data packets creating a high outage probability, which results in decreasing energy efficiency. Meanwhile, when the data sequence is short, excessive data packets leads to wasted energy for relaying overhead.
Furthermore, Figure 5 also shows that for the case of L = 1024 and L = 512, the energy efficiency almost keeps stable when K increases. For the case of L = 216, when the number of cluster D2D users K is smaller than a certain value, energy efficiency rises very slowly with the increase of K, but also decreases quickly when K is larger than a certain value. This is because the amount of consumed energy for relaying excessive short data packets with constant overhead to many D2D users is excessive. Figure 5. Relationships between the number of cluster D2D users K, the total length of data L and energy efficiency, n = 6, SNR = 10 dB and τth = 2 μs. Furthermore, Figure 5 also shows that for the case of L = 1024 and L = 512, the energy efficiency almost keeps stable when K increases. For the case of L = 216, when the number of cluster D2D users K is smaller than a certain value, energy efficiency rises very slowly with the increase of K, but also decreases quickly when K is larger than a certain value. This is because the amount of consumed energy for relaying excessive short data packets with constant overhead to many D2D users is excessive.
From the above analysis, it is obvious that energy efficiency can reach a peak value at certain K or L. Hence, it is possible to achieve high energy efficiency in different communication environments where multiple D2D users cooperate by coordinating the number of cooperative users K, the length of shared data L, and the number of date packets n.

Conclusions
D2D communication has great potential in handling problems within complex heterogeneous networks because of its strong flexibility, which has seen wide attention in recent years. D2D multi-user cooperation is considered as an important way of improving spectrum efficiency, throughput and energy efficiency, and is suitable as a relaying approach since D2D users can establish connections flexibly with self-organization and direct communication. Although D2D is widely applied in many networks to help enhance spectrum efficiency, capacity or coverage, etc., the research on cooperation among multiple D2D users is still in its infancy. In this paper, we have proposed a cooperation scheme for multiple D2D users. In order to ensure high QoS without expending too much energy by the D2D users, we consider both energy availability and the SNR of each cooperative user and introduce the Kuhn-Munkres algorithm to help select relaying D2D users. The Kuhn-Munkres algorithm is widely applied in solving MWM problems, and is good at handling matching problems among multiple users. It may be used in the future to solve the spectrum allocation problem, which has been ignored in this paper.