Raul Miller wrote:

>
> For example, let's say that we have a knapsack which can hold eight
> pounds, and we have a collection of five small statues, each weighing
> four pounds.  These statues are worth 590 150 160 730 522 dollars.
> If p=0 0 0 2 0 that means that we somehow have obtained a second
> statue worth 730 dollars and that we really had at least six statues
> in our collection.
>
I agree that the page we are talking about only solves the 0/1 problem: I
should have read it more carefully.

For the restaurant problem you can have a starting set which contains
several copies of the same appetizer, with the number of copies limited by
the amount of money you have, and so can apply.  I am not sure how this
affects the complexity.

My main point in all of this was to indicate that there is a dynamic
programming algorithm for this type of problem, and that this can be used
to calculate the complexity (if you do it correctly).  There may well be
an easier and faster way to do it for small examples.


Best wishes,

John

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

Reply via email to