Getting Binding Constraints
AnsweredHi, I want to get tight constraints at optimality for a linear model . It is possible to check equalities of constraints, but it would be better to have a simple Gurobi function to give binding constraints. Is there a function like this or is it possible to build?
Thank you
0
-
After optimizing, you can check if each (linear) constraint's Slack attribute is sufficiently close to \(0\). For example, in Python:
binding = [c for c in model.getConstrs() if abs(c.Slack) < 1e-6]
1 -
Thank you Mr Towle
0
Please sign in to leave a comment.
Comments
2 comments