Skip to main content

Maximum number of constraints for a model

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    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?.
  • Matthias Miltenberger
    • Gurobi Staff

    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,
    Matthias

    0
  • Mohammadamin Edrisi
    • Gurobi-versary
    • First Comment
    • First Question

    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.