Skip to content

An algorithm that used for evaluating someone’s reputation in a social network.

Notifications You must be signed in to change notification settings

tg-watchdog/trustrank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrustRank

This is a simple TrustRank algorithm for evaluating someone’s reputation in a social network. The simulated implementation is also attached to the repository.

This algorithm is a potential candidate for improvement for Telegram Watchdog, a tool that helps group chats to prevent spam users.

Algorithm

The TrustRank algorithm is inspired by PageRank, an algorithm to calculate the weights of web pages.

Firstly, we will calculate the “relay trust score” for the votee:

LaTeX for the relay trust score

In this formula:

  • Calculate the vote weight of each voter, which is calculated by dividing the voter’s TrustRank by the number of votes the voter made before (including trust votes and untrust votes).
  • The voter may vote as “trusted” or “untrusted.” The weight will multiply by -1 if the voter votes untrustworthy and vice versa.
  • Sum up the vote results voted by all voters.

Then, the algorithm will map the relayed score to the interval [-1, 1] with the Sigmoid function, according to the mark of the relay result.

Simulating

The test folder has some code to simulate the real-world context, including:

  • A regular user registers a new account (20% chance)
  • An abuser registers five spam accounts (2% chance)
  • An abuser requests five trust votes from other spam accounts for a single spam account (simulate purchase upvote from other spammers, 2% chance)
  • 5 normal users give 5 untrust votes to a spam account (simulate spam account sending spam to a group chat, 50% chance)
  • A regular user trusts another regular user (50% chance)

Other limitations applied in the simulation program:

  • Accounts that have negative TR value will not be able to vote for others
  • One account can only trust vote others 5 times (simulate rate limit in a short period)

Program output:

Total users: 3056
Maxium trustRank: 0.659045770113111
Minium trustRank: -0.6573961384063101
Average trustRank: 0.1740412817879677
====
Normal users: 2121
Maximum TR of normal user: 0.659045770113111
Minimum TR of normal user: 0.1
Average TR of normal user: 0.47638180526734636
====
Abusers: 935
Maximum TR of abuser: 0.52497918747894
Minimum TR of abuser: -0.6573961384063101
Average TR of abuser: -0.5118028361796922
Abusers have positive TR: 150

This output illustrates that although most abusers have negative values, there are chances that they may get high positive TR. This is primarily good news for someone intent on creating some “high-quality trust vote available” spam accounts to sell trust votes.

About

An algorithm that used for evaluating someone’s reputation in a social network.

Resources

Stars

Watchers

Forks