Abstract
Multisets are a fundamental data structure in Constraint Programming (CP), used to model collections where elements can appear multiple times. Traditional representations using subset bounds often fail to efficiently capture constraints on total size (cardinality) and the number of distinct elements (variety). This paper proposes eight new lexicographical orderings that integrate these properties to provide tighter bounds. Our evaluation on complex combinatorial problems shows that these new "lex bounds" can reduce search space by orders of magnitude and significantly decrease solving times.
Introduction
In many CP applications, such as scheduling or template design, we model collections of items as multisets. A common challenge is that standard "subset bounds"—which define a lower bound of required elements and an upper bound of possible elements—are often too weak. They do not naturally account for the total number of items or the variety of items used, leading solvers to explore many infeasible branches of the search tree.
Proposed Lexicographical Orderings
To address the limitations of subset bounds, we introduce eight total orderings for multisets. These orderings are constructed by prioritizing three key attributes:
- Length (L): Total cardinality of the multiset.
- Variety (V): Number of distinct elements.
- Lexicographical/Colexicographical (L/C): Standard dictionary-style ordering of elements.
By nesting these attributes, we derive representations such as Length-Variety-Lex (LVL) and Variety-Length-Lex (VLL).
These orderings allow for the definition of "lex intervals," which are typically much more compact than subset intervals. For instance, an LVL interval can precisely bound the total size and variety of a multiset, pruning the search space more effectively than traditional methods.
Experimental Evaluation
We evaluated the performance of these new bounds on two benchmark problems: Extended Steiner Systems and the Generalized Social Golfer Problem. These problems were selected because they involve intricate constraints on both the total count and the diversity of elements.
Performance on the Social Golfer Problem
The Generalized Social Golfer Problem requires scheduling players into groups with minimal repeat pairings. Our results indicate that variety-based orderings (VL and VLL) are particularly effective here.
As shown in the table above, the VL and VLL methods achieved massive speedups. In several instances, they found solutions in less than a second, whereas traditional subset-based methods (SB+CR+VR) or simpler length-lex (LL) orderings took significantly longer or timed out.
Performance on Extended Steiner Systems
In tests on Extended Steiner Systems, the LVL representation proved superior. It reduced the number of "fails" (backtracking events) by approximately 95% compared to traditional subset bounds. This demonstrates that when cardinality constraints are dominant, prioritizing length in the ordering is most beneficial.
Key Insights
- The Power of Variety: Incorporating the number of distinct elements into the ordering (as in VLL or LVL) consistently improves expressiveness and compactness.
- Problem-Specific Selection: There is no single "best" ordering. LVL excels when total size is strictly constrained, while VLL or VL is better suited for problems with strict variety requirements.
- Efficiency Trade-offs: Although enforcing bounds consistency for these new representations is computationally more expensive per node, the dramatic reduction in the total number of nodes explored leads to overall faster solving times.
Conclusion and Future Work
Lexicographical bounds offer a powerful alternative to traditional subset bounds for multiset variables in CP. By capturing cardinality and variety, they enable more efficient pruning of the search space. Future research will focus on automatically selecting the optimal ordering for a given problem and integrating these bounds into standard CP solver libraries with a broader range of supported constraints.
Summary updated