0
$\begingroup$

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.

$\endgroup$

1 Answer 1

1
$\begingroup$

You just have to normalize the results, keeping in mind that all Page Rank vectors add up to 1, both the "normal" and the "personalized" Page Ranks.

vpr <- page.rank(g, vids=V(g),
                 directed=T,damping=0.80)$vector

v1 <- page.rank(g, vids=V(g),
                directed=T, damping=.8,
                personalized = c(1,0,0,0))$vector

v2 <- page.rank(g, vids=V(g),
                directed=T, damping=.8,
                personalized = c(0,1,0,0))$vector

v3 <- page.rank(g, vids=V(g),
                directed=T, damping=.8,
                personalized = c(0,0,1,0))$vector

v4 <- page.rank(g, vids=V(g),
                directed=T, damping=.8,
                personalized = c(0,0,0,1))$vector

And the results,

> vpr
        A         B         C         D 
0.3214286 0.2261905 0.2261905 0.2261905 
> (v1 + v2 + v3 + v4) / 4
        A         B         C         D 
0.3214286 0.2261905 0.2261905 0.2261905 
> v1
        A         B         C         D 
0.4285714 0.1904762 0.1904762 0.1904762 
> v2
        A         B         C         D 
0.2693878 0.3578231 0.1578231 0.2149660 
> v3
        A         B         C         D 
0.3428571 0.1523810 0.3523810 0.1523810 
> v4
        A         B         C         D 
0.2448980 0.2040816 0.2040816 0.3469388

Hope it helps.

$\endgroup$
1
  • $\begingroup$ You're more than welcome! $\endgroup$
    – lrnzcig
    Commented Oct 12, 2015 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.