Size-Bounded Community Search
- Size-Bounded Community Search is the task of extracting a subgraph that includes a designated query node and meets explicit size constraints while optimizing structural cohesiveness.
- It encompasses both query-centric and partition-based formulations, employing models like triangle-connected trusses, connected k-cores, and modularity optimization to enforce size limits.
- The topic tackles NP-hard challenges through branch-and-bound frameworks, exact enumeration, and heuristics, achieving efficient performance even on large and heterogeneous networks.
Size-bounded community search studies community identification under explicit cardinality constraints rather than relying on indirect control of scale. In the query-centric formulations, the task is to return a subgraph that contains a designated query node and satisfies a prescribed size condition while optimizing a cohesiveness criterion; in related partition-based work, the task is to optimize a global objective while requiring every community in a partition to lie within user-specified size bounds. Recent arXiv work formalizes this theme in heterogeneous information networks (HINs), attributed graphs, and modularity-based graph partitioning, and collectively shows that size bounds are not a cosmetic post-processing rule but a primary modeling constraint that changes both the optimization problem and the algorithmic design (Zhang et al., 20 Aug 2025, Wang et al., 2024, Silva et al., 24 May 2026).
1. Scope and formal problem statements
Two query-centric formulations are explicit. In HINs, the size-bounded community search problem takes as input an HIN , a symmetric meta-path , a query node of the target type, and a size bound , and returns a subgraph with and such that induces a triangle-connected -truss of maximum possible . In attributed graphs, the size-bounded extension of CS-AG takes an attributed graph 0, a query node 1, integers 2, 3, 4, and the attribute distance 5, and asks for a connected 6-core 7 containing 8 with 9 that minimizes the 0-centric attribute distance
1
A related but distinct global formulation is the size-constrained maximum-modularity problem, where a partition 2 of an undirected, unweighted graph must satisfy 3 for every community 4 and optimize modularity over the family of feasible partitions (Zhang et al., 20 Aug 2025, Wang et al., 2024, Silva et al., 24 May 2026).
| Setting | Feasibility condition | Optimization target |
|---|---|---|
| HIN community search | 5, 6, triangle-connected 7-truss | Maximum possible 8 |
| Attributed-graph community search | 9, connected 0-core, 1 | Minimize 2 |
| Modularity-based partitioning | Every community satisfies 3 | Maximize 4 |
This terminology matters. The HIN and attributed-graph problems are community search problems because they are anchored at a query node 5. The modularity formulation is a size-constrained community detection problem over an entire partition. A plausible implication is that the literature uses closely related constraint machinery in settings with materially different output semantics: one community around a query versus a full partition of the graph.
2. Cohesiveness models and objective functions
In HINs, the search space is built from a meta-path-derived homogeneous graph. A HIN is a directed graph 6 with a node-type mapping 7 and an edge-type mapping 8. A meta-path 9 of length 0 is a sequence 1, and the work assumes symmetric 2. Collecting all 3-pairs over nodes of a chosen target type yields a homogeneous, undirected graph 4. Cohesiveness is then defined through a refined 5-truss model: a triangle is a triplet 6 such that each pair is a 7-pair in 8; the support of an edge is the number of triangles containing it; a 9-truss is a maximum edge-set 0 in 1 such that every 2 has support at least 3; and triangle connectivity requires that every pair of triangles in 4 be connected through a sequence of adjacent triangles (Zhang et al., 20 Aug 2025).
In attributed graphs, the structural constraint is a connected 5-core and the quality criterion is explicitly query-centric. The extension to size-bounded CS leaves the attribute-distance and confidence-interval machinery unchanged and only inserts size checks into the exact and approximate procedures. The central objective remains minimization of 6, which averages 7 over nodes in the returned community other than the query node. The paper states that the metric considers both textual and numerical attributes and emphasizes correlation with the query node 8 (Wang et al., 2024).
In modularity-based partitioning, the graph is 9 with 0, 1, adjacency matrix 2, degree 3, and resolution parameter 4. The modularity objective is
5
where 6 if 7 and 8 are in the same community and 9 otherwise. With modularity matrix 0, 1, this can be written as
2
To impose size constraints, the heuristic replaces 3 by a penalized objective
4
where 5 and
6
The square-root form is stated to be sub-additive, which encourages coalescence of marginally violating clusters during local moves (Silva et al., 24 May 2026).
3. Computational hardness and exact formulations
For HINs, the decision version of size-bounded community search is NP-complete via reduction from CLIQUE. Given a graph 7, the reduction constructs a two-type HIN in which each original edge 8 maps to a new node 9 plus edges 0 and 1 under the meta-path 2. The proof shows that a clique of size 3 in the original graph corresponds to an 4-clique, and hence an 5-truss of trussness 6, containing a special query node 7 (Zhang et al., 20 Aug 2025).
For attributed graphs, the size-bounded version remains NP-hard because it subsumes the unconstrained CS-AG problem. The paper does not give a new reduction in the size-bounded section; instead, it observes that setting 8 recovers the unconstrained case, so the hardness result carries over directly (Wang et al., 2024).
In modularity optimization, the exact baseline is formulated as a 9–0 integer linear program for the variant with at most 1 communities. Binary variables 2 encode assignment of node 3 to community index 4, and binary variables 5 encode whether nodes 6 and 7 share a community. The objective maximizes
8
subject to assignment constraints 9, sign-sensitive consistency constraints over 00 and 01, and size bounds 02 together with 03 to enforce either emptiness or size at least 04. The implementation uses Gurobi 10.x with default MIP tolerances, allowing a 05 optimality gap on larger graphs and exact solve on 06 (Silva et al., 24 May 2026).
4. Algorithmic strategies
The HIN work develops a branch-and-bound framework, kcBB, that enumerates size-07 node sets containing 08. Direct enumeration over 09 candidates is tightened by lexicographic generation of size-10 subsets, upper bounds on achievable trussness from a partial state 11, dominance-based branching, candidate reductions, and early termination. The node-based and edge-based upper bounds both run in 12 by triangle enumeration. Dominance is defined in edge and triangle forms, and the total search order sorts 13 by nondecreasing distance to 14, tie-broken by nonincreasing node trussness. Candidate reductions remove nodes with trussness at most the current best 15, nodes not 16-triangle-connected to 17, and nodes whose distance enforces too large a minimum truss increase. A heuristic lower bound is obtained from meta-path “stars”: each 18-star is a clique in 19, and seeds containing 20 are either truncated to size 21 or greedily merged and then pruned. Two exact algorithms are built on top of this framework: node-set enumeration (NSG), whose worst-case time complexity is 22, and edge-set enumeration (ESG), whose search tree depth is at most 23 and whose stated worst-case complexity is 24 (Zhang et al., 20 Aug 2025).
For attributed graphs, the exact enumeration algorithm is extended by adding size checks: if a candidate subcore is too large, recursion stops; if it is already too small, recursion also stops because the process only deletes nodes; and the current best is updated only when 25. The three pruning strategies—duplicate-state, unnecessary, and unpromising by lower bound—carry over unchanged. The approximate method modifies the sampling-estimation framework in three places: the Hoeffding-based minimum sample-neighborhood size replaces the term 26 by 27, requiring
28
the greedy enumeration ignores candidates with size 29 and stops the peel-off chain if the size would drop below 30; and early termination is allowed once a feasible 31 is found with bootstrap-computed confidence-interval half-width 32 satisfying
33
The paper characterizes the approximation output by a confidence interval rather than only by a loose approximation ratio (Wang et al., 2024).
For modularity-based partitioning, the principal heuristic is constrained Leiden. It begins with 34, runs standard Leiden, and, if the resulting partition violates any 35 constraint, sets 36 and re-runs Leiden seeded from the previous partition until a feasible partition is found. During local moves and refinement, moving node 37 from community 38 to 39 is evaluated by
40
and the move is accepted if 41. Each Leiden run is 42 on sparse graphs, and the worst-case number of penalty doublings is 43, yielding total cost 44 (Silva et al., 24 May 2026).
5. Empirical behavior across graph settings
The modularity study compares UL (Unconstrained Leiden), CL (Constrained Leiden), and CIP (Constrained IP). On planted-partition benchmarks with 45, average degree 46, two equal-size communities, mixing 47, and size bounds 48, the reported metrics are Adjusted Mutual Information (AMI), achieved standard 49, and community size distributions. UL often achieves higher 50 but violates size bounds and yields low AMI below the detectability limit 51. CL and CIP both satisfy size bounds, and CL’s AMI tracks CIP closely, within 52–53. On a ring of 54 cliques of size 55, UL retrieves the planted partition only for 56, whereas CL retrieves it at 57 with 58. On the Budapest brain connectome with 59, UL yields four trivial clusters, while neuroscience atlases suggest relative community-size ranges 60 or 61; averaging gives 62, 63, and CL at 64 returns 65 clusters closely matching known functional systems. In runtime terms, UL and CL scale to millions of edges in seconds, whereas CIP scales to 66 before memory/time blowup (Silva et al., 24 May 2026).
The HIN study evaluates on Amazon, DBLP, DoubanMovie, Aminer, and Freebase, with schema sizes ranging from 67–68, 69–70, and 71–72 meaningful symmetric meta-paths per dataset. It uses 73 queries per dataset with random 74 and query node 75, and size bound 76. The baselines are SC-BRB and ST-Exa; the proposed methods are SCSHEV77 and SCSHEP78. Quality is measured by 79-pair density, 80, and average PathSim similarity over all node pairs in the community. The reported outcome is that SCSHEV81 yields the highest densities and similarities across all datasets and sizes, often returns a clique when 82 is small on DBLP, Aminer, and Freebase, and is also the fastest; SCSHEP83 is slower but outperforms the baselines. On Freebase, with up to 84 billion 85-edges, NSG with the stated optimizations still solves most queries within minutes (Zhang et al., 20 Aug 2025).
The attributed-graph study reports size-bounded experiments on DBLP and GitHub with 86, 87, and upper bound 88 varying from 89 to 90, averaged over 91 random queries. On DBLP, response time decreases from approximately 92 ms at 93 to approximately 94 ms at 95, while relative error decreases from approximately 96 to approximately 97. On GitHub, response time decreases from approximately 98 ms to approximately 99 ms, and relative error from approximately 00 to approximately 01. In every case, the absolute relative error remains below the user-specified 02 bound, and runtime falls as the maximum size bound grows because the greedy peel needs fewer steps (Wang et al., 2024).
6. Interpretation, implementation, and recurrent misconceptions
A recurrent misconception in modularity-based practice is that tuning the resolution parameter 03 is an adequate surrogate for explicit size control. The size-constrained modularity study rejects that equivalence on several grounds. Changing 04 shifts the average community size—smaller 05 produces fewer larger clusters and larger 06 produces more smaller clusters—but does not force every community size to lie in 07. The paper also states that resolution changes cannot directly reduce the variance 08 once 09 is fixed, whereas the size-constrained approach simultaneously controls the minimum and maximum community size and hence the variation. The ring-of-cliques example is used as a concrete counterexample to the idea that a resolution sweep can reliably enforce individual size bounds (Silva et al., 24 May 2026).
Implementation details reflect the same distinction between explicit constraints and indirect tuning. Constrained Leiden is available in leidenalg v0.10+ for Python and libleidenalg for C++, and passing min_community_size and max_community_size activates the penalty-based move evaluation and progressive 10 schedule; an init_membership argument can be used to speed repeated runs. In the HIN and attributed-graph settings, by contrast, size bounds are embedded directly in the search logic through candidate generation, pruning, or termination conditions rather than through a global penalty on partition quality (Silva et al., 24 May 2026, Zhang et al., 20 Aug 2025, Wang et al., 2024).
Across these lines of work, size-boundedness serves different operational roles. In HINs, the motivation is that “a size constraint is often imposed due to limited resources.” In modularity-based detection, the motivation is that domain experts may have prior expectations about the size of communities. In attributed graphs, the size-bounded extension is treated as a direct modification of CS-AG with unchanged attribute-distance machinery. This suggests that size-bounded community search is best understood not as a single algorithmic recipe but as a family of constrained optimization problems whose common feature is explicit cardinality control, while the structural model—triangle-connected 11-truss, connected 12-core, or modularity-defined partition—determines the relevant objective, hardness, and feasible algorithmic strategy.