hatvis.community.modularity#
- hatvis.community.modularity(H, partition, resolution=1.0)[source]#
Strict (all-or-nothing) hypergraph modularity.
\[Q=\frac{1}{W}\sum_{k\ge2}\Big[\sum_{e\in E_k}w_e\,[e\subseteq A_{\sigma}] -\gamma\,W_k\sum_{c}\Big(\frac{\mathrm{vol}(A_c)}{\mathrm{vol}(V)}\Big)^{k}\Big],\]where a hyperedge counts as internal only if all its vertices are in the same community, \(W_k\) is the total weight of the hyperedges of size \(k\), \(W=\sum_k W_k\), \(\mathrm{vol}(A)=\sum_{i\in A}d_i\) and \(\gamma\) is the resolution. This is the strict modularity of Kamiński et al. (2019); the all-or-nothing modularity of Chodrow et al. (2021) has the same structure with size-dependent weights. Singletons are ignored.