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.
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.
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.