Knapsack Problem - Definition

Definition

The most common problem being solved is the 0-1 knapsack problem, which restricts the number xi of copies of each kind of item to zero or one. The picture above can be interpreted in this way.

Mathematically the 0-1-knapsack problem can be formulated as:

Let there be items, to where has a value and weight . The maximum weight that we can carry in the bag is W. It is common to assume that all values and weights are nonnegative. To simplify the representation, we also assume that the items are listed in increasing order of weight.

  • Maximize subject to

Maximize the sum of the values of the items in the knapsack so that the sum of the weights must be less than the knapsack's capacity.

The bounded knapsack problem removes the restriction that there is only one of each item, but restricts the number of copies of each kind of item to an integer value .

Mathematically the bounded knapsack problem can be formulated as:

  • maximize subject to

The unbounded knapsack problem (UKP) places no upper bound on the number of copies of each kind of item and can be formulated as above except for that the only restriction on is that it is a non-negative integer. If the example with the colored bricks above is viewed as an unbounded knapsack problem, then the solution is to take three yellow boxes and three grey boxes.

Read more about this topic:  Knapsack Problem

Famous quotes containing the word definition:

    ... if, as women, we accept a philosophy of history that asserts that women are by definition assimilated into the male universal, that we can understand our past through a male lens—if we are unaware that women even have a history—we live our lives similarly unanchored, drifting in response to a veering wind of myth and bias.
    Adrienne Rich (b. 1929)

    Was man made stupid to see his own stupidity?
    Is God by definition indifferent, beyond us all?
    Is the eternal truth man’s fighting soul
    Wherein the Beast ravens in its own avidity?
    Richard Eberhart (b. 1904)

    I’m beginning to think that the proper definition of “Man” is “an animal that writes letters.”
    Lewis Carroll [Charles Lutwidge Dodgson] (1832–1898)