v2.6.0
New Features
Boolean cardinality constraints
Three new n-ary constraint types for boolean variable formulations, with corresponding CSP.Builder helpers:
atLeastNConstraint(vars, n)— at least n variables aretrue; satisfied on partial assignments as long as n true values are still reachableatMostNConstraint(vars, n)— at most n variables aretrueexactlyOneConstraint(vars)— exactly one variable istrue; enforces both the upper and lower bound on full assignments
Local search optimization
LocalSolver now has a default getLocalSolution(csp, factory, objective) overload. MinConflictsSolver overrides it with:
- Best-feasible solution tracking across all steps
- Lexicographic value selection: violations minimised first, objective as tie-breaker (no fragile scaling constant)
- Constraint weights updated only during the infeasible repair phase, preventing bias when perturbing feasible assignments
Pluggable variable selectors
ConflictedVariableSelector and RandomVariableSelector are now standalone UnassignedVariableSelector implementations injectable into MinConflictsSolver via builder. The default uses conflicted selection during repair and random selection when feasible.
BranchAndBoundSolver strategies
BranchAndBoundSolver now accepts pluggable UnassignedVariableSelector, DomainValuesOrderer, and Inference strategies, mirroring BacktrackingSearch. MAC propagation after each assignment is particularly effective for boolean variable formulations.