| Algorithm 1 Reputation value calculation algorithm for nodes based on PageRank | ||
| Input: nodes | ||
| Output: PRx | ||
| 1: | for in nodes do //Traverse the nodes in the network | |
| 2: | if nodei.getCredit()<60: //Nodes are malicious nodes | |
| 3: | nodes = nodes − nodei //Eliminate malicious nodes | |
| 4: | continue //Go to the next cycle | |
| 5: | end if | |
| 6: | reputationx = crediti/votei //Trust given by node i to node x | |
| 7: | PRx = PRx + reputationx //Calculate the reputation value obtained by node x from other nodes |
|
| 8: | end for | |
| 9: | return PRx | |