Skip to main content

Problem with 2 representations of a formulation

Answered

Comments

3 comments

  • Marika Karbstein
    • Gurobi Staff Gurobi Staff

    Both models, as you posted them, result in the same optimal objective value of 13. I tested with Gurobi Version 12.0.0.
    If I change the objective sense to "Minimize", the optimal objective value is 0. Maybe the "maximize" got lost in your test.
    Can you please check again and share more information if you see a difference?

    0
  • Yonzheng Jerry Chua
    • First Comment
    • First Question

    Hi Marika,

    Thank you for the prompt reply,

    it turns out that it was some numerical issue - It seems the moment I changed the coefficient of z[0] to a smaller number, the two models do coincide. 

     

    Is there something about numerical issues that we have to take note of as users?

     

    Best
    Jerry

    0
  • Marika Karbstein
    • Gurobi Staff Gurobi Staff

    Hi Jerry,

    Indeed, coefficients of 1e+34 are a bad idea.
    Gurobi also prints a warning in the log, which is discussed in the KB article What does "Model contains large matrix coefficient range" mean?

    Best,
    Marika

    0

Please sign in to leave a comment.