NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Sequence Variables: A Constraint Programming Computational Domain for Routing and Sequencing

Augustin Delecluse, Pierre Schaus, Pascal Van HentenryckarXiv 2025 · DOI

Abstract

Constraint Programming (CP) is a powerful paradigm for solving combinatorial problems with complex constraints. However, traditional CP models for Vehicle Routing Problems (VRP) rely on successor-based representations that struggle with optional visits and the integration of high-performance insertion heuristics. This paper introduces Sequence Variables, a novel computational domain that shifts the focus from "what follows what" to "where can a node be inserted." By formalizing insertion-based logic within a declarative CP framework, the authors achieve state-of-the-art results on challenging benchmarks like the Dial-a-Ride Problem (DARP), outperforming several leading commercial solvers.

Introduction

Vehicle Routing Problems (VRP) are central to logistics but remain computationally daunting. While Constraint Programming (CP) excels at handling the "messy" side-constraints of real-world routing—such as time windows, vehicle capacities, and driver breaks—it has historically faced two major hurdles. First, traditional "successor variable" models, where each node points to its next neighbor, become inefficient when visits are optional. Second, standard CP search strategies often suffer from the "long edge" effect, where building routes greedily leaves expensive final connections to close the loop back to the depot.

To overcome these, high-performance routing algorithms often employ insertion-based heuristics. However, standard CP variables do not natively support "insert-anywhere" logic, making it difficult to leverage these powerful techniques within a declarative framework.

The Sequence Variable Domain

The core contribution of this work is the formalization of Sequence Variables as a first-class domain in CP. Instead of representing a single path, a sequence variable maintains the set of all possible sequences that satisfy a given set of restrictions.

Illustration of path extension via insertion.

As shown in the figure above, the domain allows the solver to consider multiple insertion points for new nodes simultaneously. The authors define the domain using four elementary restrictions: requiring a node, excluding a node, enforcing a subsequence, and forbidding a node from being placed between two others (NotBetween).

Methods and Implementation

To make this approach computationally viable, the authors developed a compact $O(n^2)$ encoding using reversible data structures like adjacency lists and sparse-sets. This allows for constant-time state restoration during backtracking, a critical requirement for CP solvers.

Furthermore, the paper introduces Insert Consistency. While standard CP uses domain consistency, insert consistency ensures that every possible insertion point for a node is feasible according to the global constraints. The authors adapted classic routing constraints—including Distance, TransitionTimes (for time windows), Precedence (pickup before delivery), and Cumulative (capacity)—to work directly with this insertion-based domain.

Evaluation and Results

The proposed SeqVar approach was evaluated on the Cordeau and Laporte (2003) instances for the Dial-a-Ride Problem (DARP), a complex VRP variant involving passenger ride-time limits and time windows. The approach was compared against heavyweights including Google's OR-Tools, IBM's CP Optimizer, and the commercial solver Hexaly.

Key results include:

  • Superior Performance: SeqVar consistently outperformed standard CP models and commercial solvers. On many DARP instances, it achieved a 0.00% primal gap, finding best-known solutions where other solvers lagged with 5-15% gaps.
  • Robustness: Even with a relatively simple Large Neighborhood Search (LNS) strategy, the model achieved solutions within 15% of the absolute state-of-the-art specialized metaheuristics.
  • Efficiency: The $O(n^2)$ implementation proved efficient enough to handle instances with up to 144 nodes and 13 vehicles within a 15-minute time limit.

Conclusion

By modeling where a node can be inserted rather than just what follows it, Sequence Variables allow CP solvers to prune the search space more effectively and integrate powerful insertion heuristics naturally. While the $O(n^2)$ memory overhead may be a factor for extremely large-scale problems, the gains in modeling simplicity and solution quality make it a compelling new tool for complex routing and sequencing challenges. Future work will explore more advanced, sequence-aware search heuristics to further close the gap with specialized algorithms.

Summary updated

BibTeX
@misc{delecluse2025sequence,
  author = {Augustin Delecluse and Pierre Schaus and Pascal Van Hentenryck},
  title = {{Sequence Variables: A Constraint Programming Computational Domain for Routing and Sequencing}},
  year = {2025},
  eprint = {2510.09373},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.09373},
}
Figure