Modularity Q = (1/2m) Σᵢⱼ [Aᵢⱼ − kᵢkⱼ/2m] δ(cᵢ,cⱼ) measures the quality of a partition. The Louvain algorithm greedily maximizes Q. Resolution limit: communities smaller than √(2m) may be merged.