laster.jpg

Genetic algorithm backpack problem solver. Combines multiple objects of various sizes to achieve the optimal fit in a limited space.

Documentation

See the with pod2html generated documentation page here: laster.pod.html

Sample Task

Sample invocation and output data example can be found here: output.txt. Note that normally the debug information is sent to STDERR and result separately to STDOUT (list of best matching files). The both files are merged into one file for brevity purposes in this case.

128,171,968 bytes in 2022 files.
Choose files from set to achieve 50MB best fit.

/usr/bin/* was chosen for input

$ laster.pl --size=50M /usr/bin/*

Output Data

The following list contains output data with optimized initial output solution. Data was generated usin --dumpf option which stores fitness function index for each iteration into specified file. The format of each line is:
iteration_number fitness_index

sample/graphg.jpeg

Following list shows solution convergence with the --nooss option, where no optimized initial solution was generated.

sample/graph.jpeg

Downloads

Download source here. - Syntax highlighted: laster.pl.html - Bare: laster_pl.txt

Recursive version is also available. - Syntax highlighted: lorry.pl.html - Bare: lorry.pl.txt[]

Written for Hybrid and Uncertain Systems, 2006-11-1.