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

We propose a manager-worker framework based on deep reinforcement learning to tackle a hard yet nontrivial variant of Travelling Salesman Problem (TSP), i.e., multiple-vehicle TSP with time window and rejections (mTSPTWR), where customers who cannot be served before the deadline are subject to rejections. Particularly, in the proposed framework, a manager agent learns to divide mTSPTWR into sub-routing tasks by assigning customers to each vehicle via a Graph Isomorphism Network (GIN) based policy network. A worker agent learns to solve sub-routing tasks by minimizing the cost in terms of both tour length and rejection rate for each vehicle, the maximum of which is then fed back to the manager agent to learn better assignments. Experimental results demonstrate that the proposed framework outperforms strong baselines in terms of higher solution quality and shorter computation time. More importantly, the trained agents also achieve competitive performance for solving unseen larger instances.

Introduction

Routing problems in real-world logistics often extend far beyond the classic Traveling Salesman Problem (TSP). The Multiple-TSP with Time Window and Rejections (mTSPTWR) introduces three critical constraints: coordinating a fleet of vehicles, meeting strict customer time windows, and managing rejections when deadlines are unreachable. Solving mTSPTWR is NP-hard and computationally intensive; traditional exact algorithms struggle with scale, while standard deep reinforcement learning (DRL) models often fail to balance fleet-wide coordination with individual route feasibility. This paper presents a hierarchical DRL approach that decouples task assignment from route optimization to overcome these challenges.

Methodology: The Manager-Worker Framework

The core of the proposed solution is a hierarchical Manager-Worker Framework. This architecture separates the high-level strategy of customer assignment from the low-level tactics of route execution.

Overview of the hierarchical Manager-Worker framework for solving mTSPTWR.

The Manager Agent

The Manager Agent views the entire customer graph and is responsible for partitioning the workload. It utilizes a Graph Isomorphism Network (GIN) to generate structural embeddings of the nodes, followed by a multi-head self-attention mechanism to assign each customer to a specific vehicle. The Manager's objective is a "min-max" goal: it seeks to minimize the maximum hybrid cost (a combination of tour length and rejection penalties) across the entire fleet, ensuring a balanced and efficient workload distribution.

The Worker Agent

Once tasks are assigned, the Worker Agent optimizes the route for each individual vehicle. It employs an attention-based encoder-decoder policy to determine visiting orders. To handle the strict temporal constraints of mTSPTWR, the worker incorporates a backtracking procedure that removes nodes violating time windows, ensuring all final routes are feasible. The system is trained using the REINFORCE algorithm, with the worker first trained as an expert in single-vehicle routing before the manager learns to optimize assignments.

Experimental Results

The framework was evaluated against strong metaheuristic baselines, including Tabu Search (TS), Simulated Annealing (SA), and the Bees Algorithm (BA), across various problem sizes ($n=50$ to $500$) and fleet configurations ($m=5, 10$).

Performance analysis showing hybrid cost scalability, customer assignment distribution, and the impact of multi-head attention.

Solution Quality and Scalability

As illustrated in the experimental results, the proposed DRL framework consistently achieves lower hybrid costs than traditional metaheuristics, especially as the problem size increases. For instance, in $n=500$ scenarios with 5 vehicles, the model achieved a hybrid cost of approximately 29.15, significantly outperforming the best metaheuristic (SA at ~39.89). The model also demonstrated superior zero-shot generalization, effectively solving 500-customer instances after being trained on only 150 customers.

Computational Efficiency

The DRL framework offers a massive advantage in inference speed. While metaheuristics often required up to 1,800 seconds to reach a solution, the proposed model generated high-quality routes in 0.08 to 1.1 seconds. This real-time capability makes it highly suitable for dynamic logistics environments.

Conclusion

By decoupling assignment and routing, the Manager-Worker framework effectively addresses the complexities of mTSPTWR. The integration of GIN for spatial partitioning and a dedicated worker agent for route optimization allows the model to outperform traditional heuristics in both quality and speed. Future research will focus on joint end-to-end training and incorporating additional real-world constraints such as vehicle capacities and heterogeneous fleets.

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