Menu

#203 Self-loop bug in PageRank

Likely Bug
open
nobody
None
5
2016-08-23
2016-08-23
No

AREA/CLASS/EXAMPLE AFFECTED: edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors
SYNOPSIS: If a vertex has an edge to itself, it affects the results of PageRank, and causes the scores not to sum to 1.
DESCRIPTION: According to Wikipedia, the PageRank algorithm ignores edges from a vertex to itself. However, adding an edge from a vertex to itself changes the results of the Jung PageRank implementation. Furthermore, doing so (can) cause the results not to sum to 1. (Results are supposed to sum to 1, and normally do.) I believe the disconnect occurs in (UniformDegreeWeight).transform(), where graph.outDegree() is used, which includes self-loops in its count.
REPEAT BY: Create a network with no self-loops. Run PageRank on it. Add a loop to one of the vertices (it may or may not matter how many other outgoing edges it already has). Run PageRank on it. Compare the results. I expect them to be different.
STACK TRACE: -
SAMPLE FIX/WORKAROUND: I guess you could remove self-loops from the input graph.

Discussion


Log in to post a comment.