I have an optimization problem, but the results obtained by using quadprog and gurobi are quite different. I debugged for a long time but couldn't find the reason, so I came to ask for help.
See the mat file for the data of optimization problem (In the below link).
The procedure of quadprog is as follows:
qpoptions = optimset('Display','off');
[x, fval, qpexitflag, ~, Lagmultipliers] = quadprog(qpinfo.H, qpinfo.f,...
qpinfo.A, qpinfo.b, qpinfo.Aeq, qpinfo.beq, , , , qpoptions);
The procedure of Gurobi is as follows:
params.outputflag = 0;
params.method = -1;
% full problem
model.Q = 0.5*sparse(qpinfo.H);
model.obj = full(qpinfo.f);
model.A = sparse([qpinfo.A;qpinfo.Aeq]);
model.rhs = full([qpinfo.b;qpinfo.beq]);
model.sense = [char('<'*ones(size(qpinfo.A,1),1));char('='*ones(size(qpinfo.Aeq,1),1))];
model.modelsense = 'min';
result = gurobi(model, params);
Please sign in to leave a comment.