Skip to main content

Model became infeasible after adding "difference to mean" variables and constraints

Answered

Comments

2 comments

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

    Variables added with Model.addVar() or Model.addVars() are nonnegative by default. Thus, the \( \texttt{diff_to_mean} \) variables are all nonnegative. There almost certainly exists \( \texttt{i} \) for which \( \texttt{utilization_rate[i] - mean_utilization} \) is negative, which would result in an infeasible model. To resolve this, you can try setting the \( \texttt{lb} \) keyword argument when defining the \( \texttt{diff_to_mean} \) variables:

    diff_to_mean = m.addVars(facility_list, lb=-gp.GRB.INFINITY, name='diff_to_mean')
    0

Post is closed for comments.