hatvis.community.hypergraph_louvain#

hatvis.community.hypergraph_louvain(H, resolution=1.0, init='clique', random_state=None, max_rounds=20)[source]#

Maximize the strict hypergraph modularity (modularity()) by local moving and merging.

Under the strict definition a hyperedge counts as internal only when all its vertices are in the same community, so single-vertex moves from a singleton start rarely pay off. The heuristic therefore (1) starts from the Louvain partition of the clique expansion (init="clique") or from singletons (init="singletons"), (2) moves single vertices to the neighbouring community with the largest exact modularity gain and (3) greedily merges pairs of communities as long as \(Q\) increases (the aggregation idea of Blondel et al. 2008 and the CNM-type merging considered for hypergraph modularity by Kamiński et al.). Steps 2–3 are repeated until nothing changes.