Algorithm-Simplex
view release on metacpan or search on metacpan
lib/Algorithm/Simplex.pm view on Meta::CPAN
=head2 determine_bland_pivot_row_number
Find the pivot row using Bland ordering technique to prevent cycles.
=cut
sub determine_bland_pivot_row_number {
my ($self, $positive_ratios, $positive_ratio_row_numbers) = @_;
# Now that we have the ratios and their respective rows we can find the min
# and then select the lowest bland min if there are ties.
my @min_indices = $self->min_index($positive_ratios);
my @min_ratio_row_numbers =
map { $positive_ratio_row_numbers->[$_] } @min_indices;
my @bland_number_for_min_ratio_rows;
foreach my $row_number (@min_ratio_row_numbers) {
push @bland_number_for_min_ratio_rows,
$self->get_bland_number_for('y', $row_number);
}
# Pass blands number to routine that returns index of location where minimum bland occurs.
lib/Algorithm/Simplex/Float.pm view on Meta::CPAN
=cut
sub determine_simplex_pivot_columns {
my $self = shift;
my @simplex_pivot_column_numbers;
# Assumes the existence of at least one pivot (use optimality check to insure this)
# According to Nering and Tucker (1993) page 26
# "selected a column with a positive entry in the basement row."
# NOTE: My intuition indicates a pivot could still take place but no gains would be made
# when the cost is zero. This would not lead us to optimality, but if we were
# already in an optimal state if may (should) lead to another optimal state.
# This would only apply then in the optimal case, i.e. all entries non-positive.
for my $col_num (0 .. $self->number_of_columns - 1) {
if ($self->tableau->[ $self->number_of_rows ]->[$col_num] >
$self->EPSILON)
{
push(@simplex_pivot_column_numbers, $col_num);
}
( run in 0.644 second using v1.01-cache-2.11-cpan-49f99fa48dc )