I am not getting expected results from Gurobi in Matlab!
回答済みHi,
I am solving a linear optimization problem in Matlab using 1-'Linprog' of Matlab, and 2-Gurobi in Matlab. All elements (Aeq, beq, A, b, ...) are identical, but results that I am getting from Gurobi are not expected. The flag in both solvers is showing that both of them are achieving the Global optimum. Could you please help me to solve this issue?
Thanks!
...
l_bound = []; u_bound = [];
% Matlab's Linprog
options = optimoptions('linprog','Algorithm','interior-point');
[x,fval,exitflag,output,lambda] = linprog(f_mat,A_ineq,b_ineq,A_eq,b_eq,l_bound,u_bound,options);
% Gurobi in Matlab
A = [A_ineq ; A_eq];
b = [b_ineq ; b_eq];
model.A = sparse(A);
model.obj = f_mat;
model.rhs = b;
model.vtype = 'C';
model.modelsense = 'min';
model.sense = [repmat('<',size(A_ineq,1),1) ; repmat('=',size(A_eq,1),1)]';
params = [];
% gurobi_write(model, 'model_sh.lp');
% params.Presolve = 0;
% params.outputflag = 0;
% params.Aggregate = 0;
result = gurobi(model, params);
0
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Sina,
You should write out both formulations as LP file and then compare them to each other and to the mathematical formulations they should describe.
Best regards,
Matthias0
投稿コメントは受け付けていません。
コメント
2件のコメント