go ahead... be a heretic | |
PerlMonks |
Re: Burning SOs to maximize DVD space (knapsack problem)by grinder (Bishop) |
on Jan 10, 2005 at 09:27 UTC ( [id://420855]=note: print w/replies, xml ) | Need Help?? |
Is there a better way? This problem goes by various names, such as the knapsack problem, or the bin packing problem. It is a hard computer science problem. Most solutions involve using heuristics to achieve reasonable results. To obtain perfect results requires a brute-force exhaustive search through the problem space. A perl module that solves the problem using simple rules of thumb is Algorithm::Bucketizer. Later: a discussion of the different strategies that one can employ is shown here. The program is written in Icon, a most enjoyable language (although I haven't used it in many years). - another intruder with the mooring in the heart of the Perl
In Section
Seekers of Perl Wisdom
|
|