Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

List of knapsack problems

From Wikipedia, the free encyclopedia

Theknapsack problem is one of the most studied problems incombinatorial optimization, with many real-life applications. For this reason, many special cases and generalizations have been examined.[1][2]

Common to all versions are a set ofn items, with each item1jn{\displaystyle 1\leq j\leq n} having an associated profitpj and weightwj. The binary decision variablexj is used to select the item. The objective is to pick some of the items, with maximal total profit, while obeying that the maximum total weight of the chosen items must not exceedW. Generally, these coefficients are scaled to become integers, and they are almost always assumed to be positive.

Theknapsack problem in its most basic form:

maximizej=1npjxj{\displaystyle \sum _{j=1}^{n}p_{j}x_{j}}
subject toj=1nwjxjW,{\displaystyle \sum _{j=1}^{n}w_{j}x_{j}\leq W,}
xj{0,1}{\displaystyle x_{j}\in \{0,1\}}j{1,,n}{\displaystyle \forall j\in \{1,\ldots ,n\}}

Direct generalizations

[edit]

One common variant is that each item can be chosen multiple times. Thebounded knapsack problem specifies, for each itemj, an upper bounduj (which may be a positive integer, or infinity) on the number of times itemj can be selected:

maximizej=1npjxj{\displaystyle \sum _{j=1}^{n}p_{j}x_{j}}
subject toj=1nwjxjW,{\displaystyle \sum _{j=1}^{n}w_{j}x_{j}\leq W,}
0xjuj,xj{\displaystyle 0\leq x_{j}\leq u_{j},x_{j}} integral for allj

Theunbounded knapsack problem (sometimes called theinteger knapsack problem) does not put any upper bounds on the number of times an item may be selected:

maximizej=1npjxj{\displaystyle \sum _{j=1}^{n}p_{j}x_{j}}
subject toj=1nwjxjW,{\displaystyle \sum _{j=1}^{n}w_{j}x_{j}\leq W,}
xj0,xj{\displaystyle x_{j}\geq 0,x_{j}} integral for allj

The unbounded variant was shown to beNP-complete in 1975 by Lueker.[3] Both the bounded and unbounded variants admit anFPTAS (essentially the same as the one used in the 0-1 knapsack problem).

If the items are subdivided intok classes denotedNi{\displaystyle N_{i}}, and exactly one item must be taken from each class, we get themultiple-choice knapsack problem:

maximizei=1kjNipijxij{\displaystyle \sum _{i=1}^{k}\sum _{j\in N_{i}}p_{ij}x_{ij}}
subject toi=1kjNiwijxijW,{\displaystyle \sum _{i=1}^{k}\sum _{j\in N_{i}}w_{ij}x_{ij}\leq W,}
jNixij=1,{\displaystyle \sum _{j\in N_{i}}x_{ij}=1,}for all1ik{\displaystyle 1\leq i\leq k}
xij{0,1}{\displaystyle x_{ij}\in \{0,1\}}for all1ik{\displaystyle 1\leq i\leq k} and alljNi{\displaystyle j\in N_{i}}

If for each item the profit and weight are equal, we get thesubset sum problem (often the correspondingdecision problem is given instead):

maximizej=1npjxj{\displaystyle \sum _{j=1}^{n}p_{j}x_{j}}
subject toj=1npjxjW,{\displaystyle \sum _{j=1}^{n}p_{j}x_{j}\leq W,}
xj{0,1}{\displaystyle x_{j}\in \{0,1\}}

If we haven items andm knapsacks with capacitiesWi{\displaystyle W_{i}}, we get themultiple knapsack problem:

maximizei=1mj=1npjxij{\displaystyle \sum _{i=1}^{m}\sum _{j=1}^{n}p_{j}x_{ij}}
subject toj=1nwjxijWi,{\displaystyle \sum _{j=1}^{n}w_{j}x_{ij}\leq W_{i},}for all1im{\displaystyle 1\leq i\leq m}
i=1mxij1,{\displaystyle \sum _{i=1}^{m}x_{ij}\leq 1,}for all1jn{\displaystyle 1\leq j\leq n}
xij{0,1}{\displaystyle x_{ij}\in \{0,1\}}for all1jn{\displaystyle 1\leq j\leq n} and all1im{\displaystyle 1\leq i\leq m}

