Graphx Example 2

pageRank example

Given user data in users.txt and follower data in followers.txt, with the column name is as illustrated, calculate pageRank with tolerence at 0.0001 for each user, sort the output by rank.

users.txt (user id, username, name)

1,BarackObama,Barack Obama 
2,ladygaga,Goddess of Love 
3,jeresig,John Resig 
4,justinbieber,Justin Bieber 
6,matei_zaharia,Matei Zaharia 
7,odersky,Martin Odersky 
8,anonsys

followers.txt: (follower user id, to be followed user id)

2 1 
4 1 
1 2 
6 3 
7 3 
7 6 
6 7 
3 7

Code:

Last updated

Was this helpful?