On 7/12/07, John Randall <[EMAIL PROTECTED]> wrote:
We have weight vector w, a value vector v, and a maximum weight W.  We
want to find a solution vector p which maximizes p dp v subject to W>:p dp
w (where dp is dot product).

In Raul's case, v=w.  I do not see why entries of p are restricted to 0
and 1 for the restaurant problem: you can order several of a single item.

The question asked on that page is "What is the largest value of objects
from a set which will fit in a knapsack."

As you've expressed it, entries of p which are 0 or 1 would determine whether
or not the associated object is in the knapsack, while entries of p with other
values would correspond to different starting set.

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.

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

Reply via email to