(1). Node Preference

*Pre fij* is the degree of preference between the two nodes, *i* and *j*. The node preference is different from the node encounter frequency, which refers to the time occupation ratio between two nodes establishing a connection and transmitting a message within a period of time. The specific calculation formula is as follows:

$$Pref\_{ij} = \frac{\sum\_{k=1}^{n} t\_{i,j}^{k}}{\sum\_{k=1}^{n} t\_{i,other}^{k}} \tag{13}$$

*tki*,*j* represents the total time taken for message delivery when node *i* and node *j* establish a connection for the kth time. *<sup>t</sup>ki*,*other* represents the total time taken for message delivery when node *i* and other nodes establish a connection for the kth time.

### (2). Node Relationship Stability

*Relij* is the correlation between the average interval time delivery messages of the two nodes, *i* and *j*. Node relationship stability refers to the average interval between messages sent between nodes. Through it we can predict the possibility of future nodes establishing connections for a long period of time. This means that the shorter the connection interval in the most recent period, the more likely it is that the connection will be established in the future. In a period of time, the more the number of encounters, the longer the interval. Which indicates that the node has stable cooperation for a long time, as described below:

$$Rel\_{i\bar{j}} = \frac{T\_{i,\bar{j}}^k - T\_{i,\bar{j}}^1}{k \times T} \tag{14}$$

In the above equation, *k* is the number of message passes in *T* time. *Tki*,*j* and *T*1*i*,*j* are the time of the *k*th transmission of the message and time of the first transmission of the message, respectively, in *T* time.

### (3). Node Activeness

We use the number of times the node forwards the message for a period of time as a measure of node activeness. The higher the node activity, the higher the degree of cooperation is to some extent. We define it as follows:

$$Act\_i = \frac{rc\_i}{\sum\_{i=1}^{n} rc\_i} \tag{15}$$

where *rei* indicates that the number of times the node *i* forwards the message is within a certain period of time, *T*.

### (4). Data Demand

We consider that nodes are more willing to cooperate to deliver data with common needs. At the time of message delivery, the node gives a rating feedback of the message demand. Whether a node meets and connects with other nodes within a certain period of time, the node prefers to receive and forward data useful to itself. Therefore, if the score of node feedback is higher for a period of time, it indicates that the probability that the neighbor node is willing to cooperate to forward the message is larger. Increasing this parameter can help predict the likelihood of future cooperation between nodes.

$$\stackrel{\sum}{Necd\_{ij}} = \frac{\stackrel{k}{\sum}}{\underline{Q} \times k} \tag{16}$$

where *qτij* represents the data demand feedback score given by node *j* when node *i* passes a message to node *j*. *Q* represents the highest score.

Through the degree of node preference, relationship stability, activity, and data demand analysis, we can quantify the cooperation probability values between two nodes as follows:

$$R\_{ij} = aPref\_{ij} + bRel\_{ij} + cAct\_j + dNode\_{ij} \tag{17}$$

Among them, *a*, *b*, *c*, *d* is the coefficient of node preference, relationship stability, activity, and data demand. They respectively represent the weighting factors that influence the value of cooperation and *a* + *b* + *c* + *d* = 1.

### 3.3.2. Residual Energy Ratio

We consider the residual energy of the current moment of the mobile node. When the remaining energy of the mobile node is greater, the node is more willing to cooperate to forward the data.

$$E\_i = \frac{E\_r}{E\_d} \tag{18}$$

where *Er* represents the energy remaining in the device and *Ed* is the energy required for the packet to be transmitted.

### 3.3.3. Cooperation and Energy Decomposition

We consider the cooperation probability matrix. Suppose we have n nodes. The probability of forwarding messages from n nodes to different nodes is different. In other words, the selfishness of nodes for different nodes is different. We use the above method to calculate the cooperation value to form a cooperative forwarding probability matrix. Considering that the cooperation relationship between nodes is related to the ratio of the remaining energy of nodes, we believe that the greater the residual energy ratio of nodes, the more stable the cooperative relationship of nodes. It is significant to analyze the probability of node cooperation through the residual energy ratio of nodes. From the above analysis, we can define this as:

$$
\widetilde{\mathcal{R}} = \boldsymbol{E}^T \circ \mathcal{R} \tag{19}
$$

where *E* is a vector with a residual energy ratio of *n* nodes, and the ◦ symbol is defined as each element corresponding to the *i*-th column element multiplied by the *i*th column of *R*. The new matrix we ge<sup>t</sup> is still represented by *R*, which is *R* = *R*.

