Algorithm-Partition

 view release on metacpan or  search on metacpan

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


This module implements an algorithm to see whether a set of integers can
be split into two sets such that the sums of integers in one set is equal
to the sum of integers in the other set.

=head1 FUNCTIONS

=head2 partition(@integers);

Given a list of integers, this function will return two values.  If the
first value is C<undef>, then no solution was found and the second value
is a string explaining why.  Otherwise, two array references are returned
which point to the two resulting sets.

The algorithm is meant for relatively small sets of integers with relatively
small values.  Beware.

=cut

use constant TOP => 1;
use constant LEFT => 2;



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