Re: Reducing the Knapsack Problem to the Bin Packing Problem



Hmm...the only problem I see is that I can't check if the worth of the
O' objects is exactly W using g. I could modify g so that it outputs
-1 if there is at least one bin that is not completely filled, 1 if
all the bins are completely filled and 0 otherwise.

I think the better solution would be to define w' as w'(o) = w(o) / (W
- 1) so that if if g(O', 1, w') = 0, then the set O' of objects have a
worth that is greater than W - 1 or greater than or equal to W.

.