in reply to Re^3: knapsack problem solved by regex
in thread knapsack problem solved by regex

Think of the following: a solution to the 0-1 knapsack problem can be easily generalized to the bounded case, you just have to explicitly list the items with nr>1. Think of my previous example as this (just written abbreviated there):
w v v/w 3 3.1 31/30 # case a 2 2 1 # case b (together with the following line) 2 2 1 # case b

Replies are listed 'Best First'.
Re^5: knapsack problem solved by regex
by BrowserUk (Patriarch) on Mar 14, 2010 at 18:34 UTC

    I see. Two different items with the same values and weights. Gotcha.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.