Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Potential problem with Pagerank for SimpleWeightedDiGraphs #42

Open
tmcbarros opened this issue Dec 13, 2018 · 0 comments
Open

Potential problem with Pagerank for SimpleWeightedDiGraphs #42

tmcbarros opened this issue Dec 13, 2018 · 0 comments

Comments

@tmcbarros
Copy link

tmcbarros commented Dec 13, 2018

I think there is a problem with the overloaded pagerank function for SimpleWeightedDiGraphs.

Note that if we define the (unweighted) graph based on A = [0 1 1; 1 0 0; 0 1 0], where g = SimpleDiGraph(A), the call pagerank(g)results in something like [0.3878; 0.3974; 0.2148] (which I believe is correct), while the same call on h = SimpleWeightedDiGraph(A) results in [0.3974; 0.3878; 0.2148] (note that the first and second entries are now swapped).

My guess is that the problem is in the second line of the code, where the summation along rows S = vec(sum(A, dims=1)) should be on M (or A transpose, if you like). For truly weighted graphs (unlike the trivial example above), this leads to fairly wacky results.

On an unrelated note (two, actually), this is my first issue on GitHub, so apologies if I am not following the proper etiquette. More importantly, thank you very much for the fantastic effort made in building this (and all related) package(s).

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

No branches or pull requests

1 participant