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).
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
ModularityVertexPartitionis 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, theRBConfigurationVertexPartition 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
ModularityVertexPartitionto extendRBConfigurationVertexPartitionand simply overload the quality function (so thatqualityreturns modularity, butdiff_moveis still not scaled).