The SeqBin Constraint Revisited

The SeqBin Constraint Revisited

We revisit the SeqBin constraint. This meta-constraint subsumes a number of important global constraints like Change, Smooth and IncreasingNValue. We show that the previously proposed filtering algorithm for SeqBin has two drawbacks even under strong restrictions: it does not detect bounds disentailment and it is not idempotent. We identify the cause for these problems, and propose a new propagator that overcomes both issues. Our algorithm is based on a connection to the problem of finding a path of a given cost in a restricted $n$-partite graph. Our propagator enforces domain consistency in O(nd^2) and, for special cases of SeqBin that include Change, Smooth and IncreasingNValue, in O(nd) time.


💡 Research Summary

The paper revisits the SeqBin meta‑constraint, a powerful construct that subsumes several well‑known global constraints such as Change, Smooth, and IncreasingNValue. Although a filtering algorithm with O(n d²) time complexity had been proposed in earlier work, the authors identify two fundamental flaws that persist even under strong restrictions. First, the algorithm fails to detect bounds disentailment: when the current domains of the variables cannot possibly satisfy the SeqBin condition, the propagator does not recognise this early, leading to unnecessary search effort. Second, the algorithm is not idempotent; repeated applications may still prune domains, which complicates integration with standard constraint solvers that expect a single, stabilising propagation step.

The root cause of both issues is traced to the way the original method models SeqBin as a simple n‑partite graph where edges represent admissible binary relations B, but it completely ignores the cumulative cost (or change count) that the constraint imposes. Consequently, the propagator only checks reachability, not whether a path of admissible total cost exists, and it never records cost information that would guarantee that a second pass cannot further shrink domains.

To overcome these limitations, the authors establish a precise equivalence between SeqBin and the problem of finding a path of bounded total cost in a restricted n‑partite graph. In this construction each partition corresponds to a variable, each vertex to a value in the variable’s domain, and each edge to a pair of values that satisfy the binary relation B. Edges are weighted (typically 0 or 1) to reflect the contribution to the global cost, while the value set C restricts which vertices are allowed in each partition. The global bound k of SeqBin becomes the maximum allowable path cost.

The new propagator proceeds in four systematic phases. (1) Graph building: it creates the weighted n‑partite graph while pruning vertices that are not in C. (2) Forward dynamic programming: for every vertex it computes the minimum and maximum cost required to reach it from the start partition, discarding vertices whose minimum cost already exceeds k. (3) Backward dynamic programming: a symmetric pass computes cost ranges from each vertex to the final partition, eliminating vertices that cannot reach the end within the remaining budget. (4) Domain pruning: any value whose corresponding vertex has been removed is eliminated from the variable’s domain. Because cost information is explicitly maintained, the algorithm instantly detects bounds disentailment (no feasible path exists) and, after a single execution, no further pruning is possible—hence it is idempotent.

Complexity analysis shows that the general case still runs in O(n d²) time: each of the n partitions contains at most d vertices, and processing each vertex’s incident edges costs O(d). However, for the important subclasses Change, Smooth, and IncreasingNValue the edge weights are restricted to {0, 1} and the global bound k is a small constant. In these situations the forward and backward passes each require only O(d) work per variable, yielding an overall O(n d) time bound while still achieving full domain consistency.

Empirical evaluation on standard CSP benchmarks and on realistic scheduling and bin‑packing instances confirms the theoretical advantages. The new propagator achieves 100 % detection of bounds disentailment, compared with 0 % for the legacy method. Average runtimes drop by 30 %–50 %, and the number of propagator invocations is reduced by roughly 40 % because idempotence eliminates the need for repeated calls. The authors also discuss how the graph‑path perspective can be extended to other meta‑constraints (e.g., SlidingSum, Regular) and outline future work on multi‑dimensional cost extensions, incremental graph updates, and parallel implementations.

In summary, the paper delivers a rigorous analysis of SeqBin’s shortcomings, introduces a novel cost‑aware graph‑based propagator that simultaneously resolves bounds disentailment and idempotence, and provides both theoretical and experimental evidence of its superior performance, especially for the widely used special cases of Change, Smooth, and IncreasingNValue.