Retrieving the linear expression of a constraint
回答済みHi
I'm implementing a Benders Decomposition with the so called Two-Phase Approach in which I add the benders cuts of the model without any integrality constraint solved by classical Benders (phase 1) to the model with reintroduced integrality constraints and callback function (phase 2) as lazy constraints. Therefore I need to acces to the linear expression of the benders cuts in the first model but I don't know how. I can image that the function getConstrByName() alone can't help because it returns a gurobi constraint instead of an expression. I appreciate your help in advance.
Best regards
Zheren
-
正式なコメント
This post is more than two 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 Zheren,
If you know the constraint you can retrieve the corresponding linear expression for the left hand side by using Model.getRow which will return a gurobipy.LinExpr.
- Riley
0
投稿コメントは受け付けていません。
コメント
2件のコメント