Rajarshi Bhadra
Rajarshi Bhadra

Reputation: 1944

Validating Personalized PageRank Matrix in R

My question is with reference to this paper here

This is an excerpt from the paper

enter image description here enter image description here

From the similarity of the two equations we can see that if ppr_alpha_u is added up it will be equal to pr_alpha

However while trying to execute this in R my results do not seem to comply

I am providing the code below

graph <- graph.formula(A -+ B, A -+ C, A -+ D,
                   B -+ A, B -+ D,
                   C -+ A,
                   D -+ C, D -+ B)

The global page rank is given by

> page_rank(graph,vids=V(graph),directed=T,damping = .8)
$vector
        A         B         C         D 
0.3214286 0.2261905 0.2261905 0.2261905 

$value
[1] 1

$options
NULL

The personalized page ranks are given by

> page_rank(graph,vids=V(graph),directed=T,damping=.8,personalized = c(1,0,0,0))
$vector
        A         B         C         D 
0.4285714 0.1904762 0.1904762 0.1904762 

$value
[1] 1

$options
NULL

> page_rank(graph,vids=V(graph),directed=T,damping=.8,personalized = c(0,1,0,0))
$vector
        A         B         C         D 
0.2693878 0.3578231 0.1578231 0.2149660 

$value
[1] 1

$options
NULL

> page_rank(graph,vids=V(graph),directed=T,damping=.8,personalized = c(0,0,1,0))
$vector
        A         B         C         D 
0.3428571 0.1523810 0.3523810 0.1523810 

$value
[1] 1

$options
NULL

> page_rank(graph,vids=V(graph),directed=T,damping=.8,personalized = c(0,0,0,1))
$vector
        A         B         C         D 
0.2448980 0.2040816 0.2040816 0.3469388 

$value
[1] 1

$options
NULL

We see from the vectors of personalized pagerank that they are not adding upto the global pagerank. Any help in understanding why this is happening will be greatly appreciated.

Upvotes: 1

Views: 799

Answers (1)

Tam&#225;s
Tam&#225;s

Reputation: 48061

The PageRank vectors returned by igraph are normalized such that their sum is equal to 1 (and not to the number of vertices, as given by the paper you cited). Due to this particular normalization, it does not hold any more that the sum of the personalized PageRank vectors is equal to the unpersonalized PageRank vector. But note that if you multiply the unpersonalized PageRank vector given by igraph with the number of vertices in your graph, you will get the sum of personalized PageRank vectors.

Upvotes: 1

Related Questions