Skip to main content

Using gurobi optimize variable

Answered

Comments

1 comment

  • Jaromił Najman
    Gurobi Staff 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

Please sign in to leave a comment.