Sequence Variables: A Constraint Programming Computational Domain for Routing and Sequencing
Organizations: KU Leuven · UCLouvain · GATECH
Abstract
Constraint Programming (CP) offers an intuitive, declarative framework for modeling Vehicle Routing Problems (VRP). While classical successor-based CP models can be adapted to handle optional visits or insertion-based heuristics, sequence variables provide a significantly more natural and elegant formulation for these requirements. Building upon our prior work that introduced the initial concept, the main contribution of this article is the complete semantic and operational formalization of sequence variables as a computational domain. Specifically, we formally define the sequence domain and its update operations, and detail the implementation and data structures required to integrate sequence variables into trail-based CP solvers. Furthermore, we introduce consistency levels for associated constraints on this domain alongside specialized global constraints tailored for routing problems. Finally, we demonstrate that sequence variables simplify problem modeling while achieving competitive computational performance on Pickup and Delivery Problems with and without Time Windows, the Dial-a-Ride Problem, and a Prize-Collecting Scheduling Problem.
Figures & tables
| Type of variable | |||
| Feature | Successor | Head-tail sequence | Insertion-based sequence |
| Nearest neighbor heuristics | ✓ | ✓ | ✓ |
| Insertion-based heuristics | ✓ | ||
| Optional visits | ✓ | ✓ | |
| Memory complexity on VRP with nodes and vehicles | |||
| \mathcal{D}^{\text{\raisebox{0.27126pt}{\scalebox{1.0}{\textcircled{\scriptsize s}}}}}(\lx@scalerel@obj{\overrightarrow{s}}) | ||||
| ✓ | ✓ | |||
| ✓ | ✓ | ✓ | ||
| ✓ | ✓ | ✓ | ||
| ✓ | ||||
| ✓ | ✓ |
| Operation | Description | Complexity |
|---|---|---|
| Returns true if there are no remaining insertions | ||
| Returns true if v_{i}\in\lx@scalerel@obj{\overrightarrow{s}}{} | ||
| Returns true if the node is required | ||
| Returns true if the node is excluded | ||
| Returns true if the node is possible | ||
| Returns true if the node is insertable |
| Operation | Update | Precondition | Complexity |
|---|---|---|---|
| v_{i},v_{k}\in\lx@scalerel@obj{\overrightarrow{s}}{} | |||
| v_{i}\in\lx@scalerel@obj{\overrightarrow{s}}{} | |||
| Boolean variable | Sequence variable | |
|---|---|---|
| |\mathcal{D}(\mathcal{R}_{i}{(\lx@scalerel@obj{\overrightarrow{S}})})|=1 | \neg\lx@scalerel@obj{\overrightarrow{S}}.\mathrm{isPossible}(v_{i}) | |
| \textit{false}\in\mathcal{D}(\mathcal{R}_{i}{(\lx@scalerel@obj{\overrightarrow{S}})}) | \neg\lx@scalerel@obj{\overrightarrow{S}}.\mathrm{isRequired}(v_{i}) | |
| \textit{true}\in\mathcal{D}(\mathcal{R}_{i}{(\lx@scalerel@obj{\overrightarrow{S}})}) | \neg\lx@scalerel@obj{\overrightarrow{S}}.\mathrm{isExcluded}(v_{i}) |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Succ | Succ-LNS | CPO | RF (2021) | OR-Tools Routing | Hexaly | Seqvar | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Name | bks | Mean SD | Best | Mean SD | Best | Mean SD | Best | Mean SD | Best | Mean SD | Best | Mean SD | Best | Mean SD | Best | ||||||||||||||||
| R1a | 3 | 24 | 190.02 | 0.00 | 18.26 | 2.00 | 3.19 | 1.54 | 0.71 | 0.00 | 0.00 | 0.00 | - | - | 1.42 | 0.54 | 0.00 | 0.00 | 0.00 | ||||||||||||
| R1b | 3 | 24 | 164.46 | 0.00 | 33.22 | 3.66 | 4.34 | 4.15 | 4.32 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 1.33 | 1.38 | 1.35 | 0.00 | ||||||||||||
| R7a | 4 | 36 | 291.71 | - | - | 4.71 | 4.71 | 14.85 | 6.09 | 0.00 | 0.00 | 0.00 | - | - | 2.03 | 1.08 | 1.34 | 0.00 | |||||||||||||
| R7b | 4 | 36 | 248.21 | - | - | 1.96 | 7.33 | 3.48 | 8.11 | - | - | - | - | 2.32 | 5.75 | 2.41 | 1.46 | 1.07 | |||||||||||||
| R2a | 5 | 48 | 301.34 | - | - | 2.79 | 2.87 | 24.07 | 12.59 | - | - | - | - | 4.01 | 2.39 | 1.55 | 1.05 | 0.29 | |||||||||||||
| MZN-Succ | MZN-Disj | CPO | OR-Tools Routing | Hexaly | SeqVar | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Dataset | Mean SD | Best | Mean SD | Best | Mean SD | Best | Mean SD | Best | Mean SD | Best | Mean SD | Best | ||||||||||||||
| A_E | 50 | 3 | 2.19 | 16.40 | 0.84 | 19.25 | 0.00 | 0.00 | 0.00 | 1.59 | 4.25 | 3.54 | 25.26 | 0.00 | 0.00 | 0.00 | ||||||||||
| 4 | 1.94 | 17.81 | 3.03 | 19.86 | 0.18 | 0.00 | 1.35 | 3.81 | 2.59 | 28.11 | 0.00 | 0.00 | 0.00 | |||||||||||||
| 100 | 3 | 8.10 | 61.75 | 3.76 | 36.24 | 0.90 | 0.00 | 0.29 | 4.62 | 1.40 | 35.04 | 0.41 | 0.29 | 0.28 | ||||||||||||
| 4 | 11.88 | 77.99 | 38.28 | 56.11 | 0.74 | 0.00 | 1.09 | 3.93 | 3.84 | 37.13 | 0.32 | 0.43 | 0.00 | |||||||||||||
| 150 | 3 | 6.17 | 96.44 | 2.57 | 44.29 | 0.36 | 0.53 | 0.28 | 2.80 | 3.83 | 1.73 | 38.84 | 0.42 | 0.14 | ||||||||||||