# Honesty-Based Social Technique to Enhance Cooperation in Social Internet of Things
## 3 Proposed Model
### Decision Module  
In this module of our proposed scheme, the selfishness and honesty of the node's performance are evaluated. Here, in our approach, the detection and punishment of selfish nodes are different from some of the current approaches [31; 34; 38]. The SMH in the community monitors the nodes' behavior. It has direct communication with all the nodes in the community. The monitoring head monitors the value in the assessment table, and if it finds selfish behavior of the nodes in the community, it reports the SCH to act based on the node's behavior. The SCH node is responsible for taking appropriate action against selfish nodes in the community. In our approach, the nodes with selfish behavior will be isolated to a separate domain, rather than expelling them permanently from the community. Theseselfish nodes will be given a chance to rejoin the community once their reputation scores reach a threshold value calculated in Equation (11) because the nodes can regain some energy and make memory free to start forwarding messages again. However, such nodes may be expelled from the network with repeated selfish behavior, as a severe punishment, and this message will be forwarded to all the nodes in the network. The decision module is subdivided into (i) performance evaluation of nodes, (ii) node score in the community, and (iii) node score according to its neighbor. Algorithm 3 shows the functions of two heads. ``` Require: Number of all credible nodes in \(\text{Cr}_{\text{(Com)}}\) Ensure: Selection of Different Heads in \(\text{Cr}_{\text{(Com)}}\) and its Responsibilities
1. Begin
2. For i = 1: n do
3. Select Heads \(\text{int}_{\text{Cr}(com)}\) such as SCH, SMH
4. Compute the weight of each node \(\text{int}_{\text{Cr}(com)}\) for head Selection
5. Weight \(=\left[\text{EV}_{k}(n_{i})^{T}\right]+\text{cb}\left[n_{i}^{T}\right]+\text{cb} \left[n_{i}^{T}\right]\)
6. \(s\left[\text{EV}_{k}(n_{i})^{T}\right]=t_{cur}-t_{reg}\)
7. \(\text{cb}\left[n_{i}^{T}\right]=\frac{M\left(n,\mu_{i}\right)}{N\left(n_{i} \right)\text{ V}\left(n_{i}\right)}\)
8. \(\Delta E(n_{i})=\left(n_{i}\right)/\Delta E\left(n_{i}\right)\)
9. Higher weight in \(\text{\text{\text{\text{\text{\text{\text



\(NSn_{x_{i+1}}\) shows the node score value of the encountered node \(n_{x_{i+1}}\) in the overall network, whereas \(Sn_{x_{i+1}}\) shows the performance value of node \(n_{x_{2}}\) computed by node \(n_{x_{1}}\), \(max(CPAn_{x_{i}})\) shows the maximum and \(min(CPAn_{x_{i}})\) the minimum probable values recorded in the node assessment table of node \(n_{x_{i}}\). Equation (23) shows how a node in a community performs relative to other nodes in a community. This value is propagated in the community starting from its neighbor node. ```
Input: Available nodes in the community and its Assessment table Output: node's behavior
1. \(\rho\gets any\ number\)
2. For each node j among the neighbor's node of interacting node \(n_{xi}\)
3. Compute \(Sn_{x_{i}}=(f\
abla n_{x_{i}}+g\
abla n_{x_{i}})-d\
abla n_{x_{i}}\)
4. Compute \(NSn_{x_{i+1}}=\frac{Sn_{x_{i+1}}-min\left(CPAn_{x_{i}}\right)}{max\left(CPAn _{x_{i}}\right)-min\left(CPAn_{x_{i}}\right)}\)
5. Compute \(NJd_{k}(n_{x})\) of node \(n_{xi}\) neighbor judgement
6. Compute \(RSn_{x_{i}}=\left(\frac{NSn_{x_{i+1}}+NJd_{k}(n_{x_{i}})}{2}\right)\)
7. If \(RSn_{xi}>\rho\)
8. Behaviour = \"CPR\"
9. Else if \(RSn_{xi}\Leftarrow\rho\)
10. Report to SCH
11. Behavior = \"SELF\"
12. Update \(CPAn_{x_{i}}\)
13. End if
14. Each node SCH \(\in\ \tau_{Cr(com)}\)
15. If (Behavior = \"selfish\" reported by SMH)
16. then
17. Isolate node in a separate domain
18. Else if (Behavior = \"selfish\" repeated)
19. Expel the node from the community
20. Broadcast this message in the community
21. Update \(CPAn_{x_{i}}\)
22. End if
23. End for
```

**Algorithm 3**Heads functions. Algorithm 4 shows a node's performance in the community. #### 3.3.2 Node Score According to Its Neighbors

The neighbor assessment is very important in a community with few contacts to be made among the nodes.