Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^4: knapsack problem solved by regex

by rubasov (Friar)
on Mar 14, 2010 at 18:29 UTC ( #828602=note: print w/replies, xml ) Need Help??

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 (Pope) 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://828602]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2018-03-19 03:40 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (232 votes). Check out past polls.