Originally posted by: yanzhi
method 1
[x,fval,exitflag,output] = cplexmilp(f,Aineq,bineq,Aeq,beq,[],[],[],lb,ub,ctype,[],[] );%for MILP problem
method 2
cplex=Cplex(''); cplex.Model.sense = 'minimize'; cplex.addCols(f,[],lb,ub,ctype);
cplex.addRows([-inf*ones(size(bineq,1),1);beq], [Aineq;Aeq], [bineq;beq]);
method 3
cplex=Cplex(''); cplex.Model.sense = 'minimize'; cplex.addCols(f,[],lb,ub,[]); %here ctype is set to empty different from that in method 2
cplex.addRows([-inf*ones(size(bineq,1),1);beq], [Aineq;Aeq], [bineq;beq]);
method 4
[x, fval, ~, output, lambda] = cplexlp (f, Aineq, bineq, Aeq, beq, lb, ub, [], []);%for LP problem
the first two columns of x1 are the results for MILP problem, the last two are for LP problem.
the first column is obtained by method 1, the 2nd is by method 2, the 3rd column is by method 3, the last column is by method 4.
why is the first two-column different for the same MILP and the last two also different for the same LP problem?
#CPLEXOptimizers#DecisionOptimization