cuGenOpt: A GPU-Accelerated General-Purpose Metaheuristic Framework for Combinatorial Optimization
Organizations: Independent Researcher, Shenzhen, China
Abstract
Combinatorial optimization problems arise in logistics, scheduling, and resource allocation, yet existing approaches face a fundamental trade-off among generality, performance, and usability. We present cuGenOpt, a GPU-accelerated general-purpose metaheuristic framework that addresses all three dimensions simultaneously. At the engine level, cuGenOpt adopts a "one block evolves one solution" CUDA architecture with a unified encoding abstraction (permutation, binary, integer), a two-level adaptive operator selection mechanism, and hardware-aware resource management. At the extensibility level, a user-defined operator registration interface allows domain experts to inject problem-specific CUDA search operators. At the usability level, a JIT compilation pipeline exposes the framework as a pure-Python API, and an LLM-based modeling assistant converts natural-language problem descriptions into executable solver code. Experiments across five thematic suites on three GPU architectures (T4, V100, A800) show that cuGenOpt outperforms general MIP solvers by orders of magnitude, achieves competitive quality against specialized solvers on instances up to n=150, and attains 4.73% gap on TSP-442 within 30s. Twelve problem types spanning five encoding variants are solved to optimality. Framework-level optimizations cumulatively reduce pcb442 gap from 36% to 4.73% and boost VRPTW throughput by 75-81%. Code: https://github.com/L-yang-yang/cugenopt
Figures & tables
| Method | GPU | Univ. Enc. | AOS | Op. Ext. | Python | New Problem |
|---|---|---|---|---|---|---|
| MIP (SCIP/CBC) | Math modeling | |||||
| OR-Tools Routing | Not supported | |||||
| cuOpt [ 17 ] | VRP/MILP only | |||||
| GPU-ACO [ 4 ] | Rewrite kernel | |||||
| ALNS [ 23 ] | Custom op. pairs | |||||
| GPU-EA [ 26 ] | Partial | Partial rewrite |
| Level | Scope | Representative Operators |
|---|---|---|
| Element | Single element | swap, insert, reverse (Perm); flip (Binary); random_reset (Int) |
| Segment | Contiguous segment | or-opt, 3-opt (Perm); seg_flip (Binary); seg_reset (Int) |
| Row | Entire row | row_swap, row_split, row_merge (encoding-agnostic) |
| Crossover | Two solutions | OX crossover (Perm); uniform crossover (Binary/Int) |
| Scale | 3-opt ( ) | or-opt ( ) | LNS | LNS cap |
|---|---|---|---|---|
| Small ( ) | 0.50 | 0.80 | 0.006 | 0.02 |
| Medium ( ) | 0.30 | 0.70 | 0.004 | 0.01 |
| Large ( ) | 0.05 | 0.30 | 0.001 | 0.005 |
| GPU | SMs | Max Shared Mem/Block | Architecture |
|---|---|---|---|
| Tesla T4 | 40 | 64 KB | Turing (sm_75) |
| Tesla V100 | 80 | 96 KB | Volta (sm_70) |
| A800/A100 | 108 | 164 KB | Ampere (sm_80) |
| H20/H100 | 132 | 228 KB | Hopper (sm_90) |
| Component | Specification |
|---|---|
| GPU platforms (cuGenOpt) | |
| Tesla T4 | 40 SMs, 64 KB shared/block, 4 MB L2, 320 GB/s |
| V100-SXM2 | 80 SMs, 96 KB shared/block, 6 MB L2, 900 GB/s |
| V100S-PCIE | 80 SMs, 96 KB shared/block, 6 MB L2, 1134 GB/s |
| A800-SXM4 | 108 SMs, 164 KB shared/block, 40 MB L2, 2039 GB/s |
| CPU platform (baselines) | |
| Instance | cuGenOpt | SCIP | CBC | Winner |
|---|---|---|---|---|
| eil51 ( ) | 0.00% | 69.5% | 31.2% | cuGenOpt |
| ch150 ( ) | 0.34% | 709.9% | infeasible | cuGenOpt |
| A-n32-k5 ( ) | 0.00% | 56.8% | — | cuGenOpt |
| Instance | cuGenOpt | OR-Tools | Winner | |
|---|---|---|---|---|
| eil51 | 51 | 0.00% | 0.00% | Tie |
| kroA100 | 100 | 0.00% | 0.00% | Tie |
| ch150 | 150 | 0.34% | 0.54% | cuGenOpt |
| tsp225 | 225 | 2.30% | 0.61% | OR-Tools |
| lin318 | 318 | 5.16% | 2.85% | OR-Tools |
| pcb442 | 442 | 4.75% | 1.87% | OR-Tools |
| Metric | cuGenOpt | OR-Tools |
|---|---|---|
| Scenario A: Priority constraints | ||
| Priority violations | 0 | 17 |
| Scenario B: Nonlinear cost | ||
| Nonlinear cost | 826.67 | 874.30 |
| Instance | T4 | V100 | A800 | T4 g/s | V100 g/s | A800 g/s | |
|---|---|---|---|---|---|---|---|
| eil51 | 51 | 0.09 | 0.00 | 0.00 | 4,160 | 3,307 | 4,821 |
| kroA100 | 100 | 0.14 | 0.05 | 0.02 | 5,717 | 2,361 | 3,115 |
| ch150 | 150 | 2.02 | 0.78 | 1.14 | 1,698 | 1,613 | 2,135 |
| tsp225 | 225 | 2.82 | 2.82 | 3.50 | 1,781 | 3,102 | 2,344 |
| lin318 | 318 | 3.61 | 3.51 | 6.49 | 996 | 1,470 | 1,149 |
| pcb442 | 442 | 6.15 | 5.29 | 4.73 | 621 | 805 | 1,348 |
| Problem | Solution | Time (s) | Gens/s | |
|---|---|---|---|---|
| TSP | 300 | 8,156.07 | 4.2 | 1,190 |
| TSP | 1000 | 77,691.52 | 15.3 | 327 |
| VRP | 150 | 4,504.37 | 3.8 | 1,316 |
| VRP | 500 | 56,732.55 | 10.1 | 495 |
| VRP | 1000 | 163,426.00 | 18.7 | 267 |
| Problem | 1 GPU | 2 GPUs | Improv. | CUDA Graph | |
|---|---|---|---|---|---|
| TSP | 150 | 4,504.37 | 4,395.03 | +2.43% | Enabled |
| TSP | 300 | 8,156.07 | 8,054.83 | +1.24% | Enabled |
| TSP | 1000 | 77,691.52 | 74,962.60 | +3.51% | Enabled |
| TSP | 1000 | 43,888.89 | 43,600.11 | +0.66% | Disabled |
| VRP | 50 | 4,569.13 | 4,473.00 | +2.10% | Enabled |
| VRP | 500 | 56,732.55 | 55,624.84 | +1.95% | Enabled |
| Config | Vehicles | 1 GPU | 2 GPUs | Improv. |
|---|---|---|---|---|
| Insufficient | 24 | 266,471.97 | 266,471.97 | 0.00% |
| Adequate | 80 | 56,732.55 | 55,624.84 | 1.95% |
| Problem | Encoding | Optimal | cuGenOpt | 5/5 hit |
|---|---|---|---|---|
| TSP5 | Perm | 18 | 18.00 | ✓ |
| Knapsack6 | Binary | 30 | 30.00 | ✓ |
| Assign4 | Perm | 13 | 13.00 | ✓ |
| Schedule3x4 | Binary | 21 | 21.00 | ✓ |
| CVRP10 | Perm-MR | 200 | 200.00 | ✓ |
| LoadBal8 | Integer | 14 | 14.00 | ✓ |
| Instance | Problem | T4 | V100 | A800 | T4 g/s | V100 g/s | A800 g/s |
|---|---|---|---|---|---|---|---|
| nug12 | QAP | 0.00 | 0.00 | 0.00 | 8,197 | 14,285 | 15,121 |
| tai15a | QAP | 0.004 | 0.004 | 0.00 | 6,605 | 12,854 | 13,530 |
| ft06 | JSP | 0.00 | 0.00 | 0.00 | 1,622 | 4,930 | 4,956 |
| ft10 | JSP | 0.84 | 0.84 | 0.47 | 519 | 1,538 | 1,725 |
| knapPI_1 | Knapsack | 0.00 | 0.00 | 0.00 | 2,965 | 6,107 | 11,215 |
| R101 | VRPTW | 2.12 | 2.44 | 2.09 | 2,060 | 2,507 | 2,039 |
| Version | Gap% | Gens/s | Description |
| Baseline | 36.35 | 116 | Random init, per-gen AOS update |
| +Heuristic init + AOS freq | 6.32 | 395 | Bidirectional init, AOS interval |
| +Profile weights | 5.78 | 408 | L1 prior-driven operator presets |
| +Pop. adaptation | 6.15 | 625 | Pop , gens/s +53% |
| Cross-hardware (same code) | |||
| V100 | 5.29 | 805 | Pop=32, L2=6 MB |
| Instance | Before g/s | After g/s | g/s | gap |
|---|---|---|---|---|
| R101 | 1,150 | 2,060 | +79% | 0.29 pp |
| C101 | 1,140 | 1,997 | +75% | 1.53 pp |
| RC101 | 1,133 | 2,047 | +81% | 0.83 pp |
| Instance | Limit | Built-in only | +Custom | Improvement |
|---|---|---|---|---|
| TSP-50 | 1 s | 0.00% | 0.00% | — |
| TSP-100 | 2 s | 0.42% | 0.37% | 12% |
| TSP-150 | 3 s | 1.85% | 1.22% | 34% |
| Weights | Distance | Vehicles | Gap% | Time(s) | Gens |
|---|---|---|---|---|---|
| 784.00 | 5.00 | 0.0% | 0.4 | 1000 |
| Priority | Tolerance | Distance | Vehicles | Gap% |
|---|---|---|---|---|
| 962.00 | 5.00 | 22.7% | ||
| 814.00 | 5.00 | 3.8% | ||
| 1644.00 | 5.00 | 109.7% |
| Mode | Config | Distance | Vehicles | Max Route |
|---|---|---|---|---|
| Weighted | 829.00 | 5.00 | 238.00 | |
| Lexicographic | 881.00 | 5.00 | 259.00 | |
| Lexicographic | 1543.00 | 5.00 | 451.00 |
| Mode | GPU | Distance | Vehicles | Selected |
|---|---|---|---|---|
| Weighted | GPU0 | 796.00 | 5.00 | |
| GPU1 | 784.00 | 5.00 | ✓ | |
| Final | 784.00 | 5.00 | ||
| Lexicographic | GPU0 | 840.00 | 5.00 | ✓ |
| GPU1 | 962.00 | 5.00 | ||
| Final | 840.00 | 5.00 |
| D1 | D2 | Size (KB) | Status | Note |
|---|---|---|---|---|
| 24 | 512 | 48 | Success | — |
| 80 | 128 | 40 | Success | Optimal balance |
| 160 | 128 | 80 | Success | Near limit |
| 32 | 1024 | 128 | Failed | Exceeds limit |
| Problem size | CUDA Graph enabled | CUDA Graph disabled |
|---|---|---|
| Success | Success | |
| Failed (illegal memory) | Success | |
| Failed | Success | |
| Failed | Failed (other issue) |
Metaheuristic Optimization
Metaheuristic optimization develops flexible search strategies for finding strong solutions to difficult problems when exact methods are too costly.
See all 115 papers