0

I am trying to implement a pagerank algorithm using the formula: p = the probability vector og getting on a page Pbeginning = matrix(n,1) full with 1/n

S = the matrix with damping factor of the network.

now I have to do iterative till they converge:

for i in range(10): p = S * p

Howerver how do I know when they converge? Some people suggest abs(pn-1 - pn) and keep iterating till this is small, others suggest just iterating 20 times or so.

Alp Uzman
  • 12,209
swaffelay
  • 137
  • 3

1 Answers1

1

$20$ iterations need not work for some graph network.

According to "The PageRank Citation Ranking - Bringing Order to the Web" by Page, Brin, Motwani, Winograd, Section $2.6$, we set a small positive number $\delta$, which is an error tolerance, we terminate when $$\|R_{i+1}-R_i\|_1 \le \delta.$$

We can also see other norms are used as well on Wikipedia page.

Remark: Neither proved convergence has attained, but it is a common practice.

Alp Uzman
  • 12,209
Siong Thye Goh
  • 153,832