Skip to main content

Using gurobi optimize variable

Answered

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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

    To verify whether your model implementation is correct, you could fix the values of the variable of which you think are incorrect.

    m.addConstr(C[x,y] == 1)
    [...]

    and see whether your model is feasible. If it is feasible and the optimal solution is indeed better than the one found by Gurobi without the fixings, then you should first try setting MIPGap = 0. If this does not help, then you might want to try to understand why the solution found by Gurobi has a better optimal solution value.

    Please also note that it is possible that your model has multiple optimal solution, i.e., there exist different points with the same optimal solution value. For more information, please refer to the Knowledge Base article How do I find additional solutions to a model?

    If the fixed model is infeasible, then please proceed as described in How do I determine why my model is infeasible? to find the source of infeasibility.

    0

Post is closed for comments.