Skip to main content

Which solution is reported when I set the time limit for my Model.

Answered

Comments

5 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?.
  • Tobias Achterberg
    • Gurobi Staff Gurobi Staff

    When you have a minimization problem with optimal value 100, then at any point in time the incumbent objective value will be

    primalbound >= 100

    while the objective bound will be

    dualbound <= 100

    When both primal and dual bound become exactly 100, then the optimality of the incumbent solution has been proven and the optimization stops with an "Optimal" status.

     

    So, in your case it could be, for example, that after aborting due to the time limit you have the following bounds in the two subproblems:

    primalbound1 = 53
    dualbound1 = 44
    primalbound2 = 72
    dualbound2 = 48

    That means, you have found a feasible solution for the full problem with value 53 + 72 = 125, and you know that there is no solution that is better (i.e., has smaller value) than 44 + 48 = 92.

    In this example, the MIP gap for subproblem 1 would be (53-44)/53 = 9/53 = 0.17, and the MIP gap for subproblem 2 would be (72-48)/72 = 24/72 = 0.33. For the full problem, you would have a MIP gap of (125-92)/125 = 0.264, but this you have to calculate yourself, because you cannot calculate it out of the two MIP gaps provided by Gurobi for the two subproblems.

    Regards,

    Tobias

    0
  • Amogh Bhosekar
    • Gurobi-versary
    • Conversationalist
    • Curious

    You are absolutely right Tobias and this is exactly what I do.

    I guess I wasn't clear enough.

    I have set up the time limit parameter to 500 seconds for models m1 and m2. 

    So my question is does command "m1.ObjVal" gives me primalbound1 or dualbound1? If it does provide primal bound then I am using incorrect bounds. Is there another command to that gives me best dual bound found so far. 

    Amogh

    0
  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    The ObjVal attribute returns the value of the best solution found (primal bound) and the ObjBound attribute returns the best bound found so far (dual bound).

    Best regards,
    Jaromił

    0
  • Amogh Bhosekar
    • Gurobi-versary
    • Conversationalist
    • Curious

    Thank you.

    0

Post is closed for comments.