2 %> Algorithm 16.4: Phase II
simplex algorithm with tableau. Implementation of algorithm 16.4 of \cite Bier15-book
4 %> @note Tested with \ref run1613.m
8 %> @author Michel Bierlaire
9 %> @date Sun Mar 22 12:52:25 2015
10 %> @ingroup Algorithms
13 %> Solve a linear optimization problem in standard form
using the tableau
simplex 14 %> @param tab the first
simplex tableau
15 %> @param rowindex:
for each row, index of the corresponding basic variables
16 %> @
return opttableau the optimal tableau
17 function [opttableau,bounded,rowindex] =
simplexTableau(tab,rowindex)
19 [mtab,ntab] = size(tab) ;
28 cfirstneg = tab(m+1,i) ;
34 if (cfirstneg >= -eps)
39 bestlambda = 1000000 ;
42 if (tab(i,colpivot) > 0)
43 lambda = tab(i,n+1) / tab(i,colpivot) ;
44 if (lambda < bestlambda)
51 printf(
"**** Unbounded problem ****\n") ;
55 tab =
pivoting(tab,rowpivot,colpivot) ;
56 rowindex(rowpivot) = colpivot ;
function twoPhasesSimplex(in A, in b, in c)
Solve a linear optimization problem in standard form using the tableau simplex with two phases subje...
function simplexTableau(in tab, in rowindex)
Solve a linear optimization problem in standard form using the tableau simplex.
function pivoting(in tab, in l, in j)
Pivot the tableau.
function simplex(in A, in b, in c, in basis)
Applies the simplex method to solve subject to and , where , , and .