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

SEAFormer: A Spatial Proximity and Edge-Aware Transformer for Real-World Vehicle Routing Problems

Saeed Nasehi Basharzad, Farhana Choudhury, Egemen Tanin

TL;DR

SEAFormer is a novel dual-stream transformer architecture designed to tackle complex, large-scale Real-World Vehicle Routing Problems (RWVRPs). By introducing Clustered Proximity Attention (CPA)—which drops attention complexity from $O(n^2)$ to $O(n)$—and a lightweight edge-aware module, it becomes the first neural method to effectively solve routing problems with over 1,000 nodes while strictly respecting real-world constraints like battery limits and asymmetric costs.

What Problem Does This Paper Address?

While deep learning has recently excelled at solving classical Vehicle Routing Problems (VRPs), real-world logistics are far more complicated than simply minimizing distance on a clean 2D plane. Real-World VRPs (RWVRPs) introduce tightly coupled, sequence-dependent constraints such as:

  • Time Windows (VRPTW): Customers must be served within specific time frames.
  • Electric Vehicle Recharging (EVRPCS): Vehicles have limited battery life and must strategically detour to charging stations.
  • Replenishment Stops (VRPRS): Vehicles must stop to reload goods.
  • Asymmetric Costs (AVRP): Travel times/costs differ depending on direction due to one-way streets or traffic.

Existing neural solvers fail here for two reasons. First, standard transformers rely on full attention mechanisms that scale quadratically ($O(n^2)$), limiting them to small instances. Second, they treat routing purely as node selection, ignoring crucial edge-level features (like traffic or direction-dependent costs). Divide-and-conquer methods try to fix scaling by clustering first, but this creates a circular dependency: you cannot know if a cluster is feasible until you know the exact sequence of the route.

Methods

SEAFormer addresses these challenges using a dual-stream encoder-decoder architecture that processes node and edge features simultaneously.

Figure 2. SEAFormer Architecture. The dual-module encoder embeds nodes via CPA and edges via a lightweight residual module. The dual-path decoder combines edge-aware guidance (heatmap) with sequential node selection (attention) through logit fusion. This design enables scalable training on large node sets and diverse RWVRP constraints. A visual illustration of CPA is provided in Appendix I.

1. Clustered Proximity Attention (CPA)

To break the $O(n^2)$ computational bottleneck, the authors introduce CPA. Instead of calculating attention across all node pairs, CPA projects customer locations into polar coordinates relative to the depot. Nodes are then grouped into clusters of size $M$ based on a partitioning score that balances radial distance and angular position.

To prevent hard boundaries from splitting up nearby nodes, they apply a boundary smoothing circular shift. By running multiple partitioning rounds with different distance-vs-angle weights, the model maintains a global perspective while restricting attention computation to localized clusters, achieving a linear complexity of $O(n)$.

2. Lightweight Edge-Aware Module (EAM)

To capture pairwise relationships (like asymmetric costs), the EAM combines edge features with origin and destination node embeddings using residual fusion. This module anchors edge representations within their spatial context while only increasing the model's total parameters by a modest 7.5%.

3. Dual-Path Decoder with Proactive Masking

The decoder combines a static, edge-guided global heatmap with a sequential node-guided attention mechanism. Crucially, it uses a proactive masking function during inference. At each step, it preemptively masks any node that would cause a vehicle to violate capacity, run out of battery, or miss a time window, guaranteeing 100% valid, feasible solutions without relying on slow post-hoc repair loops.

Datasets

The authors evaluated SEAFormer across several extensive benchmarks:

  • Random RWVRP Benchmarks: Synthetic datasets ranging from 100 to 7,000 nodes for VRPTW, EVRPCS, VRPRS, and AVRP.
  • Classic VRP Benchmarks: Standard capacity-constrained datasets up to 7,000 nodes.
  • Real-World Datasets: Large-scale instances from CVRPLIB, real-world EVRPCS benchmarks (Mavrovouniotis et al.), and VRPTW benchmarks (Gehring & Homberger).
  • Cross-Distribution Datasets: Out-of-distribution "Rotation" and "Explosion" spatial setups to test generalization.

Key Insights and Ideas

  • Polar Geometry Reflects Routing Logic: Optimal routes naturally cluster radially or angularly around a central depot. Leveraging polar coordinates for sparse attention is far more effective for spatial routing than generic text-based sparse attention mechanisms like Longformer or BigBird.
  • Edges Matter as Much as Nodes: In asymmetric or traffic-heavy environments, a model cannot make optimal choices by looking at customer demands alone; it must explicitly reason about the cost of the transitions (edges) between them.
  • Hard Masking Beats Penalties: Instead of using soft penalty terms in the loss function (which slows down training and can still output invalid routes), hard-coding a proactive lookahead mask ensures absolute feasibility during deployment.

Key Results

  • Scale Milestone: SEAFormer is the first learning-based method to effectively solve 1,000+ node instances for complex RWVRP variants.
  • Superior Accuracy: On large-scale complex variants (VRPTW, EVRPCS, VRPRS, AVRP), SEAFormer achieved at least a 15% reduction in objective value (route length) compared to state-of-the-art neural solvers.
  • Asymmetric Mastery: On 1,000-node Asymmetric VRPs (AVRP), where other neural methods severely degrade, SEAFormer outperformed classical OR-Tools by 5.2%.
  • Efficiency: Thanks to CPA, training memory consumption was reduced by up to 92% compared to standard full-attention encoders.

Limitations and Future Work

While highly effective, the authors note a few limitations:

  1. Single-Depot Focus: The current polar coordinate transformation assumes a single central depot, though the paper outlines theoretical extensions for Multi-Depot VRPs (MDVRP).
  2. Variant-Specific Training: The model must still be trained separately for each distinct VRP variant.

Future work will focus on multi-task learning to create a single unified model capable of handling all RWVRP variants simultaneously, as well as developing heatmap-guided search strategies to replace greedy decoding.

Summary updated

BibTeX
@misc{basharzad2026seaformer,
  author = {Saeed Nasehi Basharzad and Farhana Choudhury and Egemen Tanin},
  title = {{SEAFormer: A Spatial Proximity and Edge-Aware Transformer for Real-World Vehicle Routing Problems}},
  year = {2026},
  eprint = {2601.19395},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.19395},
}
Figure