SLIDE: A Useful Special Case of the CARDPATH Constraint

Christian Bessiere, Emmanuel Hebrard, Brahim Hnich, Zeynep Kiziltan, Toby Walsh

TL;DR

This paper introduces SLIDE, a streamlined version of the CARDPATH constraint that acts as a "Swiss Army knife" for sequence-based problems. By requiring a constraint to hold at every step of a sequence, the authors show how to efficiently encode complex global constraints (like REGULAR and LEX) while achieving high-level consistency (GAC) that standard methods often miss.

What Problem Does This Paper Address?

In many real-world scheduling and sequencing problems—like car manufacturing or nurse rostering—we deal with rules that "slide" across a timeline. For example, "a nurse cannot work more than three consecutive night shifts" or "at most 1 out of every 3 cars can have a sunroof."

The CARDPATH constraint was originally designed to handle these by ensuring a rule holds $N$ times across a sequence. However, CARDPATH is computationally heavy, and existing propagators (the algorithms that prune impossible values) often fail to find all possible deductions, leading to slower search times. The authors identify a special case, SLIDE, where the rule must hold at every position, and investigate whether this simpler building block can actually do the heavy lifting for more complex constraints.

Methods

The authors define SLIDE as a constraint $C$ that must hold for every window of size $k$ in a sequence of $n$ variables.

Key Innovations:

  1. Encoding Power: They demonstrate that SLIDE can encode a vast library of other constraints, including AMONGSEQ, REGULAR, and even its own parent, CARDPATH, by introducing auxiliary "counter" or "state" variables.
  2. The Intersection Encoding: To achieve Generalized Arc Consistency (GAC)—the gold standard for pruning in constraint programming—they propose a novel "intersection encoding." This method creates new variables that represent the overlap between sliding windows. By linking these variables in a tree-like structure, they ensure that local deductions propagate globally across the entire sequence.
The intersection encoding creates variables representing the overlap between windows to ensure global consistency.

Datasets

The authors evaluated their approach on three classic constraint satisfaction benchmarks:

  • Nurse Scheduling Problem (NSP): 298 instances involving 25, 30, and 60 nurses over a 28-day period, with rules about break times and shift patterns.
  • Balanced Incomplete Block Designs (BIBDs): A standard combinatorial problem used to test the efficiency of symmetry-breaking constraints like LEX.
  • Car Sequencing: 80 instances from the well-known CSPLib library, testing how the model scales with large domains and complex sliding rules.

Key Insights and Ideas

  • Simplicity is Power: By focusing on the "always holds" case (SLIDE), the authors found a way to provide a "general-purpose" propagator. Instead of writing a custom algorithm for every new sequence constraint, a developer can just encode it into SLIDE.
  • Decomposition vs. GAC: Usually, breaking a big constraint into smaller ones (decomposition) loses "pruning power." The authors prove that for monotone constraints (like "at most $X$"), simple decomposition is actually enough to reach GAC. For others, the intersection encoding fills the gap.
  • Functional States: When encoding the REGULAR constraint (which uses a finite automaton), SLIDE provides explicit access to the "states" of the automaton. This allows users to easily add optimization goals, like "minimize the number of times a specific state is reached."

Key Results

The empirical results show that SLIDE isn't just a theoretical curiosity; it's highly performant.

  • Nurse Scheduling: In hard instances (30 and 60 nurses), the SLIDE-based models solved significantly more instances than standard decompositions or specialized amongseq propagators. For example, with 60 nurses and random ordering, SLIDE solved 27-34 instances, while standard methods solved only 2 or 3.
  • Search Efficiency: As seen in the tables below, the SLIDE models (especially slide_c, which combines multiple rules into one SLIDE constraint) required far fewer backtracks ("bts") to find a solution, indicating much stronger pruning.
Table 1: Performance on Nurse Scheduling with lexicographical ordering.
Table 2: Performance on Nurse Scheduling with random ordering, highlighting SLIDE's superior pruning.

Limitations and Future Work

  • Memory Footprint: The intersection encoding can be memory-intensive. In car sequencing tests, SLIDE used about 22MB of space compared to 5MB for specialized commercial propagators.
  • Scaling with Arity: The complexity of the intersection encoding is $O(nd^k)$, where $k$ is the window size. If $k$ is very large, this approach becomes impractical.
  • Future Directions: The authors suggest using Binary Decision Diagrams (BDDs) to store the allowed combinations of values more compactly, which could solve the memory overhead issue for constraints with many satisfying assignments.

Summary updated

BibTeX
@inproceedings{bessiere2008slide,
  author = {Christian Bessiere and Emmanuel Hebrard and Brahim Hnich and Zeynep Kiziltan and Toby Walsh},
  title = {{SLIDE: A Useful Special Case of the CARDPATH Constraint}},
  booktitle = {ECAI},
  year = {2008},
  doi = {10.3233/978-1-58603-891-5-475},
}
Figure