As a special case of the multiple knapsack problem, when the profits are equal to weights and all bins have the same capacity, we can havemultiple subset sum problem.

Quadratic knapsack problem:

maximizej=1npjxj+i=1n1j=i+1npijxixj{\displaystyle \sum _{j=1}^{n}p_{j}x_{j}+\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}p_{ij}x_{i}x_{j}}
subject toj=1nwjxjW,{\displaystyle \sum _{j=1}^{n}w_{j}x_{j}\leq W,}
xj{0,1}{\displaystyle x_{j}\in \{0,1\}}for all1jn{\displaystyle 1\leq j\leq n}

Set-Union Knapsack Problem:

SUKP is defined by Kellerer et al[2] (on page 423) as follows:

Given a set ofn{\displaystyle n} itemsN={1,,n}{\displaystyle N=\{1,\ldots ,n\}} and a set ofm{\displaystyle m} so-called elementsP={1,,m}{\displaystyle P=\{1,\ldots ,m\}}, each itemj{\displaystyle j} corresponds to a subsetPj{\displaystyle P_{j}} of the element setP{\displaystyle P}. The itemsj{\displaystyle j} have non-negative profitspj{\displaystyle p_{j}},j=1,,n{\displaystyle j=1,\ldots ,n}, and the elementsi{\displaystyle i} have non-negative weightswi{\displaystyle w_{i}},i=1,,m{\displaystyle i=1,\ldots ,m}. The total weight of a set of items is given by the total weight of the elements of the union of the corresponding element sets. The objective is to find a subset of the items with total weight not exceeding the knapsack capacity and maximal profit.

Multiple constraints

[edit]

If there is more than one constraint (for example, both a volume limit and a weight limit, where the volume and weight of each item are not related), we get themultiple-constrained knapsack problem,multidimensional knapsack problem, orm-dimensional knapsack problem. (Note, "dimension" here does not refer to the shape of any items.) This has 0-1, bounded, and unbounded variants; the unbounded one is shown below.

maximizej=1npjxj{\displaystyle \sum _{j=1}^{n}p_{j}x_{j}}
subject toj=1nwijxjWi,{\displaystyle \sum _{j=1}^{n}w_{ij}x_{j}\leq W_{i},}for all1im{\displaystyle 1\leq i\leq m}
xj0{\displaystyle x_{j}\geq 0},xj{\displaystyle x_{j}} integerfor all1jn{\displaystyle 1\leq j\leq n}

The 0-1 variant (for any fixedm2{\displaystyle m\geq 2}) was shown to beNP-complete around 1980 and more strongly, has no FPTAS unless P=NP.[4][5]

The bounded and unbounded variants (for any fixedm2{\displaystyle m\geq 2}) also exhibit the same hardness.[6]

For any fixedm2{\displaystyle m\geq 2}, these problems do admit apseudo-polynomial time algorithm (similar to the one for basic knapsack) and aPTAS.[2]

Knapsack-like problems

[edit]

If all the profits are 1, we will try to maximize the number of items which would not exceed the knapsack capacity:

maximizej=1nxj{\displaystyle \sum _{j=1}^{n}x_{j}}
subject toj=1nwjxjW,{\displaystyle \sum _{j=1}^{n}w_{j}x_{j}\leq W,}
xj{0,1},{\displaystyle x_{j}\in \{0,1\},}j{1,,n}{\displaystyle \forall j\in \{1,\ldots ,n\}}

If we have a number of containers (of the same size), and we wish to pack alln items in as few containers as possible, we get thebin packing problem, which is modelled by having indicator variablesyi=1{\displaystyle y_{i}=1\Leftrightarrow } containeri is being used:

minimizei=1nyi{\displaystyle \sum _{i=1}^{n}y_{i}}
subject toj=1nwjxijWyi,{\displaystyle \sum _{j=1}^{n}w_{j}x_{ij}\leq Wy_{i},}i{1,,n}{\displaystyle \forall i\in \{1,\ldots ,n\}}
i=1nxij=1{\displaystyle \sum _{i=1}^{n}x_{ij}=1}j{1,,n}{\displaystyle \forall j\in \{1,\ldots ,n\}}
yi{0,1}{\displaystyle y_{i}\in \{0,1\}}i{1,,n}{\displaystyle \forall i\in \{1,\ldots ,n\}}
xij{0,1}{\displaystyle x_{ij}\in \{0,1\}}i{1,,n}j{1,,n}{\displaystyle \forall i\in \{1,\ldots ,n\}\wedge \forall j\in \{1,\ldots ,n\}}

