# Handover Management for D2D Communication in 5G Networks
## 3 System Model and Problem Formulation
### Problem Formulation  
For the sake of reduced latency, it is preferred to let both devices of each D2D pair connect to the same eNB as much as possible. This issue can be regarded as an optimization problem--maximizing the number of D2D pairs such that both parties connect to the same eNB. This optimization problem can be formulated as follows:  
\[\max\left(\sum_{i=1}^{d}X_{i}\right) \tag{1}\]  
subject to  
\[\exists ij\in\{1,\cdots,n\},\alpha_{k}^{j}=1,\ \forall k\in\left\{DUE_{i}^{1}, DUE_{i}^{2}\right\},\ \forall i\in\{1,\cdots,d\} \tag{2}\]  
\[\alpha_{k}^{j}\cdot RSRP_{k}^{j}\geq\varphi,\ \forall j\in\{1,\cdots,n\}, \forall k\in\left\{DUE_{i}^{1},DUE_{i}^{2}\right\},\ \forall i\in\{1,\cdots,d\} \tag{3}\]  
where D2D UE is denoted as DUE. \(DUE_{i}^{1}\) and \(DUE_{i}^{2}\) are the two UEs of the \(i\)-th D2D pair. \(X_{m}\in\{0,1\}\) is an indicator indicating whether both users of the \(i\)-th D2D pair \(\left\{DUE_{i}^{1},\ DUE_{i}^{2}\right\}\) connected to the same eNB or not. \(X_{i}=1\) means that both \(DUE_{i}^{1},DUE_{i}^{2}\) connect to the same eNB, and \(X_{i}=0\) otherwise. Also, \(\alpha_{k}^{j}\) is a Boolean variable where \(\alpha_{k}^{j}=1\) indicates that there is a control link between user \(k\) and eNB \(j\). The \(RSRP_{k}^{j}\) is the RSRP received at user \(k\) from eNB \(j\). In the optimization problem (1), the objective is to let both devices of each D2D pair connect to the same eNB as much as possible. Constraint (2) specifies that every user connects to exactly one eNB. Constraint (3) guarantees the signal quality for each user in order to maintain the reliability of the control signals. It is obviously that the control cost (or signaling cost, or connection cost) when both users of a D2D pair connect to the same eNB, denoted by \(\hat{C}\), is lower than the control cost when two parties of a D2D pair connect to different eNBs, denoted by \(\hat{C}\). It can be shown that a configuration with more D2D pair connected to the same eNB will result in a lower control cost, as shown in the following theorem. Theorem 1: _A configuration with a lower connection cost would have more D2D pairs connected to the same eNB._  
Proof: Suppose there are two different configurations and one configuration has a connection cost of \(l\) and the other has a connection cost of m. Without loss of generality, let \(l>m\). We prove by contradiction and assume that the configuration with the connection cost \(l\) has more D2D pairs connected to the same eNB. If there are in total \(n\) D2D pairs, there are at most \(n\) pairs of D2D devices to the same eNB, and there are at least zero D2D connection pair to the same eNB. Let \(S=\left\{\left(d_{11}^{S},d_{12}^{S}\right),\left(d_{21}^{S},d_{22}^{S}\right),\cdots,\left(d_{s1}^{S},d_{s2}^{S}\right)\right\}\) denote the set of D2D pairs that each pair of D2D devices is connected to the same eNB, \(T=\left\{\left(d_{11}^{T},d_{12}^{T}\right),\left(d_{21}^{T},d_{22}^{T}\right),\cdots,\left(d_{t1}^{T},d_{t2}^{T}\right)\right\}\) denote the set of D2D pairs that each pair of D2D devices is not connected with the same eNB, and \(N=S\cup T\), \(n=s+t\). Let each pair of D2D devices require a connection cost of \(\hat{C}\), when this pair belongs to set S and would require a connection cost of \(\hat{C}\) when this pair belongs to set T. Plainly, \(\hat{C}>\hat{C}\) since whenever a pair of D2D devices is with the same eNB, there would not require communication overhead between two neighboring eNBs and all communication signals are from the same BS. Then, the total connection cost TC can be calculated as follows:  
\[TC=s\cdot\hat{C}+t\cdot\hat{C}\]  
Since \(n=s+t\) the above equation shows that the lower the total connection cost is, the more the D2D pairs are connected to the same BSs, which leads to a contradiction to the assumption. Therefore, the theorem is proved. The optimization problem in (1) can be approached by exhaustive search as follows. For \(d\) D2D pairs and \(n\) eNBs, each user can connect to one and only one of \(n\) eNB.