How to read a rlp model and optmize using VS
回答済みHi Folks,
I am using Gurobi C++ using Visual Studio and the model.write ("filename.rlp") in .cpp file. I am trying to read it in another .cpp file. I wrote in .rlp, as recommended by the Gurobi Optimization warning, which happens I guess due to the names are equal,( "vname ") + index number from a loop. Then Gurobi recognizes some names with different indexes as the same. My questions are :
should I call the model as in mip2.cpp or model.read("filename.rlp") ?
In the case of mip2.cpp, should the GRBModel have the same name as originally created ?
-
正式なコメント
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 Alessandra,
Please don't use the GRBModel::read() method to load a model from a file. Please use the respective constructor just like in the mip2_c++.cpp example:
GRBModel model = GRBModel(*env, filename);
If you write store the model as RLP file, all variable names will be replaced with generic names. To keep the original names, please use either the LP or better yet the MPS file format. The latter one provides more accuracy in the coefficients and preserves the order of constraints.
If you don't assign (unique) names to all your variables and constraints, Gurobi will replace all of them with generic names.
Best regards,
Matthias0
投稿コメントは受け付けていません。
コメント
2件のコメント