Rethinking Constraint Awareness for Efficient State Embedding of Neural Routing Solver

Canhong Yu, Changliang Zhou, Rongsheng Chen, Zhenkun Wang, Yu ZhouarXiv 2026

TL;DR

Existing neural routing solvers for vehicle routing problems suffer from a "myopic" view because they restrict their attention only to currently feasible nodes during decoding. This paper introduces a global observation space via Future-Guided Embedding (FGE) and pairs it with a novel Constraint-Aware Residual Modulation (CARM) module to dynamically inject constraint information. This simple architectural enhancement consistently improves solution quality, cross-scale scalability, and zero-shot generalization across multiple state-of-the-art solvers.

What Problem Does This Paper Address?

Vehicle Routing Problems (VRPs) are a cornerstone of logistics and supply chain management. Because they are NP-hard, traditional approaches rely on handcrafted heuristics that require deep domain expertise and struggle to adapt when new real-world constraints are introduced.

Recently, Heavy-Encoder-Light-Decoder (HELD) neural routing solvers have emerged as a popular alternative, learning how to construct routes directly from data. However, they typically fail when faced with complex, multi-task constraints (like tight time windows or specific backhaul rules).

The authors identify a fundamental flaw in how these models generate state embeddings during decoding. Current models use a Present-Restricted Embedding (PRE) mechanism, which masks out currently infeasible or already visited nodes before calculating attention. This deprives the model of a global perspective, leading to short-sighted decisions. While expanding the model's view to all unvisited nodes—termed Future-Guided Embedding (FGE)—restores this global perspective, it introduces a new issue: the observation space becomes "constraint-agnostic," meaning the attention mechanism sees the exact same node space regardless of changing internal states (like a vehicle's remaining capacity). This lack of constraint awareness severely hurts the model's ability to generalize to unseen routing variants.

Figure 1: Comparison of different state embedding generation mechanisms. Left: Existing mechanism, which we refer to as present-restricted embedding (PRE), limits attention to currently feasible nodes, which lacks a global perspective and results in poor node selection. Right: The future-guided embedding (FGE) expands attention to all potential candidate nodes (i.e., unvisited nodes), which is grounded in a global observation space and delivers better node selection than PRE.

Methods

To solve this dilemma, the authors propose a lightweight architecture that combines the global foresight of FGE with a new modulation technique to maintain strict constraint awareness:

  1. Future-Guided Embedding (FGE): Instead of masking out temporarily infeasible nodes during the decoding attention step, FGE keeps all unvisited nodes visible. This allows the attention mechanism to evaluate the long-term, global importance of all potential candidates.
  2. Constraint-Aware Residual Modulation (CARM): To ensure the model can still differentiate between varying constraint states within this shared global space, the authors introduce CARM. Inspired by Feature-wise Linear Modulation (FiLM), CARM takes dynamic constraint variables (such as remaining vehicle load or current time) and projects them into learnable scaling ($\gamma_t$) and shifting ($\beta_t$) vectors. These vectors perform an affine transformation on the context embedding before it enters the attention layer, explicitly forcing the global state representation to be constraint-aware.
Traditional HELD vs. CARM-Enhanced FGE Architecture

Datasets

The authors evaluated their approach across a wide variety of configurations:

  • 16 Standard VRP Variants: Generated by combining different constraints including Capacity (C), Open Route (O), Backhaul (B), Duration Limit (L), and Time Windows (TW).
  • Problem Scale: Standard training and testing were conducted on instances with 100 nodes (1,000 instances per dataset). Scalability was tested on larger instances of size $N \in \{200, 500, 1000\}$.
  • Zero-Shot Generalization: Evaluated on 8 entirely unseen VRP variants featuring Mixed Backhaul (MB) constraints to test how well the models adapt to unfamiliar problem structures.

Key Insights and Ideas

  • The Myopia of Feasibility Masking: Masking out infeasible nodes early in the attention layer (PRE) destroys the global structural context of the problem. Maintaining a global view allows the model to make better trade-offs between immediate rewards and long-term routing efficiency.
  • Global Views Need Local Context: Simply opening up the attention mechanism to all nodes (FGE) homogenizes the observation space. Without a mechanism like CARM to inject local constraint context, multi-task models get confused when generalizing to unseen tasks.
  • Inference Speedups via Better Decisions: Intuitively, adding extra layers should slow down a model. However, the authors found that at large scales ($N=1000$), models equipped with CARM actually ran faster than the baselines. Because the model made significantly higher-quality decisions, it required fewer total decoding steps to complete valid routes, reducing overall computational overhead.

Key Results

The CARM module was integrated into two single-task solvers (POMO, ReLD-STL) and five multi-task solvers (MTPOMO, MVMoE, ReLD-MTL, RouteFinder, CaDA), consistently boosting performance across the board:

  • Multi-Task Performance: On the 16 standard VRP variants, CARM-equipped models achieved the best solutions in nearly every category (e.g., securing 16/16 top scores for MTPOMO and MVMoE compared to their vanilla PRE counterparts).
  • Extreme Scalability: For large-scale instances ($N=1000$) on the complex CVRPTW problem, POMO-CARM dramatically reduced the optimality gap from 69.64% down to 22.07%, while simultaneously cutting down inference time from 771.98 seconds to 674.35 seconds.
  • Zero-Shot Generalization: Solvers utilizing CARM successfully maintained low optimality gaps when evaluated on unseen Mixed Backhaul variants, proving that the modulation mechanism successfully decouples constraint processing from the underlying spatial graph.

Limitations and Future Work

While CARM provides a powerful architectural fix for the decoder, the authors note that this study focuses strictly on model architecture rather than the training process itself.

For future work, they propose exploring how to integrate constraint awareness directly into the training paradigm. Additionally, they suggest moving away from the standard practice of randomly sampling $N$ trajectories with distinct starting nodes, proposing instead a more intentional, constraint-driven strategy for selecting starting nodes during decoding.

Summary updated

BibTeX
@misc{yu2026rethinking,
  author = {Canhong Yu and Changliang Zhou and Rongsheng Chen and Zhenkun Wang and Yu Zhou},
  title = {{Rethinking Constraint Awareness for Efficient State Embedding of Neural Routing Solver}},
  year = {2026},
  eprint = {2605.10122},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.10122},
}
Figure