## 4 Proposed Trust-Based Optimized Reporting Scheme
### Trust Calculation Mechanism
#### 4.2.3 Indirect Trust  
When a source node (trustor) initiates a communication with the target node (trustee), which is not its immediate neighbor, then the concept of indirect trust is utilized [27]. Node A computes indirect trust for node \(\rm E\) using the following equation:  
\[\rm NT_{i}=\rm T_{e}+T_{u}\pm T_{s}. \tag{6}\]  
Here, \(\rm NT_{i}\) refers to the indirect trust calculated by the combination of energy, unselfishness, and similarity (\(\rm T_{s}\)) trust values, as shown in (6). Similarity (\(\rm T_{s}\)) refers to the measure of variation among the feedback propagated by the recommenders. This parameter helps the trustor to assess whether the opinions about a specific trustee are centralized or dispersed. If the feedback is more centralized, it becomes easier for the trustor to form an opinion (honest/dishonest) about the targeted node, and vice versa. The similarity trust value is computed using assessments of reliability and trustworthiness based on received feedback. The similarity of feedback for any specific node can be calculated using the following equation:  
\[\rm T_{s}=\frac{max(\left|F_{h}\right|,\left|F_{dh}\right|)}{\left|F_{h} \right|+\left|F_{dh}\right|}. \tag{7}\]  
The numerator in (7) determines the higher count between honest feedback (\(\rm F_{h}\)) and dishonest feedback (\(\rm F_{dh}\)). Whereas the denominator represents the combined count of both honest and dishonest feedback, encompassing all received feedback values. If there is a greater number of honest feedback values regarding the target node, \(\rm T_{s}\) is added in (6). Conversely, \(\rm T_{s}\) is subtracted in (6) when the number of dishonest feedback values outweighs the honest feedback. There is a possibility that the source node receives an equal number of honest and dishonest feedback values. In such a case, \(\rm T_{s}\) is assumed to be 0 because the amount of honest and dishonest feedback is equal. Consequently, the indirect node trust relies solely on energy and unselfishness when the similarity factor nullifies itself due to an equal amount of honest and dishonest feedback.  
Algorithm 2 focuses on evaluating the indirect trust of a target node within the network. It begins by checking whether the target node is an immediate neighbor or not. If the node is not an immediate neighbor, it proceeds to compute the indirect trust. If the trust value does not exist for the target node, the algorithm calculates the indirect trust based on the values related to energy, unselfishness, and similarity. This computed value is then updated in the system records. Conversely, if a trust value already exists for the target node, the algorithm recalculates the indirect trust using the same parameters and updates the relevant records accordingly. Additionally, it employs a counter mechanism and a forgetting curve function to adjust the stored indirect trust values, contributing to the ongoing trust assessment process in the network.  
```
input: Trust values of \(\mathrm{T_{e}}\), \(\mathrm{T_{u}}\), \(\mathrm{T_{s}}\) output: Indirect Trust \(\mathrm{N}\mathrm{T_{i}}\) if Target node is an immediate neighbor node then if Trust value does not exist for Target node then \(\mathrm{NT_{i}}=\mathrm{T_{e}}+\mathrm{T_{u}}\pm\mathrm{T_{s}}\) \(\mathrm{NTI[node_{id}]}=\mathrm{NTI[node_{id}]}+\mathrm{NT_{i}}\) \(\mathrm{Counter[node_{id}]}=\mathrm{Counter[node_{id}]}+1\) else \(\mathrm{NT_{i}}=\mathrm{T_{e}}+\mathrm{T_{u}}\pm\mathrm{T_{s}}\) \(\mathrm{NTI[node_{id}]}=\mathrm{NTI[node_{id}]}+\mathrm{NT_{i}}\) \(\mathrm{Counter[node_{id}]}=\mathrm{Counter[node_{id}]}+1\) \(\mathrm{forgettingCurve(NTI,Counter,node_{id})}\) endif endif
```  
**Algorithm 2**Computing Indirect Trust