Learning to Solve Multiple-TSP With Time Window and Rejections via Deep Reinforcement Learning

Rongkai Zhang, Cong Zhang, Zhiguang Cao, Wen Song, Puay Siew Tan, Jie Zhang, Bihan Wen, Justin Dauwels

Abstract

The Traveling Salesman Problem with Time Windows and Rejections (mTSPTWR) is a complex combinatorial optimization problem prevalent in real-world logistics. Traditional methods often struggle with the exploding search space and conflicting constraints inherent in multi-vehicle routing. This paper introduces a hierarchical "manager-worker" deep reinforcement learning (DRL) framework that decouples customer assignment from route optimization. By utilizing a Graph Isomorphism Network (GIN) and multi-head attention, the model achieves near-optimal solutions with massive speedups and superior generalization to large-scale problems compared to traditional metaheuristics.

Introduction

In modern logistics, a fleet of vehicles must often serve customers within strict time windows. However, real-world constraints frequently make it impossible to serve every customer. The mTSPTWR variant addresses this by allowing "rejections," where the objective is to minimize a hybrid cost comprising total tour length and the rejection rate.

Solving mTSPTWR is computationally intensive for classical algorithms due to the simultaneous challenges of partitioning customers among vehicles and sequencing them within time constraints. Existing DRL methods typically address these components in isolation. This research proposes an end-to-end hierarchical approach to bridge this gap.

Hierarchical Manager-Worker Framework

The core innovation is a two-level architecture that simplifies the problem by separating high-level coordination from low-level execution.

The hierarchical manager-worker framework decouples customer assignment from individual vehicle routing.
  1. The Manager Agent: Responsible for the "big picture," the manager partitions the set of customers into $m$ groups, one for each vehicle. It looks at the global state to balance workloads and minimize potential rejections.
  2. The Worker Agent: Acting as a routing specialist, the worker solves a single-vehicle TSPTWR for its assigned subgroup. It employs a self-attention-based encoder-decoder architecture and a backtracking procedure to ensure feasible, time-compliant routes.

The system is trained in two stages: the worker is first pre-trained on single-vehicle tasks to become an expert router. Subsequently, the manager is trained via the REINFORCE algorithm, receiving rewards based on the worker's performance in minimizing the maximum hybrid cost across the fleet.

Policy Network Architecture

The Manager's decision-making process relies on sophisticated graph representation and attention mechanisms to handle the variable number of customers and vehicles.

The Manager's policy network architecture, featuring GIN for graph embedding and multi-head attention for vehicle assignment.

The network uses a Graph Isomorphism Network (GIN) to generate embeddings for customers and the depot, capturing the spatial structure of the problem. A multi-head self-attention mechanism then processes these embeddings to assign customers. Notably, the manager uses independent attention heads for each vehicle, allowing it to differentiate between identical vehicles and balance the workload more effectively than a shared-parameter approach.

Experimental Results and Insights

The model was evaluated against synthetic datasets with up to 500 customers, demonstrating several key advantages:

  • Efficiency and Speed: While traditional metaheuristics like Tabu Search or Simulated Annealing can take over 30 minutes for a 500-customer instance, the DRL framework generates high-quality solutions in approximately 0.8 seconds.
  • Structural Generalization: Models trained on only 150 customers generalized remarkably well to 500-customer problems. This suggests the agents learn fundamental "rules of thumb" for routing rather than merely memorizing specific patterns.
  • Cost Balancing: By adjusting a penalty coefficient ($eta$) for rejections, the model can be tuned to prioritize either service levels (low rejections) or operational efficiency (shorter tours).

Conclusion

The hierarchical manager-worker framework demonstrates that decoupling assignment from routing is a powerful strategy for complex vehicle routing variants. By simplifying the search space for each agent, the model avoids the curse of dimensionality that plagues end-to-end models. Future work will explore joint training of both agents, handling dynamic fleet sizes, and adapting the model for real-time environments with stochastic demands or traffic delays.

Summary updated

BibTeX
@article{zhang2023learning,
  author = {Rongkai Zhang and Cong Zhang and Zhiguang Cao and Wen Song and Puay Siew Tan and Jie Zhang and Bihan Wen and Justin Dauwels},
  title = {{Learning to Solve Multiple-TSP With Time Window and Rejections via Deep Reinforcement Learning}},
  journal = {IEEE Trans. Intell. Transp. Syst.},
  year = {2023},
  doi = {10.1109/tits.2022.3207011},
}
Figure