Skip to content

Disconnected communities with ModularityVertexPartition on very large graphs #175

Description

@wolfram77

With the webbase-2001 graph, a graph with 118M vertices and and 1.02B directed edges, leidenalg is currently returning 30 disconnected communities (with seed 0).

Vincent notes that this problem is likely due to numerical precision. That is, the ModularityVertexPartition is using scaled improvements to modularity (i.e. 1/m, for consistency with the quality function), which for very large graphs may amount to not seeing any difference (i.e. the improvement of separating two disconnected parts may be positive, but due to the enormous weight, this may effectively be (near) 0). Instead, the RBConfigurationVertexPartition uses unscaled improvements to modularity (i.e. they do not scale with the total weight).

We do not observe any disconnected communities with both RBConfigurationVertexPartition (with libleidenalg) and igraph.

A possible fix may be to switch to double for all computation. Another solution might be for ModularityVertexPartition to extend RBConfigurationVertexPartition and simply overload the quality function (so that quality returns modularity, but diff_move is still not scaled).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions