🤖 AI Summary
This work addresses the lack of native support in PyCSP3 for high-level abstractions such as interval variables, sequence variables, and resource functions commonly used in scheduling problems, which often leads to complex and error-prone models. To bridge this gap, the paper introduces, for the first time, a systematic set of scheduling-specific modeling primitives into PyCSP3. These primitives—comprising 53 constraints and 27 expressions—enable the construction of high-level scheduling models that are automatically compiled into standard XCSP3 format, thereby decoupling modeling from solving. The approach provides high-level interfaces encapsulating global constraints like NoOverlap and Cumulative. Evaluation on 261 instances demonstrates that eight model classes preserve their structure after compilation, 72 instances yield identical optimal solutions under dual verification, and selected instances achieve up to a 5.8× speedup, all while maintaining full compatibility with the existing PyCSP3 ecosystem.
📝 Abstract
PyCSP$^3$ provides a productive way to build constraint models for solving combinatorial constrained problems and export them to XCSP$^3$, preserving a complete separation between modeling and solving. However, it lacks native support for scheduling abstractions such as interval variables, sequence variables, and resource functions. As a result, scheduling models must be encoded with low-level integer variables and manual channeling constraints, even though PyCSP$^3$ already provides global constraints like NoOverlap and Cumulative on integer arrays. We present PyCSP$^3$ Scheduling, a library that adds scheduling abstractions to PyCSP$^3$ through 53 dedicated constraints and 27 expressions, and compiles them down to standard PyCSP$^3$/XCSP$^3$ constraints, maintaining the modeling/solving separation that underpins the PyCSP$^3$ ecosystem. On 261 paired instances across 17 model families (5 runs each), both formulations produce identical objectives on all 72 doubly-proved optimal pairs and nearly half of the families (8/17) remain structurally unchanged after compilation; however, runtime performance diverges across families, with clear gains on some (up to 5.8x) and regressions on others due to the overhead of compilation decompositions. Code and benchmarks are available at: https://github.com/sohaibafifi/pycsp3-scheduling