Communities by Size: When Networks Assemble Like a Puzzle express

Original: "Heuristic and exact modularity optimization with size-constrained communities"
arXiv:2605.25248 · 2026-05-24 · CC BY 4.0 · 1 min
An algorithm finds groups in a network without letting them be too big or too small.

📄 Showing the "Simple" version — "Advanced" is not ready yet. Add it to favorites to help prioritize it.

A social network is like a city: there are giant neighborhoods and tiny alleys. When an algorithm looks for tight-knit groups, it often picks out a couple of huge clusters and many small fragments. But the client (say, a municipality) needs districts of roughly equal size to distribute clinics or schools evenly.

The usual trick is to turn one "resolution" knob, which makes all communities on average larger or smaller. It's like adjusting the focus on binoculars: the overall picture shifts, but individual groups still come out some too big, some too small. The authors took a different route: they built hard limits into the network assembly algorithm itself — a minimum and a maximum allowed size for each community. Now the program doesn't just look for tight connections; it also ensures that no group exceeds the set boundaries, like a baker shaping buns with a single template.

Tests on synthetic and real networks showed that the new method finds communities almost as well as an exact exhaustive algorithm but runs hundreds of times faster. The old approach with a single parameter often misses the target sizes — especially when the network has natural giants.

The takeaway is simple: if you care about groups in a network being not just cohesive but also proportionate, there's now a tool that does it in one go, without manual tweaking. The code is already integrated into the Leiden package — one of the most widely used tools for graph analysis.

Original abstract

as written by the authors arXiv:2605.25248

When searching for communities in networks, domain experts may have some prior expectations about the size of communities. Yet, community detection methods normally do not optimize communities under cluster size constraints. Multi-resolution techniques allow users to indirectly control the average community size through changing a resolution parameter, but this practice does not control the size of individual communities. We here study the problem of size-constrained community detection, where the size of all communities is limited to a user-specified range of values, in the context of modularity optimization. We propose a heuristic for modularity optimization under community size constraints. To demonstrate the reliability of our proposed heuristic, we also formulate an exact integer optimization model and use its results as a baseline. Our analysis based on synthetic benchmarks and real networks demonstrate the issues with the currently common practice of changing resolution parameters and reveal the advantages of the proposed methods as a principled way of obtaining size-constrained communities. The proposed method is publicly available in the Python Leiden algorithm package.

The word "community" in network analysis doesn't mean a group with shared interests: it's simply a set of nodes with more connections inside than outside, like a cluster of ants on a single sugar cube.

Scientists
Claude Shannon
Concepts
regularisation optimization personalized medicine optimization problem clustering k means clustering metropolis hastings algorithm dimensionality reduction genetic algorithm Large Language Models maximum likelihood regularization methods density profile likelihood Monte Carlo methods collective behavior bayesian hierarchical model survey ai self correction training