Algorithm::Simplex::Role::Solve - solve() method implemented as Moose role.
use Algorithm::Simplex::Rational; use Data::Dumper; my $matrix = [ [ 5, 2, 30], [ 3, 4, 20], [10, 8, 0], ]; my $tableau = Algorithm::Simplex::Rational->new( tableau => $matrix ); $tableau->solve; print Dumper $tableau_object->display_tableau;
Walk the simplex of feasible solutions by moving to an adjacent vertex one step at a time. Each vertex of the feasible region corresponds to a tableau.
This solve() method assumes we are starting with a feasible solution. This is referred to a phase 2 of the Simplex algorithm, where phase 1 is obtaining a feasible solution so phase 2 can be applied.
Returns 1 if an optimal solution is found, 0 otherwise.
To install Algorithm::Simplex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::Simplex
CPAN shell
perl -MCPAN -e shell install Algorithm::Simplex
For more information on module installation, please visit the detailed CPAN module installation guide.