# A Deep Learning Approach for Maximum Activity Links in D2D Communications
## 4 Problem Formulation  
As mentioned above, multiple D2D communications are allowed within the same cell by sharing spectrum resources with cellular users. Therefore, the inter-layer interference between devices involved in cellular communication through the eNB and devices performing D2D data transfers as well as intra-layer interferences between the different D2D pairs can be experienced and must be correctly managed. When the number of D2D communication links heavily increases, the interference caused by the sharing of the same spectrum resources will affect the reliability of cellular device communications and even reduce the number of potential D2D links. In general, a device requiring spectrum resources for cellular communication has a higher priority than a device competing for establishing a D2D communication channel. Therefore, the resource scheduling problem is related to maximizing the amount of D2D links while ensuring the QoS of the cellular device, which selects a subset of \(A\) with the biggest cardinality under \(SINR_{D}\geq\gamma_{D}\). Based on the above analysis, we started from a conventional link scheduling scheme which guaranteed the communication reliability of the cellular users and maximized the active D2D links. Due to the NP-hard nature of the underlying problem, we used a DNN to optimize the above scheduling algorithm and reduce its running-time. In order to properly formulate the problem, at first, we need to analyze the interference in the cellular system (i.e., within the cell of inters). Here, when the pair of devices involved in direct D2D communication reuses the downlink spectrum, the signal received by a generic cellular device \(C\) consists of the expected signal from the eNB, with the addition of the interference from the D2D layer and the ambient noise. In detail, by using the physical model, the SINR of the generic cellular device \(C\) is defined as follows:  
\[SINR_{C}=\frac{P_{B}g_{C}}{\sum_{(i,j)\in A}x_{ij}P_{i}g_{iC}+\eta} \tag{2}\]  
where \(P_{B}\) is the transmission power of the eNB, \(P_{i}\) is the transmission power of the D2D device \(i\), \(g_{iC}\) denotes the link gain from D2D sender \(i\) to cellular device \(C\), \(g_{C}\) is the gain of the cellular device connected to the eNB, and \(\eta\) is ambient noise. To ensure the performance of the cellular device, \(SINR_{C}\geq\gamma_{C}\) should be satisfied. Analogously, in the D2D layer, the signal perceived at the D2D receiver \(j\) side consists of the one transmitted by \(i\) affected by the interference from both the cellular and D2D layers. As such, the SINR at the D2D device level is:  
\[SINR_{D}=\frac{P_{i}g_{ij}}{\sum_{(k,j)\in A,\ kai}x_{kj}P_{k}g_{kj}+P_{B}g_{ Bj}+\eta} \tag{3}\]  
where \(g_{ij}\) is the channel gain from the D2D sender \(i\) to receiver \(j\) and \(g_{Bj}\) is the channel gain from the eNB to D2D device \(j\). When \(SINR_{D}\geq\gamma_{D}\), the D2D links perform normally. To maximize the total amount of admissible D2D pairs, we need to consider the following maximization link utility problem, subject to interference constraints associated to the performance of D2D devices and the cellular user:  
\[[MaxL]\ L^{*}=max\sum_{(i,j\in A)}x_{ij} \tag{4}\]  
\[\text{s.t.}\ \sum_{j\in V:(i,j)\in A}x_{ij}+\sum_{j\in V:(i,j)\in A}x_{ij}\leq 1,\ i\in V \tag{5}\]  
\[\sum_{j\in V:(i,j)\in A}x_{ij}=y_{i} \tag{6}\]  
\[P_{B}g_{C}\geq\gamma_{C}\left(\sum_{i\in V}P_{i}g_{ic}y_{i}+\eta\right) \tag{7}\]\[P_{i}g_{ij}x_{ij}+M_{ij}\Big{(}1-x_{ij}\Big{)}\geq\gamma_{D}\Bigg{(}\sum_{k\
eq i}P_{ k}g_{kj}y_{k}+P_{B}g_{Bj}+\eta\Bigg{)} \tag{8}\]  
\[x_{ij}\in\{0,1\},\ (i,j)\in A \tag{9}\]  
\[y_{i}\in\{0,1\},\ i\in V \tag{10}\]  
The objective (4) maximizes the number of active D2D links. The binary variables \(x_{ij}\) and \(y_{i}\) are respectively associated to the presence of an active D2D pair from the devices \(i\) to \(j\) and to the capability of D2D sender \(i\) to perform D2D communication.