CaDA: Cross-Problem Routing Solver with Constraint-Aware Dual-Attention

Han Li, Fei Liu, Zhi Zheng, Yu Zhang, Zhenkun Wang

Introduction

Vehicle Routing Problems (VRPs) are the bread and butter of logistics, involving the discovery of the most efficient paths for a fleet of vehicles. While traditional solvers work well, they are often slow or require manual "tuning" for every new constraint, such as time windows or backhauls.

Recently, researchers have turned to Neural Combinatorial Optimization (NCO)—using deep learning to "learn" heuristics. However, most NCO models are specialists: a model trained for basic capacity constraints often fails when time windows are introduced. CaDA (Constraint-Aware Dual-Attention) is a new neural solver designed to tackle 16 different VRP variants with a single model. By combining a "constraint prompt" that informs the model of specific rules and a dual-attention mechanism that balances global context with sparse, local focus, CaDA achieves state-of-the-art performance across diverse routing scenarios.

The Challenge of Cross-Problem Routing

Existing "cross-problem" models that attempt to be generalists often suffer from two primary issues:

  1. Constraint Blindness: They do not explicitly "know" which rules are active, making it difficult to navigate the feasible solution space effectively.
  2. Attention Inefficiency: They rely on global attention, meaning every node looks at every other node. In routing, most nodes are irrelevant to the current step, leading to "noisy" representations.
Examples of different vehicle routing constraints, including capacity, open routes, time windows, and backhauls.

The CaDA Approach

To address these limitations, the authors introduce CaDA, which features two major architectural innovations designed to handle varying constraints dynamically.

The CaDA architecture featuring the Constraint Prompt and the Dual-Attention Model with global and sparse branches.

1. Constraint Prompting

To make the model "aware" of the specific problem variant, CaDA uses a 5-dimensional multi-hot vector representing five constraints: Capacity (C), Open Route (O), Backhaul (B), Duration Limit (L), and Time Window (TW). This vector is processed into a "prompt" that is concatenated with node embeddings. Essentially, it acts as a contextual cue, telling the encoder specific rules for the current run (e.g., "vehicles do not need to return to the depot").

2. Dual-Attention Mechanism

Instead of a single transformer branch, CaDA uses two distinct branches to process graph information:

  • Global Branch: A standard attention layer designed to capture the broad "big picture" of the graph.
  • Sparse Branch: A specialized layer utilizing Top-$k$ selection. It only allows nodes to attend to their most "promising" neighbors based on attention scores. This forces the model to filter out noise and focus on the most likely next steps in a route.

The model uses these branches to encode the graph and then employs an autoregressive decoder (trained via Reinforcement Learning using the REINFORCE algorithm) to build the routes step-by-step.

Key Insights and Results

Datasets and Testing

The model was rigorously tested on 16 VRP variants (combinations of the five constraints, such as CVRP, VRPTW, OVRPL). Evaluations were performed on synthetic data (50 and 100 nodes) and the well-known CVRPLib real-world benchmark suite (ranging from 16 to 200 nodes) to test generalization.

Performance Highlights

  • State-of-the-Art (SOTA): CaDA outperformed all existing cross-problem neural solvers (like MTPOMO and RouteFinder) across all 16 tested VRP variants.
  • Quantitative Gains: On average, CaDA reduced the optimality gap by 0.26% for 50-node problems and 0.32% for 100-node problems compared to the previous best methods.
  • Real-World Performance: On the CVRPLib benchmark, CaDA achieved an average gap of 3.32% (using 32-fold augmentation), significantly better than competitors like MVMoE (5.29%) or MTPOMO (8.67%).
  • Zero-Shot Generalization: The model showed strong capabilities on entirely unseen constraints, such as Multi-Depot VRPs, without requiring additional training.

Why It Works

Treating problem constraints like "styles" in a generative model allows the same network weights to adapt their behavior to drastically different feasible regions. Furthermore, because the "curse of dimensionality" in routing means most connections are suboptimal, explicitly forcing the model to ignore low-probability connections via the sparse branch makes representation learning much more efficient. Visualizations of the model's attention heatmaps confirm that the prompt actively changes focus—for instance, dropping attention on the depot node during Open Route problems.

Limitations and Future Work

While CaDA handles up to 200 nodes effectively, real-world logistics often involve thousands of nodes. At that scale, the computational cost of the global branch may become a bottleneck. Additionally, the model is currently limited to the five specific constraints it was trained on; introducing a fundamentally new constraint type (like 3D loading) would likely require retraining. Future work will explore more efficient sparse attention mechanisms for larger-scale graphs and the integration of more complex, real-world constraints.

Summary updated

BibTeX
@inproceedings{li2025cada,
  author = {Han Li and Fei Liu and Zhi Zheng and Yu Zhang and Zhenkun Wang},
  title = {{CaDA: Cross-Problem Routing Solver with Constraint-Aware Dual-Attention}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=CS4RyQuTig},
}
Figure