Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

knapsack problem solved by regex

by rubasov (Friar)
on Mar 14, 2010 at 14:42 UTC ( #828578=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    print join "\n", grep { length $+{$_} } keys %+; print "\n";
    
    __END__
    
  2. or download this
    # a partition problem as a special case
    my $max_weight = 136;
    ...
      i => { w => 42, v => 42 },
      j => { w => 49, v => 49 },
    );
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://828578]
Approved by Corion
Front-paged by almut
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (13)
As of 2015-07-29 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls