Abstract
Many real-world problems can be formulated as a constrained Traveling Salesman Problem (TSP). However, the constraints are always complex and numerous, making the TSPs challenging to solve. When the number of complicated constraints grows, it is time-consuming for traditional heuristic algorithms to avoid illegitimate outcomes. Learning-based methods provide an alternative to solve TSPs in a soft manner, which also supports GPU acceleration to generate solutions quickly. Nevertheless, the soft manner inevitably results in difficulty solving hard-constrained problems with learning algorithms, and the conflicts between legality and optimality may substantially affect the optimality of the solution. To overcome this problem and to have an effective solution against hard constraints, we proposed a novel learning-based method that uses looking-ahead information as the feature to improve the legality of TSP with Time Windows (TSPTW) solutions. Besides, we constructed TSPTW datasets with hard constraints in order to accurately evaluate and benchmark the statistical performance of various approaches, which can serve the community for future research. With comprehensive experiments on diverse datasets, MUSLA outperforms existing baselines and shows generalizability potential.
Introduction
The Traveling Salesman Problem (TSP) is a cornerstone of combinatorial optimization. However, real-world applications—like delivery routing or industrial scheduling—rarely involve just visiting cities. They involve Traveling Salesman Problems with Time Windows (TSPTW), where each location must be visited within a specific time frame. The challenge lies in "hard constraints": if a salesman arrives even a second late to a single city, the entire tour is considered a failure.
Traditional heuristic solvers (like LKH3) are highly accurate but can be agonizingly slow as problem sizes grow. Conversely, modern machine learning approaches (usually Reinforcement Learning) struggle with hard constraints; they often "relax" the rules into soft penalties, leading to solutions that are technically illegal. This paper introduces MUSLA (Multi-Step Look-Ahead), a fast, neural solver that respects strict deadlines by incorporating future-state information directly into the model's features.
Methodology
MUSLA is a Supervised Learning (SL) approach that imitates an expert solver but adds a "look-ahead" mechanism to anticipate future failures. The framework progresses from expert solutions to augmented datasets that incorporate look-ahead information.
Look-Ahead Mechanism
The core innovation is how the model decides the next city. Instead of looking only at the immediate next step, it evaluates the consequences of its choices:
- One-Step Look-Ahead (OSLA): The model simulates one step into the "imaginary" future for every possible next city to see if that choice leads to an immediate timeout.
- Multi-Step Look-Ahead (MUSLA): To avoid the computational explosion of checking every possible future path, the model uses a pre-trained policy to prune the search space, looking several steps ahead to gather "future-aware" features.
Dataset and Training
Because existing benchmarks often lack genuine conflicts between path length and deadlines, we introduced two new benchmarks: MEDIUM (randomly sampled coordinates/windows) and HARD (shifted distributions to test generalization). All training data was labeled using the LKH3 solver, the current gold standard for TSP variants.
Key Results
MUSLA achieves a state-of-the-art balance between finding the shortest path and ensuring legality. On the $N=100$ (100 cities) MEDIUM dataset, MUSLA-adapt achieved an illegal rate of just 0.60%, compared to 9.00% for standard Attention Models (AM) and 100% failure for JAMPR (a state-of-the-art VRPTW solver).
Beyond legality, the model offers massive speedups. For the largest problems ($N=100$), MUSLA-adapt was roughly 19x faster than the LKH3 heuristic solver, while the base MUSLA model was 129x faster. On the HARD dataset, where other models' performance crumbled, MUSLA maintained a high legality rate and a competitive solution gap, proving its robust generalization capabilities.
Discussion and Conclusion
A key insight of this work is that in hard-constrained problems, legality is a prerequisite, not a bonus. Supervised Learning proved superior to Reinforcement Learning in this context because it learns exclusively from successful expert examples. By putting the "intelligence" into the input features—describing the future consequences of a current choice—the neural network learns to recognize "points of no return."
While MUSLA requires a high-quality expert solver to generate training data, it significantly reduces the inference time required for complex routing. Future work will explore reducing the reliance on expensive expert solvers through RL-generated suboptimal datasets and further refining search efficiency.
Summary updated