简体   繁体   English

如何知道模型是否可行

[英]How to know whether a model is feasible

I am using C# api. 我正在使用C#api。 Given a gurobi model 鉴于gurobi模型

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 . 在大多数情况下,您只需要测试状态是OPTIMAL For an example, see mip2_cs.cs in the examples\\c# subdirectory. 有关示例,请参阅examples\\c#子目录中的mip2_cs.cs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM