Maximum number of constraints for a model
AnsweredHi,
I was wondering to what extent I can add constraints to a model assuming that there is enough RAM to load all the constraints. Does this depend only on the available computational resources, or there is some limit from the algorithmic perspective?
Cheers,
Mohammad
-
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 why not try our AI Gurobot?. -
Hi Mohammad,
There is virtually no limit on how large a model can be. There are models with millions of variables and constraints that are reduced to just a handful during presolving and can be solved in a few seconds.
In general, the size of a model alone is not a good metric for measuring the difficulty or hardness of the problem and whether the solver can handle it. You should always take sparsity of the constraint matrix and number of integer variables into account. Even then there are seemingly simple small models, that are not solved to this day.
This is only concerning linear (mixed-integer) models - things get considerably more complicated with non-linear or even non-convex constraints.
I hope that answers your question.
Cheers,
Matthias0 -
Hi Matthias,
Thank you so much for your response.
Your answer changed my mind about the effect of presolving stage. My model can have tens of variables with millions of constraints which seems to me that it is easy to solve as it is well-constrained (correct me if I'm wrong). If there are many similar constraints, I think presolving stage can reduce the redundancy as you explained. I will test the model.
Best,
Mohammad
0
Post is closed for comments.
Comments
3 comments