A steady-state genetic algorithm with multi-ratio seeding and pair exchange for the quadratic knapsack problem
Organizations: Department of Information Technology, Indian Institute of Information Technology Allahabad, Prayagraj, 211015, Uttar Pradesh, India · School of Computer and Information Sciences, University of Hyderabad, Hyderabad, 500046, Telangana, India
Abstract
The quadratic knapsack problem (QKP) seeks a subset of items of maximum total linear and pairwise profit whose total weight does not exceed a given capacity. Most QKP heuristics rank items by a profit-to-weight ratio. We show on benchmark instances that this ranking can steer the search away from the best known solutions, and that on an almost full knapsack a local optimum can be separated from a better solution by an exchange where every single swap loses profit. We propose SSGA-P, a steady-state genetic algorithm with pair exchange that addresses both effects. Its initial population contains greedy solutions built with a grid of exponents between 0.5 and 3 applied to the item weights, and its pair exchange move combines an improving swap violating the capacity with a second swap or removal that restores feasibility. Incremental contribution vectors keep the method practical up to 10{,}000 items. SSGA-P finds optimal solutions in every run on the 100 classical instances and reaches all best known values in 99.8% of the runs on the 80 instances with 1000 and 2000 items and in 99.75% on the 40 instances with 5000 and 6000 items, significantly above the 87.7% of the iterated hyperplane exploration algorithm, improving one best known value. On the 144 Large-QKP instances of Hochbaum et al. (2025), with the same 120-second limit, it improves 20 best known values and matches the other 124. An ablation study shows that the multi-ratio seeding and the pair exchange account for most of this performance.
Figures & tables
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Instance | BKV | Best | Average | Hits | IHEA SR | IHEA | GRASP SR | QKBP gap | |
|---|---|---|---|---|---|---|---|---|---|
| 1000_25_1 | 6,172,407 | 6,172,407 | 6,172,407.0 | 30 | 0.62 | 100 | 0.09 | 100 | 0.16 |
| 1000_25_2 | 229,941 | 229,941 | 229,941.0 | 30 | 0.22 | 100 | 0.09 | 66 | 0.00 |
| 1000_25_3 | 172,418 | 172,418 | 172,418.0 | 30 | 0.11 | 100 | 0.05 | 100 | 0.04 |
| 1000_25_4 | 367,426 | 367,426 | 367,426.0 | 30 | 0.14 | 100 | 0.07 | 100 | 0.00 |
| 1000_25_5 | 4,885,611 | 4,885,611 | 4,885,611.0 | 30 | 1.73 | 100 | 0.14 | 100 | 0.15 |
| 1000_25_6 | 15,689 | 15,689 | 15,689.0 | 30 | 0.04 | 100 | 0.02 | 100 | 1.27 |
| Instance | BKV | Best | Average | Hits | IHEA SR | IHEA | QKBP gap | |
|---|---|---|---|---|---|---|---|---|
| 5000_25_1 | 23,667,450 | 23,667,450 | 23,667,450.0 | 30 | 6.16 | 100 | 1.97 | 0.01 |
| 5000_25_2 | 37,914,560 | 37,914,560 | 37,914,560.0 | 30 | 22.51 | 100 | 2.84 | 0.03 |
| 5000_25_3 | 68,295,820 | 68,295,820 | 68,295,820.0 | 30 | 13.87 | 100 | 2.67 | 0.00 |
| 5000_25_4 | 33,866,053 | 33,866,053 | 33,866,053.0 | 30 | 11.37 | 100 | 3.37 | 0.02 |
| 5000_25_5 | 9,533,115 | 9,533,115 | 9,533,105.1 | 27 | 21.50 | 100 | 3.23 | 0.08 |
| 5000_50_1 | 45,194,685 | 45,194,685 | 45,194,685.0 | 30 | 41.93 | 100 | 2.50 | 0.03 |
Combinatorial Optimization
Combinatorial optimization finds the best feasible choices among discrete alternatives in routing, scheduling, graph problems, and resource allocation.
See all 431 papers