TL;DR
EFormer is a novel edge-based Transformer model designed to solve Vehicle Routing Problems (VRPs) using only edge weights (such as distances or costs) rather than node coordinates. By utilizing a unique parallel dual-encoder architecture, EFormer achieves state-of-the-art performance on both the Traveling Salesman Problem (TSP) and Capacitated VRP (CVRP), demonstrating exceptional generalization to real-world and large-scale instances.
What Problem Does This Paper Address?
Most deep learning approaches for solving VRPs rely heavily on node coordinates as their primary input. While this works well for idealized, Euclidean problems on a 2D plane, it falls short in real-world logistics. In practice, routing costs depend on actual road networks, traffic, and asymmetric constraints where distances cannot be easily inferred from coordinates alone.
Existing edge-based neural heuristics attempt to solve this by taking distance matrices as inputs, but they often struggle with scalability or solution quality. The authors introduce EFormer to bridge this gap, creating a purely edge-based model that operates effectively without needing coordinate data, making it far more practical for real-world deployment.
Methods
EFormer utilizes an autoregressive, heavy-encoder light-decoder architecture trained via reinforcement learning (the REINFORCE algorithm). Its core pipeline consists of three main stages:
- Precoder Module: Since the model only receives edge weights, the precoder uses a multi-head mixed-score attention mechanism to convert raw edge information into temporary node embeddings. It also injects randomized one-hot vectors to enable flexible "instance augmentation"—allowing the model to generate diverse solutions for the same problem instance.
- Parallel Encoding Strategy: To capture global relationships without exploding computational costs, EFormer splits the encoding into two parallel paths:
- Graph Encoder: Uses a residual gated Graph Convolutional Network (GCN) to process a sparsified version of the graph (retaining only the $k$-nearest neighbors for each node).
- Node Encoder: Uses standard multi-head attention layers to process the temporary node embeddings independently.
- Decoder Module: The decoder constructs the final path step-by-step. It uses parallel context embedding and multi-query integration to combine the distinct feature spaces from both encoders, computing separate attention mechanisms to select the next optimal node.
Datasets
The authors evaluated EFormer across a rigorous mix of synthetic and real-world datasets:
- Synthetic Uniform Data: TSP and CVRP instances with 20, 50, and 100 nodes, generated following standard uniform distribution protocols.
- Distribution Variants: Non-uniform synthetic datasets featuring explosion, grid, and implosion distributions to test structural robustness.
- Large-Scale Generalization: Synthetic instances scaled up to 500 nodes to evaluate zero-shot generalization.
- Real-World Benchmarks: Well-known public repositories including TSPLib and CVRPLib to verify practical applicability.
- Asymmetric Data: Randomly generated asymmetric distance matrices for the Asymmetric TSP (ATSP).
Key Insights and Ideas
- Decoupling Topology and Features: A key "aha moment" in the paper is that a single encoder type isn't enough for edge-only data. Processing graph structure (via GCN) and node features (via Attention) in separate, parallel feature spaces yields a significantly more comprehensive global representation than combining them into one network.
- Matrix-Based Instance Augmentation: Popular node-based models like POMO achieve massive performance gains by rotating and reflecting node coordinates to create augmented data. EFormer achieves a similar effect purely from edge data by mixing random one-hot vector sequences into its precoder, proving that coordinate data isn't a prerequisite for effective data augmentation.
- Input Flexibility: Although designed for edge-only inputs, the architecture is flexible. By omitting the precoder, it can be converted into a node-coordinate model (EFormer-node) that actually outperforms top-tier node-based baselines.
Key Results
EFormer consistently outperformed established edge-based neural heuristics (like MatNet and GREAT) as well as classical operations research tools (like OR-Tools):
- TSP100: With $\times128$ instance augmentation, EFormer achieved an incredibly tight optimality gap of just 0.045% relative to the exact solver Concorde.
- CVRP100: EFormer reached an optimality gap of 0.563%, outperforming all other edge-based learning methods.
- Zero-Shot Scale Generalization: When trained on 100-node instances and tested directly on 500-node instances, EFormer maintained a significantly lower optimality gap than competing neural methods on both TSP and CVRP.
- Real-World Performance: EFormer achieved the best results among learning-based methods on TSPLib and CVRPLib instances under 100 nodes, and ranked second for larger instances up to 300 nodes.
Limitations and Future Work
While EFormer delivers excellent solution quality, its primary trade-off is computational runtime during heavy inference. Using $\times128$ instance augmentation significantly increases the time required to find a solution compared to greedy ($\times1$) inference.
The authors note that future work will focus on developing more lightweight architectural designs to improve scalability for even larger problem sizes. Additionally, they aim to build a unified framework capable of seamlessly processing both node coordinates and edge weights simultaneously when both data types are available.
Summary updated