# Honesty-Based Social Technique to Enhance Cooperation in Social Internet of Things
## 3 Proposed Model
### Selection Module
#### 3.2.1. Credible Community  
The following metrics are used to calculate the honesty level of the node to become part of a credible community. 1. Interaction frequency  
Let us consider the conversation of nodes in the community involving the exchange of data: \(Cn=\{cn_{1},\ cn_{2},cn_{3},\ \dots\ c_{ni}\}\). The conversation made between trustee and trustor nodes, denoted by \(n_{i}\) and \(n_{j}\), over time t, is given in Equation (13). \[if\ t^{t}\big{(}n_{i},n_{j}\big{)}=\frac{\sum L(Cni)}{TL(Cni)}EL(Cn_{i}) \tag{13}\]  
where \(\sum L(Cni)\) indicates the number of interactions between nodes, and \(TL(Cni)\) indicates the total number of interactions. \(EL(Cn_{i})\) is the entropy function that measures the usefulness of the conversation between the nodes calculated in Equation (14). \[EL(Cn_{i})=-\varphi\log\varphi-(1-\varphi)\log(1-\varphi) \tag{14}\]  
Here, \(\varphi\) is the fraction of communication between the trustor and trustee node. 2. Credibility  
Credible nodes consider each other trustworthy if they have common friends. The more common friends between two nodes, trustor \(i\) and trustee \(j\), the higher the reliability of their communications. This can be calculated in Equation (15):  
\[cr^{t}\big{(}n_{i},n_{j}\big{)}=\frac{min\big{\{}n_{i}n_{j}\big{\}}}{N(n_{i} )}\] \[\Rightarrow cr^{t}\big{(}n_{i},n_{j}\big{)}=\frac{\frac{Conn_{i} \cdot n_{j}}{N(n_{i})}}{N(n_{i})}\] \[\Rightarrow cr^{t}\big{(}n_{i},n_{j}\big{)}=\frac{M\big{(}n_{i},n_{j} \big{)}}{N(n_{i})}\ \left\{\text{M}\ \big{(}n_{i},n_{j}\big{)}e(0,1],N(n_{i}) \
eq 0\right\} \tag{15}\]  
where \(M\big{(}n_{i},n_{j}\big{)}\) are the common friends of \(i\) and \(j\), and \(N(n_{i})\) is the numbers of friends of the trustee. 3. Community Interest  
Each node has interests in the community. A node that takes an interest in the community's activities is likely to forward the relevant data to its connected nodes. It can be calculated in Equation (16):  
\[ci^{t}\big{(}n_{i},n_{j}\big{)}=\frac{Comm_{i}[min\big{\{}n_{i},n_{j} \big{\}}]}{Comm_{i}[N(n_{i})]}\] \[\Rightarrow ci^{t}\big{(}n_{i},n_{j}\big{)}=\frac{Comm_{i}[M\big{(} n_{i},n_{j}\big{)}]}{Comm_{i}[N(n_{i})]}\ \left\{\text{M}\ \big{(}n_{i},n_{j}\big{)}e(0,1],N(n_{i}) \
eq 0\right\} \tag{16}\]  
where \(Comm_{i}\big{[}M(n_{i},n_{j})\big{]}\) is the common community of friends of the trustor and trustee nodes and \(Comm_{i}[N(n_{i})]\) is the common community of the friends of the trustee nodes. The total honesty of node \(n_{i}\) to node \(n_{j}\) is calculated in Equation (17) by taking the sum of three metrics, as shown below:  
\[H\big{(}n_{i},n_{j}\big{)}^{t}=\ \alpha+\gamma+\delta \tag{17}\]  
where \(\alpha+\gamma+\delta=1\) and \(\left\{ \begin{array}{l}\alpha=\beta_{if}*\ if\ t^{t}\big{(}n_{i},n_{j}\big{)}\\ \gamma=\beta_{cr}*\ c^{t}\ \big{(}n_{i},n_{j}\big{)}\\ \delta=\beta_{ci}*c^{t}\ \big{(}n_{i},n_{j}\big{)}\end{array} \right..\)  
connected nodes in the community. Therefore, the cooperative behavior of a node \(n_{i}\) towards node \(n_{j}\) can be figured out as in Equation (19):  
\[cb\big{[}{n_{i}}^{T}\big{]}=\frac{\mathit{min}\big{\{}{n_{i}},{n_{ j}}\big{\}}}{\mathit{max}\big{\{}{N(n_{i})},{N(n_{j})}\big{\}}}\] \[\Rightarrow cb\big{[}{n_{i}}^{T}\big{]}=\frac{{n_{i}}/{n_{j}}}{{N(n _{i})}\vee{N(n_{j})}}\] \[\Rightarrow cb\big{[}{n_{i}}^{T}\big{]}=\frac{{M\big{(}{n_{i}},{n_{ j}}\big{)}}}{{N(n_{i})}\vee{N\big{(}{n_{j}}\big{)}}} \tag{19}\]  
where, \({M\big{(}{n_{i}},{n_{j}}\big{)}}\) is the total number of friends of nodes \(i\) and \(j\) and \({N(n_{i})}\vee{N\big{(}{n_{j}}\big{)}}\) is the total number of common friends of nodes \(i\) and \(j\). Energy level:  
The node energy is very important in the community. A node having high energy means it is alive and is taking an active part in the main events of the community. A node with a higher energy level is more cooperative than a node with a lower energy level. The node's current energy level can be computed in Equation (20).