Offline Decision Transformers for Neural Combinatorial Optimization: Surpassing Heuristics on the Traveling Salesman Problem
This repository implements the paper Offline Decision Transformers for Neural Combinatorial Optimization: Surpassing Heuristics on the Traveling Salesman Problem, presented at the NeurIPS 2025 Differentiable Learning of Combinatorial Algorithms Workshop.
conda env create --file environment.ymlPlace all datasets in the data/ directory.
- Download or generate the TSP instance data from learning-paradigms-for-tsp.
- Then, generate the corresponding solution data.
Train a model on Farthest Insertion (FI) for N=20:
python train.py \
--train_dataset=data/tsp20_train_fi.txt \
--val_dataset=data/tsp20_val_fi.txt \
--log_dir=dt_runs/dt_n20_fi \
--num_epochs=2000 \
--save_iters=10Evaluate the trained model:
python eval.py \
--test_dataset=data/tsp20_test_fi.txt \
--model_dir=dt_runs/dt_n20_fi_[%y%m%d%H%M%S] \
--chk_pt_name="best.pt" \
--eval_optimal_gap \
--optimal_dataset=data/tsp20_test_concorde.txtThis implementation is based on Elastic-DT and learning-paradigms-for-tsp.
This project is licensed under the MIT License - see the LICENSE file for details. For details on the licenses of third-party dependencies used in this project, please refer to the NOTICE.md file.