Implementation of our paper Beyond the Heatmap: A Rigorous Evaluation of Component Impact in MCTS-Based TSP Solvers.
conda create -n mcts_tsp python=3.10
conda activate mcts_tsp- Install system dependencies:
conda install gxx_linux-64 gcc_linux-64 swig- Install Python packages:
pip install smac fire
# Install PyTorch (CPU version), which is sufficient for running the code
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install git+https://github.com/neo-pan/mcts_tsp.git- Extract test instances:
cd testset
unzip testdata.zip- Generate GT-Prior heatmap:
cd testset/all_heatmap/gt/
python batch_generate_heatmap.pyFor other baseline heatmaps, download from xyfffff/rethink_mcts_for_tsp and place in testset/all_heatmap/.
Run test_mcts.py to evaluate different configurations:
python test_mcts.py --num_of_nodes <size> \
--method <heatmap_type> \
--use_default \
--max_threads <thread_count>Key Parameters:
num_of_nodes: Instance sizemethod: Heatmap sourceuse_default: Use default hyperparameters or tuned hyperparametersmax_threads: Hardware-dependent parallelization- See
--helpfor additional parameters
Use tune_mcts.py to optimize parameters with SMAC3:
python tune_mcts.py --num_of_nodes <size> \
--num_instances <count> \
--method <heatmap_type> \
--n_trials <optimization_iterations> \
--max_threads <thread_count>Key Parameters:
num_instances: Number of training instancesn_trials: SMAC optimization iterationsmethod: Choice of heatmap type (attgcn/dimes/softdist/gt/utsp/zero/difusco-r/difusco-p)