I am using C# api. Given a gurobi model
GRBModel model = new GRBModel(env);
after populating constraint, giving objective function, and doing
model.Optimize();
is there a way to determine whether the model is feasible?
You need to check the optimization status code after solving the model. In most cases, you simply need to test that the status is OPTIMAL
. For an example, see mip2_cs.cs
in the examples\\c#
subdirectory.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.