Therefore, we let *rik* represent the probability of the message node, *nk*, forwarding sent by node, *ni*. We set *N* ∈ *Rl*×*n* and *Y* ∈ *Rl*×*n* as the feature matrix of potential nodes and cooperation factors, and the column vectors, *Ni* and *Yk*, respectively represent potential feature vectors of the node and cooperation factor. We define the conditional distribution of the observed cooperative probabilities as:

$$p(R|N,\mathcal{Y},\sigma\_{\mathcal{R}}^2) = \prod\_{i=1}^n \prod\_{k=1}^n \mathcal{N}\left[ (r\_{ik}|\mathcal{g}(\sum\_{z \in \kappa(i)} \mathcal{S}\_{iz} N\_z^T \mathcal{X}\_{jk}), \sigma\_{\mathcal{R}}^2) \right]^{1\_{ij}^k} \tag{20}$$

where *IRij* is an exponential function. If node *ni* has the probability of forwarding the message sent by node *nk*, it is equal to 1, otherwise it is equal to 0. We also place zero-mean spherical Gaussian priors [24,25] on the node and cooperation factor feature vectors:

$$p(N, \sigma\_N^2) = \prod\_i^n \mathcal{N}(N\_i | 0, \sigma\_N^2 \mathbf{I}) \\ p(\mathbf{Y}, \sigma\_\mathbf{Y}^2) = \prod\_k^n \mathcal{N}(\mathbf{Y}\_k | 0, \sigma\_\mathbf{Y}^2 \mathbf{I}) \tag{21}$$

Therefore, through the node and cooperation factors features with a simple Bayesian inference [26] in Formulas (20) and (21), we have:

$$\begin{aligned} &p(N,Y|\mathcal{R},\sigma\_{\mathcal{R}}^{2},\sigma\_{\mathcal{N}}^{2},\sigma\_{Y}^{2})\\ &\propto p(R|N,Y,\sigma\_{\mathcal{R}}^{2})p(N|\sigma\_{\mathcal{N}}^{2})p(Y|\sigma\_{Y}^{2})\\ &=\prod\_{i=1}^{n}\prod\_{k=1}^{n}\mathcal{N}\left[(r\_{ik}|g(N\_{i}^{T}Y\_{j}),\sigma\_{\mathcal{R}}^{2})\right]^{\mathrm{I}\_{ik}^{\mathrm{R}}}\times\prod\_{i=1}^{n}\mathcal{N}(N\_{i}|0,\sigma\_{\mathcal{N}}^{2}\mathbf{I})\times\prod\_{k=1}^{n}\mathcal{N}(Y\_{k}|0,\sigma\_{\mathcal{T}}^{2}\mathbf{I})\end{aligned} \tag{22}$$

### *3.4. Hybrid Model Solution*

Through the above processes, to reflect the probability that the historical encounter between nodes will affect the judgment that the node is more likely to meet a certain node, we use the graphical model shown in Figure 2 to model the problem of probability prediction. The model combines the

encounter probability matrix, social relationship matrix, and node cooperative probability matrix into a consistent and compact feature representation. According to Figure 2, and Equations (11) and (22), the logarithm of the posterior distribution of node encounters and cooperation probability matrix are given by:

*Inp*(*<sup>N</sup>*, *<sup>X</sup>*,*<sup>Y</sup>*|*<sup>M</sup>*, *R*, *<sup>σ</sup>*2*M*, *<sup>σ</sup>*2*R*, *<sup>σ</sup>*2*N*, *<sup>σ</sup>*2*X*, *<sup>σ</sup>*2*Y*) = − 1 <sup>2</sup>*σ*2*M n* ∑ *i*=1 *n* ∑ *j*=1 I*Mij* (*m*<sup>∗</sup>*ij* − *g*(*<sup>λ</sup>NTi Xj* + (1 − *λ*) ∑ *z*∈*κ*(*i*) *SizNTz Xj*))<sup>2</sup> − 1 <sup>2</sup>*σ*2*R n* ∑ *i*=1 *n* ∑ *k*=1 I*Rik*(*Rik* − *g*(*NTi Yk*))<sup>2</sup> − 1 <sup>2</sup>*σ*2*N n*∑*i*=1 *NTi Ni* − 12*σ*2*X n*∑*j*=1 *XTj Xj* − 12*σ*2*Y n*∑*<sup>k</sup>*=1*<sup>Y</sup>Tk Yk* − 1 2 *n*∑*i*=1 *n*∑*j*=1 I*Mij Inσ*2*M* + *n*∑*i*=1 *n*∑*k*=1 <sup>I</sup>*RikInσ*2*R* − 12 *nlInσ*2*N* + *nlInσ*2*X* + *nlInσ*2*Y* + *ε* (23)

