Optimization: principles and algorithms, by Michel Bierlaire
run1604simplex.m
Go to the documentation of this file.
1 %> \file
2 %> Runs example 16.4 illustrating the simplex method
3 %>
4 %> @note Calls \ref simplex
5 %>
6 %> @ingroup Running
7 %> @ingroup chap16
8 %> @author Michel Bierlaire
9 %> @date Sun Mar 22 11:09:14 2015
10 A = [1 1 1 0 ; 1 -1 0 1] ;
11 b = [1 ; 1] ;
12 c = [-1 ; -2 ; 0 ; 0 ] ;
13 basis = [3 4] ;
14 [optimalbasis,unbounded] = simplex(A,b,c,basis) ;
15 B = A(:,optimalbasis) ;
16 xb = B \ b ;
17 xfull = zeros(size(c));
18 xfull(optimalbasis) = xb ;
19 xfull
20 printf("Objective function: %e\n",c'*xfull)
function simplex(in A, in b, in c, in basis)
Applies the simplex method to solve subject to and , where , , and .
Copyright 2015-2016 Michel Bierlaire