Indicator constraint in python console
AnsweredHello,
I was just trying to add conditional constraints to my model using the addGenConstrIndicator() method. However when I check the model status in my python console the number of constraints does not change. If I include it using a big M formulation the model does show an additional constraint.
How should I interpret this? Is there something wrong with my addGenConstrIndicator()? Is this something specific to the python console?
big M constraint. Constraints increase from 60 to 61.
Indicator constraint: The number of constraints does not increases but remains 61.
Thanks
-
This output only lists the number of linear constraints (the NumConstrs attribute). Indicator constraints are general constraints. To get the number of general constraints, you have to query the NumGenConstrs attribute.
miqp.NumGenConstrs
0
Please sign in to leave a comment.
Comments
1 comment