The Simplex Method 125
function [xsol objval exitflag]=SimplexMethod(c, Aeq, beq, B_set)
% Simplex_Method solves a linear program in standard form:
% min c’*x
% s.t. Aeq*x = beq
% x >= 0
% by using the simplex method of George B. Dantzig
%
% Inputs:
% c = n*1 vector of objective coefficients
% Aeq = m*n matrix with m < n
% beq = m*1 vector of right hand side (RHS) coefficients
% B_set = m*1 vector that contains indices (subscripts) of basic variables
%
% Parameter and Variable Partitions
%
% c, Aeq, and beq are partitioned according to partition of x into
% x’ =[x_B’ | x_N’] where
% x_B is an m*1 vector of basic variables
% x_N is an (n-m)*1 vector of non-basic variables
% c’ = [c_B’ | c_N’]
% c_B is the objective coefficients of x_B, an m*1 vector
% c_N is the ...