Size Generalization for Diffusion Routing Solvers
Organizations: Bar-Ilan University · NVIDIA
Abstract
Routing problems, like the Traveling Salesman Problem (TSP) and the Capacitated Vehicle Routing Problem (CVRP), are NP-hard and slow to solve for large instances. Diffusion-based solvers can be trained in a supervised way using sets of optimal solutions, and then quickly solve new test instances. However, for large instances, optimal solutions are hard to find, and diffusion models fail to generalize to instance sizes outside their training distribution. Here we describe ResizeCO, a label free size-generalization approach that addresses both the change in statistical properties of larger instances, and the computational challenge of solving them quickly. It uses reinforcement learning on large-scale instances to adapt a diffusion model trained on small instances. Specifically, we adapt GRPO to this problem, using route length as the training signal. ResizeCO also formulates k-opt as a tree search, solved by a beam search on the GPU. In size-generalization experiments on TSP and CVRP instances with up to 10000 nodes, ResizeCO achieves a Pareto front over route quality and time that dominates learned solvers, and also outperforms other solvers at short run times, setting a new state of the art.
Figures & tables
| CVRP-100 CVRP-500 | CVRP-500 CVRP-1000 | CVRP-1000 CVRP-10000 | |||||||
| Method | Obj | Gap | Time | Obj | Gap | Time | Obj | Gap | Time |
| Classical solvers | |||||||||
| HGS (reference) ( Vidal, 2022 ) | 62.15 | 0.000% | 55 h | 121.07 | 0.000% | 197 h | 1120.23 | 0.000% | 512 h |
| HGS ( Vidal, 2022 ) | 63.99 | 2.96% | 52 s | 124.02 | 2.44% | 2.4 m | 1129.62 | 0.846% | 2.2 h |
| Supervised learning | |||||||||
| BQ-NCO (G) ( Drakulic et al., 2023 ) | 64.39 | 3.67% | 26 s | - | - | - | - | - | - |
| TSP-100 TSP-500 | TSP-500 TSP-1000 | TSP-1000 TSP-10000 | |||||||
| Method | Obj | Gap | Time | Obj | Gap | Time | Obj | Gap | Time |
| Classical solvers | |||||||||
| Concorde / LKH-3 (reference) | 16.55 | 0.000% | 37.66 m | 23.12 | 0.000% | 6.65 h | 71.83 | 0.000% | 8.8 h |
| LKH-3 (trials=32) ( Helsgaun, 2017 ) | 16.55 | 0.026% | 22 s | 23.13 | 0.036% | 56 s | 71.81 | 0.023% | 7.7 m |
| LKH-3 (trials=1) ( Helsgaun, 2017 ) | 16.57 | 0.118% | 8.6 s | 23.15 | 0.139% | 23 s | 71.89 | 0.085% | 5.6 m |
| Supervised learning | |||||||||
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
| Test | Training | ||||
|---|---|---|---|---|---|
| Problem | Size | Instances | Reference | Instances | Labels |
| TSP | 100 | 1280 | Concorde | 1.26 M | LKH-3 |
| TSP | 500 | 128 | Concorde | 128 k | LKH-3 |
| TSP | 1000 | 128 | Concorde | 64 k | LKH-3 |
| TSP | 10000 | 16 | LKH-3 | 6.4 k | - |
| CVRP | 100 | 1280 | HGS | 1.54 M | HGS |
| Parameter | TSP | CVRP |
|---|---|---|
| Input features | -D coordinates | -D coordinates demand |
| Encoder layers | 16 | 16 |
| Decoder layers | 6 | 6 |
| Embedding dimension | 256 | 512 |
| Attention heads | 8 | 8 |
| Structure-extractor GNN layers | 2 | 2 |
| Parameter | TSP | CVRP |
|---|---|---|
| Batch size | 256 (100), 128 (500), 16 (1000) | 512 (100), 64 (500), 16 (1000) |
| Training steps | 500000 | 225000 (100), 150000 (500, 1000) |
| Warm start | from scratch (100), previous (500, 1000) | from scratch |
| Parameter | TSP | CVRP |
|---|---|---|
| Group size | 8, 16 (500 to 1000), 64 (to 10000) | 8, 64 (to 10000) |
| Unmasking steps | 1 | 1 |
| Sampling temperature | 1.0 | 1.0 |
| KL coefficient | 0.005, 0 (to 10000) | 0.005, 0 (to 10000) |
| Batch size | 64 (500), 24 (1000), 96 (500 to 1000), 4 (to 10000) | 16 (500), 4 (1000), 1 (to 10000) |
| Training steps | 200000, 150000 (500 to 1000), 30000 (to 10000) | 200000, 30000 (to 10000) |
| Parameter | TSP | CVRP |
|---|---|---|
| Decoder | node-walk | node-walk |
| Unmasking steps | 1 | 1 |
| Correction cycles | 1 | 1 |
| Batch size | 16 (500, 1000), 1 (10000) | 16 (500), 8 (1000), 1 (10000) |
| Parameter | TSP | CVRP |
|---|---|---|
| Candidate set size | 15 | 20 |
| Largest of a -opt move (tree depth) | 5 | 5 |
| Beam width | 131072 | 32768 |
| Beam width-shrink factor | 4 | 4 |
| Closures kept per sweep | 256 | 128 |
| 2-opt steps before the beam -opt search | 0 | 500 |
| Parameter | TSP | CVRP |
|---|---|---|
| Correction cycles | 1, 10 | 1, 10 |
| 2-opt moves per cycle | 500 (500), 1000 (1000, 10000) | 6000 |
| Settings at test size 10000 | ||
| Top-k edge slice | ||
| Batch size | 1 | 1 |
| CVRP-100 CVRP-500 | CVRP-100 CVRP-1000 | CVRP-100 CVRP-10000 | |||||||
| Method | Obj | Gap | Time | Obj | Gap | Time | Obj | Gap | Time |
| Classical solvers | |||||||||
| HGS (reference) ( Vidal, 2022 ) | 62.15 | 0.000% | 55 h | 121.07 | 0.000% | 197 h | 1120.23 | 0.000% | 512 h |
| HGS ( Vidal, 2022 ) | 63.99 | 2.96% | 52 s | 124.02 | 2.44% | 2.4 m | 1129.62 | 0.846% | 2.2 h |
| Supervised learning | |||||||||
| BQ-NCO (G) ( Drakulic et al., 2023 ) | 64.39 | 3.67% | 26 s | 125.19 | 3.53% | 36 s | 1221.13 | 9.12% | 1.3 h |
| TSP-100 TSP-500 | TSP-100 TSP-1000 | TSP-100 TSP-10000 | |||||||
| Method | Obj | Gap | Time | Obj | Gap | Time | Obj | Gap | Time |
| Classical solvers | |||||||||
| Concorde / LKH-3 (reference) | 16.55 | 0.000% | 37.66 m | 23.12 | 0.000% | 6.65 h | 71.83 | 0.000% | 8.8 h |
| LKH-3 (trials=32) ( Helsgaun, 2017 ) | 16.55 | 0.026% | 22 s | 23.13 | 0.036% | 56 s | 71.81 | 0.023% | 7.7 m |
| LKH-3 (trials=1) ( Helsgaun, 2017 ) | 16.57 | 0.118% | 8.6 s | 23.15 | 0.139% | 23 s | 71.89 | 0.085% | 5.6 m |
| Supervised learning | |||||||||
| CVRP-500 CVRP-1000 | CVRP-1000 CVRP-10000 | CVRP-500 CVRP-10000 | |||||||
| Method | Obj | Gap | Time | Obj | Gap | Time | Obj | Gap | Time |
| Classical solvers | |||||||||
| HGS (reference) ( Vidal, 2022 ) | 121.07 | 0.000% | 197 h | 1120.23 | 0.000% | 512 h | 1120.23 | 0.000% | 512 h |
| HGS ( Vidal, 2022 ) | 124.02 | 2.44% | 2.4 m | 1129.62 | 0.846% | 2.2 h | 1129.62 | 0.846% | 2.2 h |
| Supervised learning | |||||||||
| BQ-NCO (G) ( Drakulic et al., 2023 ) | - | - | - | - | - | - | - | - | - |
| TSP-500 TSP-1000 | TSP-1000 TSP-10000 | TSP-500 TSP-10000 | |||||||
| Method | Obj | Gap | Time | Obj | Gap | Time | Obj | Gap | Time |
| Classical solvers | |||||||||
| Concorde / LKH-3 (reference) | 23.12 | 0.000% | 6.65 h | 71.83 | 0.000% | 8.8 h | 71.83 | 0.000% | 8.8 h |
| LKH-3 (trials=32) ( Helsgaun, 2017 ) | 23.13 | 0.036% | 56 s | 71.81 | 0.023% | 7.7 m | 71.81 | 0.023% | 7.7 m |
| LKH-3 (trials=1) ( Helsgaun, 2017 ) | 23.15 | 0.139% | 23 s | 71.89 | 0.085% | 5.6 m | 71.89 | 0.085% | 5.6 m |
| Supervised learning | |||||||||
| TSP-100 TSP-1000 | ||
| Method | Gap | Time |
| ResizeCO (full) | 0.813% | 7.5 s |
| w/o label-free GRPO | 3.23% | 10.7 s |
| w/o small-model initialization | 2.67% | 10.6 s |
| w/o Graph Transformer encoder | 2.42% | 8.7 s |
| w/o GPU beam -opt search | 1.29% | 7.7 s |