# Social-Aware Peer Selection for Device-to-Device Communications in Dense Small-Cell Networks
## 4 Formulation of Social-Aware D2D Peer Selection Algorithm and Performance Indicators  
### Social-Aware D2D Peer Selection Algorithm  
The D2D peer selection is based on the social relationship between human users and the physical parameters of DUEs. The users who are friends on social networks and are of the same age group and profession are more likely to have similar choices. Moreover, for D2D communications, users also need to be located in close proximity. Therefore, we consider both social and physical attributes to perform D2D peer selection. For this purpose, we use the modified TOPSIS method to formulate the D2D peer selection problem.  
TOPSIS is a popular MADM algorithm used to solve problems that involve the ranking of a set of alternatives based on multiple attributes of different natures. It efficiently integrates those attributes to decide the best among the available alternative solutions based on their comparison to the best (ideal  
Figure 2: Encounter duration of \(Tx\) and \(Rx\).  
Subsequently, we determine the ideal positive (\(I_{j}^{+}\)) solution, which is the maximum value of an attribute for a UE in the \(\mathbf{M}_{D}\) as given by  
\[I_{j}^{+}\ =\ max\left(A_{W(1,j)},\ A_{W(2,j)},\ldots\ldots\ A_{W(m,j)}\right)\ \ \ \text{for}\ j\ =\ 1,\ldots,q, \tag{10}\]  
Similarly, the ideal negative solution, \(I_{j}^{-}\), which is the minimum value of an attribute for a UE in \(\mathbf{M}_{D}\), is computed as  
\[I_{j}^{-}\ =\ min(A_{W(1,j)},\ A_{W(2,j)},\ldots\ldots\ A_{W(m,j)})\ \text{for}\ j\ =\ 1,\ldots,q, \tag{11}\]  
Each attribute is then compared with the ideal positive and negative solutions by calculating its distance from \(I_{j}^{+}\) and \(I_{j}^{-}\) (i.e., \(DI_{j}^{+}\) and \(DI_{j}^{-}\)) as given by  
\[DI_{j}^{+}\ =\ \sqrt{\sum_{j=1}^{q}\left(A_{w(i,j)}-I_{j}^{+}\right)^{2}}, \tag{12}\]  
\[DI_{j}^{-}\ =\ \sqrt{\sum_{j=1}^{q}\left(A_{w(i,j)}-I_{j}^{-}\right)^{2}}, \tag{13}\]  
The alternative that has a minimum distance from \(I_{j}^{+}\) and maximum distance from \(I_{j}^{-}\) is considered as the most suitable solution. The mechanism of calculating the distance of each alternative solution from the positive and negative solutions is illustrated in Figure 3.  
Subsequently, we use \(DI_{j}^{+}\) and \(DI_{j}^{-}\) from (12) and (13) to compute the closeness coefficient of the UE\({}_{i}\) (i.e., \(\delta_{i}\)) based on the distances from the ideal solutions as given by  
\[\delta_{i}\ =\ \frac{DI_{j}^{-}}{DI_{j}^{-}+\ D_{j}^{+}}. \tag{14}\]  
Equation (14) is uniformly applicable to both social and physical attributes. Therefore, \(\delta_{i}\) from \(\mathbf{M}_{DS}\) is represented by \(\delta_{s}\) and by \(\delta_{p}\) from the \(\mathbf{M}_{DP}\). We add \(\delta_{s}\) and \(\delta_{p}\) to get the cumulative closeness coefficient which is denoted by \(\Delta\). Based on the values of \(\Delta\), we sort the UEs in descending order. The UE with the highest \(\Delta\) value is the best choice for D2D communications.  
Figure 3: Distance of the alternative solutions from the positive and negative ideal solution.