TL;DR
This paper introduces a global propagator for difference constraints ($x - y \leq d$) in Constraint Programming (CP), treating them collectively via shortest-path graph algorithms rather than as isolated constraints. By integrating specialized bounds tracking and explanation generation for Lazy Clause Generation (LCG), the authors drastically accelerate solving times for scheduling and temporal problems, eliminating pathological worst-case propagation loops.
What Problem Does This Paper Address?
Difference constraints are foundational in scheduling, routing, and temporal reasoning. Traditional CP solvers treat each constraint (e.g., $x - y \leq 5$) as an independent entity. While this approach eventually reaches the correct answer, it suffers from terrible performance when constraints interact, leading to slow, incremental "ping-pong" propagation loops that can take cubic ($O(n^3)$) steps even for simple unsatisfiable networks.
SAT Modulo Theories (SMT) solvers handle these constraints globally using graph-based shortest-path algorithms. However, directly porting SMT methods to CP fails because CP solvers update variable bounds far more frequently and require explicit clausal explanations to support modern Lazy Clause Generation (LCG) techniques. This paper bridges that gap by designing a global difference constraint propagator tailored specifically for the high-frequency bounds updates and explanation requirements of CP.
Methods
The authors implement their bounds-consistent global propagator within Huub, a modern CP solver written in Rust. The architecture relies on several key innovations:
- Graph-Based Propagation: It maps difference constraints to a weighted directed graph where finding a negative cycle signifies unsatisfiability, utilizing incremental satisfaction (
IncSat) and implication (IncImp) algorithms. - Dedicated Bounds Handling (
IncLB/IncUB): Instead of using a dummy node $v_0$ for all variable bounds (the standard SMT approach), they process bounds updates collectively using a modified Dijkstra's algorithm. This avoids constant potential function updates and keeps the graph small and efficient. - LCG Explanations: To work within an LCG solver, the propagator must explain why a variable's bound changed or why a conflict occurred. The authors introduce three explanation flavors for bounds-based propagation: Simple, Lifted, and Lazy, allowing the solver to derive powerful nogoods during conflict analysis.
- Root-Level Simplification: At initialization, the solver runs Johnson's algorithm to detect negative cycles early, remove redundant edges, and perform "node unification" (collapsing variables locked into a fixed difference cycle into a single node).
Datasets
The authors evaluated their approach across three extensive benchmarks:
- MiniZinc Challenge Benchmarks: A diverse set of 626 real-world instances filtered to include only those containing difference constraints.
- ProdCons: Complex resource-constrained project scheduling problems featuring producer/consumer constraints (1,080 instances).
- RCPSPmax: Resource-constrained project scheduling problems with minimal and maximal time lags (1,130 instances).
Key Insights and Ideas
- The SMT-CP Mismatch: Naively importing SMT difference logic solvers into CP is highly inefficient. Because CP updates bounds constantly, separating bounds propagation from the core difference graph via specialized
IncLB/IncUBalgorithms is the secret to making global propagation practical. - Less is More with Implications: Counter-intuitively, running the incremental implication algorithm (
IncImp) for early conflict detection hurts performance due to its overhead. It is significantly faster to turn it off and let the solver discover conflicts naturally during search. - Lifting Explanations Matters: "Simple" explanations (which just output the current bounds) are too weak for clause learning. Lifted or Lazy explanations generalize better, creating stronger clauses that prune the search space much faster.
Key Results
- Pathological Loop Elimination: For worst-case scenarios where separate propagators suffer from a cubic explosion in runtime, the global propagator (
gp) reduces solving time to a flat line under 70 milliseconds.
- Scheduling Performance Boost: On the
ProdConsbenchmark, the global propagator with simplification (gp+s) solved 660 instances to optimality compared to only 605 for separate propagators (sp), while average unsatisfiability proof times dropped from 9.99 seconds to 3.86 seconds. - RCPSPmax Efficiency: On the
RCPSPmaxbenchmark,gp+sdetected unsatisfiability so rapidly during initial simplification that the average time dropped to under 0.01 seconds, outperforming even Google's state-of-the-art CP-SAT portfolio solver on unsatisfiable instances.
Limitations and Future Work
- No Cross-Propagator Inference: The global propagator currently operates in isolation; it does not ingest new difference constraints inferred by other scheduling propagators (such as edge-finding rules), which limits its synergy with other global constraints.
- Optional Variables: Handling optional intervals (common in complex scheduling where certain tasks might not execute) is currently managed via half-reification. A tighter, native integration within the graph structure—similar to commercial tools like IBM ILOG CP Optimizer—remains an open area for future development.
Summary updated