Skip to main content

Knapsack

  • Living reference work entry
  • First Online:
Encyclopedia of Algorithms

Years and Authors of Summarized Original Work

2000; Ibarra, Kim

Problem Definition

For a given set of items N = {1, …, n} with nonnegative integer weights w j and profits p j , j = 1, …, n, and a knapsack of capacity c, the knapsack problem (KP) is to select a subset of the items such that the total profit of the selected items is maximized and the corresponding total weight does not exceed the knapsack capacity c.

Alternatively, a knapsack problem can be formulated as a solution of the following linear integer programming formulation:

$$\displaystyle{ \begin{array}{*{20}c} \left (KP\right )&\text{maximize}\sum \limits _{j=1}^{n}p_{i}x_{j}\\ \end{array} }$$
(1)
$$\displaystyle{ \text{subject to}\,\sum \limits _{j=1}^{n}w_{ j}x_{j} \leq c, }$$
(2)
$$\displaystyle{ x_{j} \in \left (0,1\right ),\;j = 1,\ldots,n. }$$
(3)

The knapsack problem is the simplest nontrivial integer programming model having binary variables, only a single constraint, and only positive coefficients. A large...

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Recommended Reading

  1. Ibarra OH, Kim CE (1975) Fast approximation algorithms for the knapsack and sum of subset problem. J ACM 22:463–468

    Article  MATH  MathSciNet  Google Scholar 

  2. Kellerer H, Pferschy U (1999) A new fully polynomial time approximation scheme for the knapsack problem. J Comb Optim 3:59–71

    Article  MATH  MathSciNet  Google Scholar 

  3. Kellerer H, Pferschy U (2004) Improved dynamic programming in connection with an FPTAS for the knapsack problem. J Comb Optim 8:5–11

    Article  MATH  MathSciNet  Google Scholar 

  4. Kellerer H, Pisinger D, Pferschy U (2004) Knapsack problems. Springer, Berlin

    Book  MATH  Google Scholar 

  5. Lawler EL (1979) Fast approximation algorithms for knapsack problems. Math Oper Res 4:339–356

    Article  MATH  MathSciNet  Google Scholar 

  6. Magazine MJ, Oguz O (1981) A fully polynomial approximation algorithm for the 0-1 knapsack problem. Eur J Oper Res 8:270–273

    Article  MATH  MathSciNet  Google Scholar 

  7. Martello S, Toth P (1990) Knapsack problems: algorithms and computer implementations. Wiley, Chichester

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Etsuji Tomita .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer Science+Business Media New York

About this entry

Cite this entry

Tomita, E. (2014). Knapsack. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, Boston, MA. https://doi.org/10.1007/978-3-642-27848-8_192-2

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-27848-8_192-2

  • Received:

  • Accepted:

  • Published:

  • Publisher Name: Springer, Boston, MA

  • Online ISBN: 978-3-642-27848-8

  • eBook Packages: Springer Reference Computer SciencesReference Module Computer Science and Engineering

Publish with us

Policies and ethics