Writing solution pool after relaxation to .sol file in MATLAB
回答済みHi all
I'm currently dealing with the infeasibility of a MILP model and I follows the guidance to use the gurobi_feasrelax to help relax the conflicting constraints in MATLAB as follows:
ep=1.0;
penalties.lb=ep*ones(length(model.lb),1);
penalties.ub=ep*ones(length(model.ub),1);
penalties.rhs=ep*ones(length(model.rhs),1);
feasrelaxresult=gurobi_feasrelax(model,2,true,penalties);%minimize weighted count
relaxresult=gurobi(feasrelaxresult.model);
The problem comes as I want to write the solution pool after relaxation to .sol file:
gurobi_write(relaxresult,'bid_relax.sol');
However it fails as the error message is " model must have a field 'A' ".I'm wondering how to correctly writes the solution pool so I can figure out how to relax my model.
Thank you all.
Xu
-
正式なコメント
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. -
struct relaxresult are as follows:
status: 'OPTIMAL'
versioninfo: [1×1 struct]
runtime: 10.6599
work: 13.3870
objval: -1.0790e+10
x: [159080×1 double]
slack: [130855×1 double]
poolobjbound: -1.0790e+10
pool: [1×2 struct]
mipgap: 3.2494e-09
objbound: -1.0790e+10
objboundc: -1.0790e+10
itercount: 60821
baritercount: 0
nodecount: 119
maxvio: 9.6893e-060 -
Hi Xu,
Please note that you cannot use the \(\texttt{gurobi_write}\) function in MATLAB to write solution files. You could set the SolFiles parameter as discussed in Writing solutions pool to .sol file.
A different way of accessing solution values in a pool is shown in the poolsearch.m example.
Best regards,
Jaromił0
投稿コメントは受け付けていません。
コメント
3件のコメント