Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

which pagerank formula for weighted edges? #1211

Closed
randomgambit opened this issue Jun 19, 2019 · 8 comments
Closed

which pagerank formula for weighted edges? #1211

randomgambit opened this issue Jun 19, 2019 · 8 comments

Comments

@randomgambit
Copy link

Hello @gaborcsardi

Thanks for this wonderful, fundamental R package!
I am using igraph via tidygraph to compute the pagerank of nodes in my network.

Unfortunately, I was not able to get the exact mathematical formula you are using to compute the pagerank when edges are weighted. Could you please let me know what you mean by connection strength in

This function interprets edge weights as connection strengths. In the random surfer model, an
edge with a larger weight is more likely to be selected by the surfer

Thanks!

@vtraag
Copy link
Member

vtraag commented Jun 19, 2019

Assuming the graph is strongly connected (i.e. such that it does not contain any dangling nodes), pagerank is defined as

p_i = alpha sum_j p_j W_ji  + (1 - alpha) e_i

where p_i denotes the pagerank of node i, e is the personalization vector (defaults to 1/n) so that e_i indicates the probability to 'teleport' to node i , alpha denotes the so-called 'damping factor', and W_ji = w_ji/sum_k w_jk, where w_ji is the edge weight from j to i. In other words, W_ji is simply the normalized weight, so that they sum to 1 for all outgoing edges of a node. In the 'random surfer' interpretation, W_ji represents the probability for the 'random surfer' to go to node i from node j, which is simply proportional to the edge weight w_ji.

Does this answer your question? Or do you want to report a specific issue with the pagerank calculations?

@randomgambit
Copy link
Author

yes that is pretty clear, thanks a lot! I was not very aware of this definition by iteration. I mostly have seen the pagerank as the steady state vector of the transition matrix

@vtraag
Copy link
Member

vtraag commented Jun 19, 2019

OK, good! Indeed, the page rank is given by the solution to the recursive equation above.

@vtraag vtraag closed this as completed Jun 19, 2019
@randomgambit
Copy link
Author

@vtraag actually just a clarification. What happens if the graph is not strongly connected? do you drop the dangling nodes?

@vtraag
Copy link
Member

vtraag commented Jun 19, 2019

No, they are not dropped. They are assumed to teleport out to the other nodes. In the current release (0.7.1) it is set to the uniform probability, but it is discussed whether that should be done by teleporting out based on the personalization vector instead. See the discussion in this issue #671.

@randomgambit
Copy link
Author

got it thanks. so the formula above actually works for the general case as well, right? I can see the teleport probability there

@vtraag
Copy link
Member

vtraag commented Jun 19, 2019

Well, no, there are two separate teleportation probabilities: one for dangling nodes and one for the personalization. In #671 it is discussed to make them the same, but currently the teleportation probabilities are always set to uniform probabilities for dangling nodes (effectively adding a link to all other nodes for a dangling node). For more details see #671.

@randomgambit
Copy link
Author

i ll check it out, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants