# Energy Efficiency of D2D Multi-User Cooperation
## 2 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. 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\geq 1,0\leq b\leq 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}\big{(}y_{1}^{1},y_{2}^{1},\cdots y_{x}^{1}\big{)}\) and the rest of \(K-x=b\) D2D users form set \(N_{1}\big{(}n_{1}^{1},n_{2}^{1},\cdots,n_{b}^{1}\big{)}\). If we regard D2D users as nodes and communications between D2D users as lines, set \(Y_{1}\big{(}y_{1}^{1},y_{2}^{1},\cdots y_{x}^{1}\big{)}\) and \(N_{1}\big{(}n_{1}^{1},n_{2}^{1},\cdots,n_{b}^{1}\big{)}\) 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}\big{(}y_{1}^{1},y_{2}^{1},\cdots y_{x}^{1}\big{)}\) and the rest of \((a-1)x\) D2D users form set \(N_{1}\left(n_{1}^{1},n_{2}^{1},\cdots,n_{(a-1)x}^{1}\right)\). 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). 4. \(a>1,0<b<x\), namely, \(K=ax+b\). This cooperation situation combines Situation 3 and Situation 2. 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\):  
\[V=\big{\{}U_{j}|B_{j}\geq I,1\leq j\leq v,x\leq v\leq K\big{\}} \tag{1}\]  
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},\cdots,SNR_{v}\) are SNRs of members of \(V\), and the bit error rates can be calculated with SNRs according to the modulation method.