Determine whether the current solution is correct.
Determine whether the current solution is correct.
the primal solution vector x
the dual solution vector y
the minimum value of the objective function
Return the dual solution vector (y).
Find the best variable x_l to enter the basis.
Find the best variable x_l to enter the basis. Use Dantiz's Rule: index of max positive (cycling possible) z value. Return -1 to indicate no such column.
Show the flaw by printing the error message.
Show the flaw by printing the error message.
the method where the error occurred
the error message
Determine whether the current solution (x = primal) is still primal feasible.
Find the best variable x_k to leave the basis given that x_l is entering.
Find the best variable x_k to leave the basis given that x_l is entering. Determine the index of the leaving variable corresponding to ROW k using the Min-Ratio Rule. Return -1 to indicate no such row.
the variable chosen to enter the basis
Return the optimal objective function value (f(x) = c x).
Return the optimal objective function value (f(x) = c x).
the primal solution vector
Pivot by replacing x_k with x_l in the basis.
Pivot by replacing x_k with x_l in the basis. Update b_inv (actually lu), b_ and c_.
the leaving variable
the entering variable
Return the primal (basis only) solution vector (x).
Return the full primal solution vector (xx).
There are M+N variables, N decision and M slack variables, of which, for each iteration, M are chosen for a Basic Feasible Solution (BFS).
There are M+N variables, N decision and M slack variables, of which, for each iteration, M are chosen for a Basic Feasible Solution (BFS). The the variables not in the basis are set to zero. Setting j to N will start with the slack variables in the basis (only works if b >= 0).
the offset to start the basis
the size of the basis
Show the current BG tableau.
Show the current BG tableau.
the number of iterations do far
Solve a Linear Programming (LP) problem using the BG Simplex Algorithm.
Solve a Linear Programming (LP) problem using the BG Simplex Algorithm. Iteratively pivot until there an optimal solution is found or it is determined that the solution is unbounded. Return the optimal vector x.
Convert the current BG tableau (basis, b_inv, b_, and c_) to a string.
Convert the current BG tableau (basis, b_inv, b_, and c_) to a string.
Check if u <= 0., the solution is unbounded.
Check if u <= 0., the solution is unbounded.
the vector for leaving
the initial basis (set of indices where x_i is in the basis)
This class solves Linear Programming (LP) problems using the Bartels-Golub (BG) Simplex Algorithm. Given a constraint matrix 'a', constant vector 'b' and cost vector 'c', find values for the solution/decision vector 'x' that minimize the objective function 'f(x)', while satisfying all of the constraints, i.e.,
minimize f(x) = c x subject to a x <= b, x >= 0
The BG Simplex Algorithm performs LU Fractorization/Decomposition of the basis-matrix ('ba' = 'B') rather than computing inverses ('b_inv'). It has benefits over the (Revised) Simplex Algorithm (less runtime, less memory, and much reduced chance of round off errors).