Skip to content

Quadratic knapsack problem

A capacity-constrained item-selection optimization with pairwise and optional individual profits.

Version
v2 · 2026-11-14 · History
Domain-specific #
11592
Domain group
Formal Sciences
Origin domain
Operations Research
Subdomain
Combinatorial Optimization → Operations Research
Aliases
QKP

Core Idea

The quadratic knapsack problem chooses items under a capacity limit while maximizing pairwise interaction value, with optional individual-item profits. In its common 0–1 form, each item is included or omitted; the broader name can also cover declared quantity variants. The pair terms are constitutive. If all are zero, the model reduces to ordinary linear knapsack. If capacity disappears, it is not a knapsack problem.

In a worked binary example, items A and C have weights 2 each, individual profits 3 and 2, and joint profit 5; together they fit capacity 4 and yield 10. B has weight 3 and profit 4. This illustrates how an interaction can change the preferred feasible set. QKPLIB publishes larger instances with capacities, weights and quadratic coefficients for solver comparisons, an attested research use rather than a claim of field deployment. The problem is an Optimization subtype: it specifies decisions, objective, constraints and optimality sense. A heuristic's feasible score is not automatically a certified global optimum, and invented pair synergies should not be treated as measured business benefits.

How would you explain it like I'm…

Best Backpack Pairs

You have a backpack that can only hold so much weight, and a pile of toys to choose from. Each toy is fun on its own, but some pairs are extra fun together, like a ball and a bat. The Quadratic Knapsack Problem is figuring out which toys to pack for the most fun without the bag getting too heavy.

Knapsack With Pair Bonuses

In the regular knapsack puzzle, you pick items that fit under a weight limit and add up their values. The Quadratic Knapsack Problem adds a twist: some pairs of items give a bonus (or a change in value) when you take both. So an item that looks weak alone might be worth packing because it pairs well with another. If no pairs ever give bonuses, it turns back into the regular knapsack puzzle, and if there is no weight limit, it is not a knapsack puzzle any more. It is a description of the puzzle, not a method for solving it.

Pairwise-Profit Knapsack Problem

The Quadratic Knapsack Problem is an optimization problem: choose a subset of items whose total weight fits a capacity, maximizing total profit, where profit includes both individual item values and extra values for pairs of chosen items. In the usual 0–1 version each item is either in or out, and a pair's bonus counts only when both are chosen, which makes the objective quadratic in the yes/no variables. If every pair bonus is zero, it reduces to the ordinary knapsack problem; if the capacity limit is removed, it is no longer a knapsack problem at all. For instance, picking A and C with capacity 4 might earn 3 + 2 + 5 = 10 because of their pairwise bonus. It names a problem to be solved, not a particular method for solving it, and researchers test solvers on shared benchmark instances.

 

The Quadratic Knapsack Problem extends capacity-constrained selection by adding pairwise profits. Each item has a weight and an individual profit (positive or zero), and a nonzero pair coefficient contributes to the objective only when both items of the pair are selected. In the 0–1 formulation, with binary x_i, one maximizes Σ p_i x_i + Σ p_ij x_i x_j subject to Σ w_i x_i ≤ capacity; the title also covers declared quantity variants. Zeroing all pair coefficients recovers the ordinary (linear) knapsack problem, while removing the capacity constraint removes the knapsack character. A small worked case: items A and C together fit capacity 4 and earn 3 + 2 + 5 = 10 because their interaction adds 5. Benchmark libraries such as QKPLIB supply published instances for testing solvers, which attests to the model's use but does not show that the instances describe a specific industrial decision or that reported solutions are globally optimal. The abstraction is the typed optimization problem, not a solution algorithm.

Scope of Application

These uses declare variables, pair coefficients, capacity and solution status.

  • Combinatorial optimization. Compare exact or heuristic methods under a common quadratic objective.
  • Benchmark research. Use documented instance sets with disclosed coefficient and capacity data.
  • Project selection models. Represent pair synergies only when their coefficients are defensible.
  • Complexity analysis. Study tractability under declared binary, bounded-copy or coefficient restrictions.

Clarity

Identify item decisions, weights, capacity, optional singleton coefficients and a nonzero pair term. Linear knapsack is the nearest miss because all interaction terms vanish. State whether decisions are 0–1 or another permitted quantity form, and whether the reported score is feasible, heuristic or proved optimal.

Manages Complexity

Pairwise effects couple item decisions: an item's marginal value depends on what else is selected. The quadratic objective compresses these dependencies into coefficients while the capacity still filters feasible sets. That compact formalism can hide estimation uncertainty in real applications and algorithmic difficulty in large instances. Keeping the objective, feasible set and solution guarantee separate prevents a benchmark table from masquerading as a universal decision recipe.

Abstract Reasoning

  1. Specify item decisions and whether each is binary or permits copies.
  2. Write weights and a single capacity condition for feasibility.
  3. Separate singleton profit terms from pairwise interaction coefficients.
  4. Evaluate a candidate set using both parts of the objective.
  5. Distinguish a feasible or heuristic score from a proved optimum.

Knowledge Transfer

The variable–objective–constraint structure transfers directly to prime Optimization. Pair-profit models can be used for projects or items only when joint value can be justified, and a synthetic benchmark cannot certify a field benefit. Dropping pair terms yields ordinary knapsack; dropping capacity yields another quadratic selection problem. These stopping points keep the QKP label mathematically exact.

Relationships to Other Abstractions

Local relationship map for Quadratic knapsack problemParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Quadraticknapsack problemDOMAINPrime abstraction: Optimization — is a kind ofOptimizationPRIME

Current abstraction Quadratic knapsack problem Domain-specific

Parents (1) — outgoing typed relations

  • Quadratic knapsack problem is a kind of Optimization Prime

    QKP maximizes singleton-plus-pair profit over item decisions constrained by capacity.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

Quadratic knapsack problem sits in a crowded region of the domain-specific corpus (37th percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.

Family — Combinatorial Optimization & Game Problems (12 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14