2 %> Runs example 16.4 illustrating the
simplex method
8 %> @author Michel Bierlaire
9 %> @date Sun Mar 22 11:09:14 2015
10 A = [1 2 2 1 0 0 ; 2 1 2 0 1 0 ; 2 2 1 0 0 1] ;
12 c = [-10 ; -12 ; -12 ; 0 ; 0 ; 0 ] ;
14 [optimalbasis,unbounded] =
simplex(A,b,c,basis) ;
16 B = A(:,optimalbasis) ;
18 xfull = zeros(size(c));
19 xfull(optimalbasis) = xb ;
21 printf(
"Objective function: %e\n",c
'*xfull) 23 printf("Unbounded problem\n") ; function simplex(in A, in b, in c, in basis)
Applies the simplex method to solve subject to and , where , , and .