Papers
Topics
Authors
Recent
Search
2000 character limit reached

Quadratic Knapsack Problem (QKP)

Updated 12 November 2025
  • The Quadratic Knapsack Problem (QKP) is a combinatorial optimization problem that generalizes the classical knapsack by integrating quadratic (pairwise) interactions among items.
  • Advanced solution techniques, including semidefinite programming, parametric convex quadratic programming, and heuristic methods, yield small optimality gaps and efficient runtimes.
  • QKP has practical applications in portfolio selection, project planning, social network analysis, and even PDE-constrained optimization in scientific computing.

The Quadratic Knapsack Problem (QKP) is a fundamental combinatorial optimization problem that generalizes the classical knapsack problem by incorporating quadratic (pairwise) terms in the objective. It serves as a prototypical testbed for advanced discrete optimization methodologies and holds significance in both theoretical algorithm research and practical applications involving portfolio selection, project planning, and social network analysis.

1. Mathematical Formulation and Problem Variants

The standard QKP is defined as follows. Given nn items with profit parameters {pi}i=1n\{p_i\}_{i=1}^n (linear, or singleton) and {pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n} (pairwise, or quadratic), weights wi>0w_i>0, and a knapsack capacity WW, the goal is

maximizeH(x)=∑i=1npixi+∑1≤i<j≤npijxixj subject to∑i=1nwixi≤W xi∈{0,1}∀i.\begin{aligned} \text{maximize} \quad & H(x) = \sum_{i=1}^n p_i x_i + \sum_{1\leq i<j\leq n} p_{ij} x_i x_j \ \text{subject to} \quad & \sum_{i=1}^n w_i x_i \leq W \ & x_i \in \{0,1\} \quad \forall i. \end{aligned}

Variants of QKP considered in the literature include:

  • The kk-item QKP (kQKP), adding a cardinality constraint ∑xi=k\sum x_i = k (Létocart et al., 2016).
  • The continuous or relaxed versions, allowing xi∈[0,1]x_i \in [0,1] or higher-order weights (for bounding or pre-processing).
  • QKP with negative or indefinite pijp_{ij}, leading to NP-hardness and inapproximability in general (Taylor, 2015).

Beyond the standard form, applications may introduce multiple knapsack constraints, side constraints, or context-specific quadratic terms, e.g., for mesh diffusion or group assignment.

2. Exact Algorithms and Relaxations

The combinatorial complexity of QKP drives research into exact algorithms and tight relaxations:

Semidefinite Programming and Polyhedral Methods

  • The current dominant exact approach for moderate {pi}i=1n\{p_i\}_{i=1}^n0 is semidefinite relaxation (SDP), which lifts {pi}i=1n\{p_i\}_{i=1}^n1 to a full matrix variable with positive semidefiniteness and linear constraints (Létocart et al., 2016, Tang et al., 2023).
  • The standard relaxation writes {pi}i=1n\{p_i\}_{i=1}^n2 subject to {pi}i=1n\{p_i\}_{i=1}^n3, {pi}i=1n\{p_i\}_{i=1}^n4, {pi}i=1n\{p_i\}_{i=1}^n5.
  • In kQKP, the SDP is strengthened with rank-1 and triangle (metric) inequalities, yielding a relaxation with gaps as small as 7.4% at the root node and significant pruning in branch-and-bound (Létocart et al., 2016).
  • Recent advances in Burer–Monteiro factorization exploit the geometry of the feasible set to enable manifold optimization, even for {pi}i=1n\{p_i\}_{i=1}^n6, under weak rank requirements derived from graph minimum rank invariants. This framework ensures global optimality of second-order stationary points for generic data (Tang et al., 2023).

Parametric Convex Quadratic Programming

  • Parametric convex quadratic programming constructs a family of relaxations by optimally perturbing the nonconvex quadratic objective into a concave part (retained) and a linearized remainder, then jointly optimizing the perturbation and the primal variables (Fampa et al., 2019). Unlike SDPs, these relaxations admit efficient primal-dual interior point implementation and can be further tightened by lifted cover and knapsack inequalities.

Solvers and Practical Considerations

  • Interior-point methods for SDPs with rank-1 data matrices achieve {pi}i=1n\{p_i\}_{i=1}^n7 per iteration, while bundle methods dynamically incorporate only those polyhedral inequalities most violated, controlling computational load (Létocart et al., 2016).
  • Riemannian gradient-based solvers for Burer–Monteiro relaxations maintain feasibility efficiently, using Newton or quasi-Newton retractions, with {pi}i=1n\{p_i\}_{i=1}^n8 per iteration for rank {pi}i=1n\{p_i\}_{i=1}^n9 (Tang et al., 2023).

3. Heuristic, Approximation, and Large-Scale Methods

Given strong NP-hardness, several heuristics, approximation algorithms, and specialized methods complement exact solvers for large {pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n}0 or real-time applications:

Heuristic and Metaheuristic Methods

  • Breakpoints heuristic algorithms (QKBP) construct the full set of optimal solutions for "breakpoint" budgets via parametric min-cut on an associated flow network. For budgets between breakpoints, a local greedy insertion/deletion efficiently recovers near-optimal solutions (Hochbaum et al., 2024).
  • Classical heuristics include greedy-addition and exchange, local search, simulated annealing (SA), GRASP, and evolutionary or tabu-search methods, often achieving sub-1% optimality gaps in practical settings (Ohno et al., 2024).
  • Two-stage post-processing (repair–improvement) pipelines, applied to raw solutions from fast Ising or annealing-based machines, guarantee both feasibility and optimality comparable to leading classical heuristics with minimal overhead (Ohno et al., 2024).

