Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 3;
- m = [1/2 1/2 0; 1/2 0 0; 0 1/2 1];
- beta = 0.8;
- e = ones(3, 1);
- v0 = e/n;
- while true
- next = beta*m*v0+(1-beta)*e/n;
- if next==v0
- disp(sprintf('PageRank computed in %d steps. \npr(A)=%f\tpr(B)=%f\tpr(C)=%f', i, v0(1), v0(2), v0(3)));
- break
- else
- v0=next;
- end
- end
- %PageRank computed in 87 steps.
- %pr(A)=0.212121 pr(B)=0.151515 pr(C)=0.636364
Add Comment
Please, Sign In to add comment