TL;DR
Packing a knapsack is tricky enough when items have fixed values, and much harder when pairs of items create bonus value together. Most optimization algorithms tackle this by ranking items via a standard profit-to-weight ratio and making single-item swaps—two intuitive habits that turn out to quietly trap searches in suboptimal dead ends. By varying how weight is penalized during initialization and pairing up swaps to escape tight capacity traps, the authors' remarkably simple genetic algorithm beats complex state-of-the-art heuristics and discovers 21 new best-known solutions on major benchmarks.
What Problem Does This Paper Address?
You probably know the classic 0–1 knapsack problem: pack the most valuable items without breaking your weight budget. Now imagine you are placing satellite stations or building a project team. An item's value isn't isolated; you earn a pairwise bonus only when two synergistic items are packed together. This is the Quadratic Knapsack Problem (QKP).
Because an item's contribution depends on everything else in the bag, exact mathematical solvers hit a wall around 1,500 items. For problems with up to 10,000 items, we rely on heuristics. Almost every existing heuristic shares two DNA traits: they rank candidate items by their current profit-per-unit-weight ($c_j / w_j$), and they improve solutions by adding, dropping, or swapping one item at a time.
The authors systematically investigated why standard algorithms stall on large QKP instances and diagnosed two fundamental blind spots:
- Ratio Bias: Dividing strictly by weight ($w_j^1$) locks the search into a specific mix of heavy and light items, sometimes steering it away from basins containing the true optimum.
- Budget-Tight Local Optima: When a knapsack is completely full, you can get stuck in a state where every valid 1-for-1 swap loses profit, while a profitable swap is just one weight unit too heavy to fit.
Methods
The authors embed two targeted fixes inside a clean, standard Steady-State Genetic Algorithm (where only the worst solution in a population of 100 is replaced per generation, keeping all candidates strictly feasible):
- Multi-Ratio Seeding (New): Instead of building initial greedy solutions using $c_j / w_j$, the algorithm seeds its starting population across a grid of 51 weight exponents: $c_j / w_j^\beta$ for $\beta \in [0.5, 3.0]$. Small $\beta$ values favor heavy, high-value items; large $\beta$ values favor light items.
- Pair Exchange (New): To escape budget-tight traps, the algorithm couples two moves: an improving but infeasible swap (lacking $e$ units of capacity) with a capacity-releasing swap or drop (freeing $f \in [e, e+3]$ units) that may slightly lose profit on its own, yielding a net gain together. To prevent combinatorial explosion, moves are bucketed by exact weight change, keeping only the top 64 candidates per class.
- Fast Incremental Updates (Engineering): Storing an item's current contribution vector allows $O(1)$ move evaluations. Updating it by reading contiguous matrix rows in C speeds up generations by ~4x on large instances.
Datasets
No new benchmarks were created; instead, SSGA-P was evaluated across 364 public benchmark instances spanning four established collections:
- Group I: 100 classical small instances (100–300 items) with known exact optima.
- Group II: 80 medium instances (1,000 and 2,000 items).
- Group III: 40 large instances (5,000 and 6,000 items).
- Large-QKP: A 2025 benchmark of 144 instances (500 to 10,000 items) across varying graph densities (5%–100%) and six tight-to-loose capacity budgets.
Key Insights and Ideas
- There is no "magic" weight exponent: Plotting greedy solution quality against $\beta$ produces jagged, non-monotone curves. On one 1,000-item problem, $\beta=1$ misses the best value, while any $\beta \in [2.35, 2.80]$ nails the exact best-known solution immediately—without any local search!
- Borrowing a single unit of capacity unlocks stalled searches: On a 5,000-item instance, the authors caught a local optimum 260 points below the best-known value. Three 1-for-1 swaps separated them: two lost profit (-1,782 and -19), and the profitable one was 1 unit overweight. Pairing the overweight swap with a capacity-freeing swap immediately gained +223 profit.
- Simplicity rivals algorithmic complexity: Leading competitors like IHEA rely on intricate tabu memories and hyperplane constraints. Ablation tests prove SSGA-P's power comes almost entirely from multi-ratio seeding and pair exchange; without seeding, Group II hit rates drop from 99.8% to 88.4%.
Key Results
- Groups I & II: Reached exact optima on 100% of runs (3,000/3,000) in Group I, and matched best-known values (BKVs) in 99.8% of runs on Group II.
- Group III (5,000–6,000 items): Achieved a 99.75% hit rate across 1,200 runs, decisively beating the reigning champion metaheuristic IHEA (87.7%) in less time, while discovering 1 new BKV (improving
6000_75_1by +15,951). - Large-QKP (up to 10,000 items): Under an identical 120-second limit against eight competing methods (including Gurobi, IHEA, and parametric-cut heuristic QKBP), SSGA-P was never worse—matching the best reference on 124 instances and setting 20 new BKVs.
- Speed vs. Quality: The deterministic QKBP method remains 2x–10x faster for a quick, slightly rougher answer, whereas SSGA-P dominates when given seconds or minutes to polish solution quality.
Limitations and Future Work
- Limitations: SSGA-P is slower than one-pass parametric cut methods (QKBP) and must solve each capacity budget from scratch. On the massive 10,000-item graphs with 50%–75% capacity, generations slow down to 0.2s, making 120 seconds too brief for reliable convergence (requiring 600s to hit 100% reliability). Also, two auxiliary operators (perturbation kicks and evict-and-insert) proved largely redundant on the biggest instances.
- Future Work: The authors suggest adapting $\beta$ dynamically during search, extending pair exchanges into longer ejection chains, seeding SSGA-P with ultra-fast QKBP solutions, and porting multi-ratio seeding into other capacity-constrained problems like sensor placement and facility location.
Summary updated