experiment.py is the central entry point. The four wrapper scripts fix the ablation setting:
run_full.py: full modelrun_no_enc_cluster.py: encoder cluster attention disabledrun_no_dec_cluster.py: decoder cluster attention disabledrun_pomo.py: POMO baseline (cluster attention disabled in both encoder and decoder)
These wrappers only toggle the cluster-attention modules. The rest of the model structure, training setup, and evaluation options stay the same.
- Python 3.9+
- PyTorch 1.12+ (install the CUDA build that matches your driver if needed)
Install the Python dependencies:
pip install -r requirements.txtExample PyTorch installation for CUDA 11.8:
pip install torch --index-url https://download.pytorch.org/whl/cu118Evaluation data is stored as .pkl files. Two formats are supported:
- List format:
[(depot_xy, node_xy), ...] - Dict format:
{'data': [(depot_xy, node_xy), ...], 'scale_factor': float}
Where:
depot_xyis the depot coordinate(x, y)node_xyis the list of customer node coordinates
For .pkl instances, the code assumes the first half of node_xy are pickup nodes and the second half are their paired delivery nodes.
Evaluation expects each .pkl file to contain a single instance by default.
Example: 100-node instances, 100 files, clustered distribution.
python generate_pdp_dataset.py --name test --problem pdp --data_distribution clustered --cluster_std 0.1 --graph_sizes 100 --dataset_size 1 --num_files 100 --seed 10000 --data_dir dataExample output path:
data/pdp/pdp100_test_clustered_std0.1_seed10000.pkl
Full model:
python run_full.py --task train --problem_size 100 --distribution clustered --train_batch_size 128Encoder cluster attention disabled:
python run_no_enc_cluster.py --task train --problem_size 100 --distribution clustered --train_batch_size 128Decoder cluster attention disabled:
python run_no_dec_cluster.py --task train --problem_size 100 --distribution clustered --train_batch_size 128POMO baseline:
python run_pomo.py --task train --problem_size 100 --distribution clustered --train_batch_size 128Disable the learned gate:
python run_full.py --task train --problem_size 100 --distribution clustered --disable_gateGreedy decoding:
python run_full.py --task test "data/pdp/pdp100_test_clustered_std0.1_seed*.pkl" --model_path /path/to/result_dir --epoch 800 --decode_strategy greedySampling with width 1280:
python run_full.py --task test "data/pdp/pdp100_test_clustered_std0.1_seed*.pkl" --model_path /path/to/result_dir --epoch 800 --decode_strategy sampling --width 1280Sampling with width 12800:
python run_full.py --task test "data/pdp/pdp100_test_clustered_std0.1_seed*.pkl" --model_path /path/to/result_dir --epoch 800 --decode_strategy sampling --width 12800To evaluate another ablation, replace run_full.py with one of:
run_no_enc_cluster.pyrun_no_dec_cluster.pyrun_pomo.py
experiment.py: shared training and evaluation entry pointrun_full.py: full-model wrapperrun_no_enc_cluster.py: wrapper without encoder cluster attentionrun_no_dec_cluster.py: wrapper without decoder cluster attentionrun_pomo.py: POMO baseline wrapperCVRPModel_training.py: model definitionCVRPEnv.py: environment and state transitionsCVRPTrainer.py: training loopCVRPTester.py: checkpoint loading and evaluationgenerate_pdp_dataset.py: test-set generatorutils.py: logging and utility helpersdata/: dataset directory (not version-controlled)
Cluster-Aware Attention-Based Deep Reinforcement Learning for Pickup and Delivery Problems Wentao Wang, Lifeng Han, and Guangyu Zou. arXiv preprint arXiv:2603.10053, 2026. [Paper]
BibTeX (Click to expand)
@misc{wang2026clusteraware,
title={Cluster-Aware Attention-Based Deep Reinforcement Learning for Pickup and Delivery Problems},
author={Wentao Wang and Lifeng Han and Guangyu Zou},
year={2026},
eprint={2603.10053},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={[https://arxiv.org/abs/2603.10053](https://arxiv.org/abs/2603.10053)},
}