% Problema de blending e producao de uma refinaria
% Edgar & Himmelblau, 1988
% 
%  max c'x = min -c'x
%      A x <= b
%        x >= 0

c=[8.1; 10.8];
A=[0.8   0.44
    0.05  0.1
    0.1   0.36];
b=[24000; 2000; 6000];
lb=zeros(2,1);
ub=[];

ctype="UUU"; % A x <= b
vtype="CC"; % continuous variables
ptype=-1; % maximization

% active set: simplex
param.lpsolver = 1;
[x,S,eflag,out]=glpk(c,A,b,lb,ub,ctype,vtype,ptype,param)

% interior point: S. Mehrotra, 1992
param.lpsolver = 2;
[xi,Si,eflagi,outi]=glpk(c,A,b,lb,ub,ctype,vtype,ptype,param)
