Louvain-style modularity optimization. Nodes shuffle into communities that maximize Q = (internal edges) − (expected by degree).