This is the official repository for
Wang C, Yu T. Efficient training of multi-task neural solver with multi-armed bandits[J]. arXiv preprint arXiv:2305.06361, 2023.
Our codes run perfectly on Ubuntu18.04 and CUDA version 11.7. The basic environment settings are as follows:
Python=3.10
PyTorch=2.0.1Then you need to setup SMPyBandits to support the bandit algorithm: Go to ./MTL-COP, then
git clone https://github.com/SMPyBandits/SMPyBandits.gitYou can download the dataset from here.
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python train.py --epochs 1000 --warm_start 1 --select_freq 12 --tsp 20 50 100 --cvrp 20 50 100 --op 20 50 100 --kp 50 100 200 --bandit_alg exp3 --task_description train12task_exp3_freq12CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python train.py --epochs 1000 --warm_start 1 --select_freq 12 --tsp 20 50 100 --cvrp 20 50 100 --op 20 50 100 --kp 50 100 200 --bandit_alg exp3 --task_description train12task_exp3_freq12_resume --model_load --resume_path "your/resume/path" --resume_epoch 1000CUDA_VISIBLE_DEVICES=0 python test.py --model_path "your/model/path" --model_epoch 1000Test on TSPLib or CVRPLib:
CUDA_VISIBLE_DEVICES=0 python test_real.py --tsp --model_path "your/model/path" --model_epoch 1000
CUDA_VISIBLE_DEVICES=0 python test_real.py --cvrp --model_path "your/model/path" --model_epoch 1000This code repository is heavily based on the work from the POMO project, which can be found at https://github.com/yd-kwon/POMO.