where *ε* is a constant that does not depend on parameters. The hyperparameters (i.e., observed noise variance and a priori variance) are kept fixed after maximizing the logarithmic values of the three potential features, which is equivalent to the use of quadratic regularization terms to minimize the following sum of squared error objective functions:

$$\begin{aligned} &\mathcal{L}(\mathcal{R}, \mathcal{M}, \mathcal{N}, \mathcal{X}, \mathcal{Y}, \mathcal{S}, \mathcal{T}) \\ &= \frac{1}{2} \sum\_{i=1}^{n} \sum\_{j=1}^{n} \mathbf{I}\_{ij}^{\mathcal{M}} \left( m\_{ij} - \operatorname{g} (\lambda \mathbf{N}\_i^T \mathbf{X}\_j + (1 - \lambda) \sum\_{z \in \kappa(i)} \mathbf{S}\_{iz} \mathbf{N}\_z^T \mathbf{X}\_j) \right)^2 \\ &+ \frac{\lambda\_R}{2} \sum\_{i=1}^{n} \sum\_{k=1}^{n} \mathbf{I}\_{ik}^{\mathcal{R}} \left( r\_{ik} - \operatorname{g} (\mathbf{N}\_i^T \mathbf{Y}\_k) \right)^2 + \frac{\lambda\_N}{2} \|\lambda\|^2\_F + \frac{\lambda\_X}{2} \|\lambda\|^2\_F + \frac{\lambda\_Y}{2} \|\lambda\|^2\_F \end{aligned} \tag{24}$$

About formula (24), *λR* = *<sup>σ</sup>*2*M*/*σ*2*R*, *λN* = *<sup>σ</sup>*2*M*/*σ*2*N*, *λX* = *<sup>σ</sup>*2*M*/*σ*2*X*, *λY* = *<sup>σ</sup>*2*M*/*σ*2*Y*, || · ||2*F* is the F norm. The local minimum of the objective function given by Equation (24) can be found by performing gradient descent in *Ni*, *Xj*, and *Yk*.

*∂L ∂Ni* = *α n* ∑ *j*=1 *IMij g*(*α<sup>N</sup>Ti Xj* + (1 − *α*) ∑ *z*∈*κ*(*i*) *SizNTz Xj*)*Xj* ×(*g*(*α<sup>N</sup>Ti Xj* + (1 − *α*) ∑ *z*∈*κ*(*i*) *SizNTz Xj*) − *mij*) +(1 − *α*) ∑ *h*∈*ϕ*(*i*) *n* ∑ *j*=1 *IMhj g*(*α<sup>N</sup>Th Xj* + (1 − *α*) ∑ *z*∈*κ*(*h*) *ShzNTz Xj*) ×(*g*(*α<sup>N</sup>Th Xj* + (1 − *α*) ∑ *z*∈*κ*(*h*) *ShzNTz Xj*) − *mhz*)*ShiXj* +*λR n* ∑ *k*=1 *IRikg*(*NTi Yk*)(*g*(*NTi Yk*) − *rik*)*Yk* + *λN Ni ∂L ∂Xj* = *n* ∑ *i*=1 I*Mij g*(*<sup>λ</sup>NTi Xj* + (1 − *λ*) ∑ *z*∈*κ*(*i*) *SizNTz Xj*) ×*g*(*<sup>λ</sup>NTi Xj* + (1 − *λ*) ∑*z*∈*κ*(*i*) *SizNTz Xj*) − *m*∗*ij* × *λNi* + (1 − *λ*) ∑*z*∈*κ*(*i*) *SizNTz* + *<sup>λ</sup>XXj ∂L ∂Yk* = *λR n* ∑ *i*=1 I*Rikg*(*NTi Yk*)(*g*(*NTi Yk*) − *rik*)*Ni* + *λYYk* (25)

where *ϕ*(*i*) is the set of trust nodes for node *n*, and *g*(*x*) is the derivative of the logarithmic function, *g*(*x*) = exp(−*<sup>x</sup>*)/(<sup>1</sup> + exp(−*<sup>x</sup>*))2.

**Figure 2.** Probability prediction model.
