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
-
Official comment
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
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
Post is closed for comments.
Comments
2 comments