Skip to main content

Equipment assigned twice despite constraint




  • Alexandre Touzet
    First Comment
    First Question

    Hello, if my post isn't in the proper section please tell me, or transfer it if possible...

    I really don't know what is wrong with my code as one piece of equipment shouldn't be able two times at the same time right?

    Please I really need someone's help, I am fairly new to optimization and gurobi

  • Mario Ruthmair
    Gurobi Staff Gurobi Staff

    Hi Alexandre,

    It is quite some effort to debug such a code. We usually recommend to do the following:

    • Create a tiny artificial instance of your problem where you can already observe that the obtained solution violates some constraints.
    • Write out the model in readable form as LP file (which you are already doing).
    • If the solver terminates with status OPTIMAL, all included constraints should be respected (subject to some very small violations -- by default around 1e-6 -- resulting from limited precision computation).
    • In nearly all cases, some constraints are missing in the model, they have been wrongly implemented, or they are mathematically wrong.
    • These cases can usually be found by analyzing the LP model file together with the found solution values.

    Best regards,


Please sign in to leave a comment.