Thecutting stock problem is identical to thebin packing problem, but since practical instances usually have far fewer types of items, another formulation is often used. Itemj is neededBj times, each "pattern" of items which fit into a single knapsack have a variable,xi (there arem patterns), and patterni uses itemjbij times:

minimizei=1mxi{\displaystyle \sum _{i=1}^{m}x_{i}}
subject toi=1mbijxiBj,{\displaystyle \sum _{i=1}^{m}b_{ij}x_{i}\geq B_{j},}for all1jn{\displaystyle 1\leq j\leq n}
xi{0,1,,n}{\displaystyle x_{i}\in \{0,1,\ldots ,n\}}for all1im{\displaystyle 1\leq i\leq m}

If, to the multiple choice knapsack problem, we add the constraint that each subset is of sizen and remove the restriction on total weight, we get theassignment problem, which is also the problem of finding a maximalbipartite matching:

maximizei=1kj=1npijxij{\displaystyle \sum _{i=1}^{k}\sum _{j=1}^{n}p_{ij}x_{ij}}
subject toi=1nxij=1,{\displaystyle \sum _{i=1}^{n}x_{ij}=1,}for all1jn{\displaystyle 1\leq j\leq n}
j=1nxij=1,{\displaystyle \sum _{j=1}^{n}x_{ij}=1,}for all1in{\displaystyle 1\leq i\leq n}
xij{0,1}{\displaystyle x_{ij}\in \{0,1\}}for all1ik{\displaystyle 1\leq i\leq k} and alljNi{\displaystyle j\in N_{i}}

In theMaximum Density Knapsack variant there is an initial weightw0{\displaystyle w_{0}}, and we maximize the density of selected items which do not violate the capacity constraint:[7]

maximizej=1nxjpjw0+j=1nxjwj{\displaystyle {\frac {\sum _{j=1}^{n}x_{j}p_{j}}{w_{0}+\sum _{j=1}^{n}x_{j}w_{j}}}}
subject toj=1nwjxjW,{\displaystyle \sum _{j=1}^{n}w_{j}x_{j}\leq W,}
xj{0,1},{\displaystyle x_{j}\in \{0,1\},}j{1,,n}{\displaystyle \forall j\in \{1,\ldots ,n\}}

Although less common than those above, several other knapsack-like problems exist, including:

  • Nested knapsack problem
  • Collapsing knapsack problem
  • Nonlinear knapsack problem
  • Inverse-parametric knapsack problem

The last three of these are discussed in Kellerer et al's reference work,Knapsack Problems.[2]

References

[edit]
  1. ^Martello, Silvano andToth, Paolo (1990).Knapsack Problems: Algorithms and Computer Implementations.John Wiley & Sons.ISBN 978-0471924203.{{cite book}}: CS1 maint: multiple names: authors list (link)
  2. ^abcdKellerer, Hans and Pferschy, Ulrich and Pisinger, David (2004).Knapsack Problems.Springer Verlag.ISBN 978-3-540-40286-2.{{cite book}}: CS1 maint: multiple names: authors list (link)
  3. ^Lueker, G.S. (1975).Two NP-complete problems in nonnegative integer programming. Report No. 178, Computer Science Laboratory, Princeton.
  4. ^Gens, G. V.; Levner, E. V. (1979). "Complexity and Approximation Algorithms for Combinatorial Problems: A Survey". Central Economic and Mathematical Institute, Academy of Sciences of the USSR, Moscow.
  5. ^"On the Existence of Fast Approximation Schemes".Nonlinear Programming.4:415–437. 1980.
  6. ^Magazine, Michael J.; Chern, Maw-Sheng (1984). "A Note on Approximation Schemes for Multidimensional Knapsack Problems".Mathematics of Operations Research.9 (2):244–247.doi:10.1287/moor.9.2.244.
  7. ^Cohen, Reuven; Katzir, Liran (2008). "The Generalized Maximum Coverage Problem".Information Processing Letters.108:15–22.CiteSeerX 10.1.1.156.2073.doi:10.1016/j.ipl.2008.03.017.
Retrieved from "https://en.wikipedia.org/w/index.php?title=List_of_knapsack_problems&oldid=1205447760"
Category:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp