Algorithm-Knap01DP

 view release on metacpan or  search on metacpan

lib/Algorithm/Knap01DP.pm  view on Meta::CPAN

    2
    2
    11
    11
    3
    3
    8
    8
    
This corresponds to a problem with N=6, M=30 (objects, capacity)
then the following consecutive pair of lines hold the weight and
profit (in that order) of the different objects.
A program illustrating the use of the module follows:

    $ cat -n example.pl
    1  use strict;
    2  use Algorithm::Knap01DP;
    3
    4  die "Usage:\n$0 knapsackfile\n" unless @ARGV;
    5  my $knap = Algorithm::Knap01DP->ReadKnap($ARGV[0]);
    6  $knap->solutions();



( run in 0.659 second using v1.01-cache-2.11-cpan-39bf76dae61 )