Skip to main content

Max of value and if negative, return 0 (gurobipy)

Answered

Comments

2 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.
  • Maliheh Aramon
    • Gurobi Staff

    Hi, 

    This can happen if the variables \(e_{sum}^j\) and \(t_{sum}^j\) are defined to be always \(\geq 0\). When adding a variable to the model, its lb is set to 0 by default. If these variables can take negative values, make sure to set the lb accordingly. For example, you can set it to \(-\mbox{float("inf")}\). 

    If this is not the cause of infeasibility in your model, you might want to check out the article How do I determine why my model is infeasible?

    Best regards,

    Maliheh

    0

Post is closed for comments.