Raul Miller wrote:

> But if the weight of B is less than W, then every object in the problem
> set can be placed in the knapsack and the problem can be solved
> trivially.

The optimal solution can have a higher weight than B: you are not taking
into account the values.

Suppose n=3, w1=1, w2=2, w3=3, W=8.  Then the weight of B is 6.  However,
W can be achieved with (for example) v1=2, v2=0, v3=2.

Best wishes,

john

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to