Skip to main content

A huge number of Equality constraints

Answered

Comments

4 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • Jaromił Najman
    • Gurobi Staff

    Hi,

    Please note that your code snippet does not work. There are definitions missing for \(\texttt{C_,mm,SOC_p,t_p}\).

    Maybe the Knowledge Base article How do I determine why my model is infeasible? can help.

    Best regards, 
    Jaromił

    1
  • Hussein Sharadga
    • Gurobi-versary
    • Investigator
    • Conversationalist

    Dear Mr. Jaromił,

     

    Thank you so much for your comment!

    This model is a Markov decision process which is supposed to be feasible, but I guess because I have a large number of equality constraints and a large number of variables, and the summation of this variable is 1, which means some of them will be pretty small. If I replace the equality sign in the second constraint with <= it will solve and give acceptable results. The error in the constraints will be 2%.

     

    For the missing parameters, they are calculated based on data, and it does not allow me here to share the data. 

     

    Thanks

     

     

    0
  • Jaromił Najman
    • Gurobi Staff

    Dear Hussein,

    For the missing parameters, they are calculated based on data, and it does not allow me here to share the data. 

    I understand.

    If I replace the equality sign in the second constraint with <= it will solve and give acceptable results. The error in the constraints will be 2%.

    Is it possible that your data has values with various orders of magnitude? This may lead to numerical issues and ultimately infeasibility. Our Guidelines for Numerical Issues hold helpful information about how to detect whether your model has numerical issues and how to tackle them.

    Note that often real world data is not clean, i.e., there are (round-off) errors in the data which results in infeasibility when used in optimization algorithms. It is often useful to clean up the data before using it.

    Did you try computing an IIS or a feasibility relaxation as proposed in How do I determine why my model is infeasible? This may give you an idea on which variables/constraint to adjust in order to retain feasibility.

    If it is not possible to improve the data or achieve feasibility with equalities, you might consider formulating the equality constraints as range constraints, i.e., replace \(x = 0\) by \(-\delta \leq x \leq \delta\) with \(\delta > 0\). This will allow for a bit of wiggle room while still being close to equalities. You can use Gurobi's range constraints for this.

    Best regards, 
    Jaromił

    Best regards, 
    Jaromił

    0

Post is closed for comments.