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

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


Comment on Re^4: knapsack problem solved by regex
Select or Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://828602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2014-08-29 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (286 votes), past polls