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

Potential problem with Pagerank for SimpleWeightedDiGraphs #42

@tmcbarros

Description

@tmcbarros

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions