How to retrieve the constraints from a given model using the Gurobi C APIs?
回答済みHi,
The function GRBgetconstrs does not seem to return the rhs values for the constraints. How do I get these as well?
Thanks,
Pawan
-
正式なコメント
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 why not try our AI Gurobot?. -
If nothing else, I have the following workaround in mind. Since all my constraints are linear equations, I can optimise the model (which anyway I have to) and find the rhs values for a feasible solution (I don't need the constraints if the model is infeasible). Further, since all my rhs values come from a known set of integer values, I can round the values to the nearest integer if required.
0 -
Hi Pawan,
You can access the RHS values of linear constraints via the RHS attribute. You can use the GRBgetdblattrarray function to access all right-hand side values at once and save those to an array.
Best regards,
Jaromił1
投稿コメントは受け付けていません。
コメント
3件のコメント