# IBP Based Caching Strategy in D2D
## 3 Method  
In this section, we propose an IBP based socially-aware caching strategy for D2D communication network. Physical closeness is used for constructing a reliable D2D communication network. Then the devices are divided into several social communities and ranked by node importance according to their interactions. Within a social community, IBP is used for modeling the influence of other users on user's selection of content. Caching decision is made by BS according to the contribution of caching the content to other devices within same community. To provide high quality D2D communication links, a reliable D2D communication network is constructed according to physical closeness between devices. Physical closeness \(w_{ij}\) defined by [PERSON] et al. [10] is the probability of establishing a stable D2D communication link between device \(i\) and device \(j\) in future, and it ranges from 0 to 1. BS is responsible for collecting devices encounter history and calculating physical closeness \(w_{ij}\). In our scheme, we consider the D2D communication network as an undirected graph G(V,E), V is the set of devices, E is the set of edges. The weight of edge between device \(i\) and device \(j\) is physical closeness \(w_{ij}\). Then the reliable D2D communication network, G'(V,E) is constructed according to physical closeness. Within the reliable network, the weight of any edge is larger than a threshold \(w_{th}\). In other word, the devices can establish high quality D2D links between them with high probability in future. In our model, we take social relationships between devices into consideration, i.e., the interactions between devices in history. We construct an interaction matrix \(A_{ij}\) to represent the interactions of devices, \(a_{ij}=1\), if there was an interaction between device \(i\) and \(j\) in history; otherwise, \(a_{ij}=0\). Given the interaction matrix, the communities can be determined by the method proposed by [PERSON] et al. [28], the importance of node \(k\) to community can be calculated according to Equation (1) [29]. \[P_{k}=(\sum_{i=1}^{c}\frac{v_{ik}^{2}}{v_{i}^{T}v_{i}})/c \tag{1}\]  
where \(c\) is the number of communities, \(v_{i}\) is an eigenvector of interaction matrix \(A\), and \(v_{ik}\) is the k-th element of \(v_{i}\). \(P_{k}\) ranges from 0 to 1. Within each community, the device with highest node importance degree will be label as \(u_{1}\) (i.e., the first user) in its community. The authors in [10] have proved that IBP can model the influence of other users on user's selection of content. For an IBP with \(K\) dishes and \(N\), the customers are labeled in ascending order, \(c_{1},c_{2},....,c_{N}\). The number of dishes selected by a customer follows Poisson distribution with parameter \(\alpha\). The selection on dishes of customer \(c_{j}\) is influenced and only influenced by its prior customers, \(c_{1},c_{2},...,c_{j-1}\), where \(j=2,3,...,N\). The probability of customer \(c_{1}\) selecting each dish is \(\alpha/K\). The probability of customer \(c_{j}\) selecting dish \(k\), \(p(z_{j,k}=1\mid\mathbf{z}_{j,k})\), is given by the following:  
\[p(z_{j,k}=1\mid\mathbf{z}_{j,k})= \begin{cases}\mathbf{z}_{j,k}^{j-1}/j,& \mathbf{z}_{j,k}\
eq\mathbf{0}\\ \mathbf{z}/(j\cdot k_{0}^{T}),&\mathbf{z}_{j,k}=\mathbf{0}\end{cases}  \tag{2}\]where \(\mathbf{Z}\) is a \(N\times k\) matrix to describe which customers select which dishes, if the customer \(c_{n}\) has selected dish \(k\), \(z_{nk}=1\); otherwise,\(z_{nk}=0\). \(\mathbf{z}_{j,k}\) is the set of precious customers that have selected dish \(k\). For each customer \(c_{m}\) belonging to \(\mathbf{z}_{j,k}\), we have \(z_{mk}=1\), and \(1\leqslant m<j\). \(m_{k}^{j-1}\) is the number of precious customers who have selected dish \(k\). \(K_{0}^{j}\) is the number of dishes which are not tasted by precious customers.