louvain#

louvain(graph, resolution=1.0, weight_prop=None, tol=None)#

Louvain algorithm for community detection

Parameters:
  • graph (GraphView) – the graph view

  • resolution (float) – the resolution parameter for modularity. Defaults to 1.0.

  • weight_prop (str | None) – the edge property to use for weights (has to be float)

  • tol (None | float) – the floating point tolerance for deciding if improvements are significant (default: 1e-8)

Returns:

Mapping of nodes to their community assignment

Return type:

NodeStateUsize