Approximation Theory

  • QKP admits a polynomial-time {pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n}1-approximation in the nonnegative case (Taylor, 2015). This is achieved by reducing to a logarithmic number of knapsack and densest {pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n}2-subgraph subproblems, using rounding, bucketing, and averaging over sub-instances.
  • For arbitrary profit signs, constant-factor approximation is believed impossible unless P=NP, due to reduction from the CLIQUE problem.

Specialized Algorithms

  • Quantum search methods (e.g., Quantum Tree Generator, QTG) construct a superposition over all feasible {pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n}3, with amplitude amplification yielding high-quality solutions. Empirically, QTG offers {pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n}4–{pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n}5 speedup over Gurobi for attaining 2–5% optimality gaps on {pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n}6–{pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n}7 instances, under favorable assumptions on quantum hardware (Wilkening et al., 28 Mar 2025).

4. Ising Machine and Quantum Annealer Implementations

The QKP is a challenging benchmark for Ising machines and related quantum hardware due to the need to encode an inequality constraint:

QUBO and Ising Mappings

  • The standard QUBO encoding induces a quadratic penalty {pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n}8, where a slack variable {pij}1≤i<j≤n\{p_{ij}\}_{1\leq i<j\leq n}9 is introduced and can be binary-encoded, unary, or one-hot, among other schemes (Ohno et al., 2024).
  • Conversion to Ising spin variables wi>0w_i>00 leads to pairwise and linear coupling fields whose explicit form is given by direct term expansion.
  • The extended Ising Machine (EIM) further bypasses auxiliary slack binaries by maintaining a real-valued dependent variable wi>0w_i>01, penalized via a ReLU-type function wi>0w_i>02. This leads to smoother optimization trajectories, improved feasibility, and reduced variable counts at moderate wi>0w_i>03 (Akishima et al., 9 Aug 2025).
  • Both conventional and extended Ising approaches can leverage simulated or digital annealing, replica-exchange, and advanced MCMC sampling strategies. Choice of penalty weight wi>0w_i>04 is crucial, typically tuned by scaling with instance density and constraint tightness.

Postprocessing and Encoding Robustness

  • Without postprocessing, different constraint encodings yield dramatically different feasible rates and solution quality. However, applying two-stage repair/improvement postprocessing "erases" encoding differences, leading all methods to converge to gaps wi>0w_i>050.01% on moderate size (wi>0w_i>06) (Ohno et al., 2024).
  • For large wi>0w_i>07, two-stage postprocessing combined with digital annealing is competitive with state-of-the-art heuristics and exact methods (Ohno et al., 2024).
  • Penalty and encoding parameter recommendations are provided as practical guidelines, with minor-embedding and topology overheads deferred to future research.

5. Applications in PDE-Constrained Optimization and Scientific Computing

QKP-based solvers arise in continuous optimization when enforcing positivity or entropy constraints in discretized PDEs:

  • In discontinuous Galerkin spectral element methods, enforcing a cell entropy inequality can be cast as a continuous QKP: wi>0w_i>08 s.t. wi>0w_i>09, WW0 (Christner et al., 19 Jul 2025).
  • This convex QKP admits a reduction to scalar root-finding for a clipped linear function, enabling solution in WW1 arithmetic operations with quasi-Newton updates. Compared to the linear knapsack analog (which requires a greedy fill), the quadratic version yields greater temporal and spatial regularity and guarantees uniqueness.
  • Numerical benchmarks indicate that QKP-limited schemes achieve second-order time convergence, improved step counts in shock regimes, and robust enforcement of bounds, outperforming linear-knapsack-limited schemes (Christner et al., 19 Jul 2025).

6. Further Algorithmic Enhancements and Valid Inequalities

Progress toward closing the relaxation–integrality gap and accelerating convergence centers around:

  • Parametric convex QP relaxations optimized over the perturbation matrix, alternating with rounds of newly derived valid inequalities in lifted matrix space. Cutting planes derived from classical cover and knapsack inequalities can be lifted to enforce tighter bounds, separated via mixed-integer programming subproblems (Fampa et al., 2019).
  • Alternating rounds of parametric perturbation and cut generation yield primal gaps WW2 and dual gaps WW3 for random instances with WW4, outperforming LP and standard SDP bounds (Fampa et al., 2019).
  • For combinatorial variants (multiple constraints, multi-dimensional QKP), further research is required to develop multidimensional root-finding and extend the efficacy of continuous relaxations.

7. Open Problems and Research Directions

Current frontiers in QKP research and application include:

  • Establishing constant-factor approximation bounds or hardness results in the most general setting.
  • Scaling Ising and quantum solvers to WW5 and incorporating more complex constraint sets.
  • Automating penalty parameter selection for annealing and QUBO formulations.
  • Exploring multidimensional and multi-objective QKP, including robust and stochastic variants.
  • Bridging the gap between continuous relaxations and integer program solvers, especially in applications with large WW6 and sparse or structured WW7.

Ongoing research suggests that no single approach dominates across all QKP regimes. SDP and lifted relaxations remain the tool of choice for moderate WW8 with demands for global optimality. Heuristic, Ising, and quantum methods provide state-of-the-art performance for large-scale and time-sensitive applications, provided care is taken with penalty parameters and postprocessing. The QKP continues to serve both as a modeling framework and as a benchmark for the development and evaluation of advanced optimization algorithms.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Quadratic Knapsack Problem (QKP).