Skip to main content

Why my Best objective value is greater than the best known?

Answered

Comments

6 comments

  • Jaromił Najman
    • Gurobi Staff

    Hi Runfeng,

    However, what is interesting and confusing is that I found in the logs (see below) that the last Objective Bounds value is equal to 2314681.02, which is smaller than the best objective function value 2314681.25.

    Please note that 2314681.02 is not an objective bound but the currently best feasible point found (also called incumbent). It is possible that the solution found by Gurobi is a bit better than what you found with your heuristic, because Gurobi can exploit optimization tolerances FeasibilityTol, IntFeasTol, i.e., it is possible that the final solution found by Gurobi violates the model's constraints by a bit (up to the given tolerances). This is possible for bigger and more complex models. Additionally, please note that the optimal objective value differs from your heuristic solution in the 8th overall digit, which is very likely given the numerical complexity of the algorithms.

    To check constraint and bound violations, you can call the printStats method, or check the solution quality attributes of the optimal solution. In particular, the values of the attributes MaxVio, BoundVio, and ConstrVio are of interest.

    Best regards, 
    Jaromił

    0
  • Runfeng Yu
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi Jaromił, 
    Thank you very much for answering my questions.
    Here is my understanding:


    In the above question, 2314681.02 is the best feasible point Gurobi found. However, although this point is the best, it is in fact a little bit infeasible due to the optimization tolerances parameter that you have mentioned. Therefore, due to the infeasibility (violates the model's constraints by a bit),  2314681.02 was not adopted as the optimal objective function value. Meanwhile, the value 2314681.25 is a perfectly feasible objective value, so it is the result returned by Gurobi in the end of the log.

    Am I understanding correctly?

    Thank you again for taking time out of your busy schedule to answer my question, which is very important for a novice!

    Kind regards,

    Runfeng

    0
  • Jaromił Najman
    • Gurobi Staff

    Hi Runfeng,

    In the above question, 2314681.02 is the best feasible point Gurobi found. However, although this point is the best, it is in fact a little bit infeasible due to the optimization tolerances parameter that you have mentioned. Therefore, due to the infeasibility (violates the model's constraints by a bit),  2314681.02 was not adopted as the optimal objective function value. Meanwhile, the value 2314681.25 is a perfectly feasible objective value, so it is the result returned by Gurobi in the end of the log.

    Am I understanding correctly?

    Now I see what exactly you mean, sorry for the confusion. In addition to what I said, Gurobi performs as so-called "clean-up phase", where it tries to "polish the solution point", i.e., decrease constraint and bound violations while not deteriorating the optimal objective value. In this particular example, the objective value got a bit worse but only in the 8th overall digit which is completely acceptable within the default tolerances.

    Best regards, 
    Jaromił

    0
  • Runfeng Yu
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi Jaromił, 

    Sorry, I am still confused about this problem.

    Based on the 393rd second of the log, gurobi obtains the feasible solution 2314681.2478.
    In the next process, gurobi looks for other possible better points.
    Then at the 873rd second, gurobi gets the value 2314681.0236.

    H   33    38                    2314681.2478 2296587.08  0.78%   521  393s
    H 7721  6255                    2314681.0236 2296589.80  0.78%  33.5  873s
    Best objective 2.314681247625e+06, best bound 2.296589796396e+06, gap 0.7816%

    I know this is a very small difference.
    But why did Gurobi accept 2314681.2478 as the return value instead of 2314681.0236? Apparently 2314681.0236 is smaller.

    It seems that "clean-up phase" did not deteriorate the value (2314681.2478 at the 393s) for a minimize problem, instead gurobi got a better one (2314681.0236 at the 873s). 

    Do these two values correspond to the same feasible point?  I guess so. Gurobi found a point with objective value 2314681.2478. Then, the clean-up phase ''delete'' some constraint and and bound violations, which results a better solution 2314681.0236. But such a gap is irrelevant, then gurobi returns a worse one (2314681.2478). 

    Thank you for your answer, it is a pleasure to communicate with you.

    Best regards, 
    Runfeng

    0
  • Jaromił Najman
    • Gurobi Staff

    Hi Runfeng,

    But why did Gurobi accept 2314681.2478 as the return value instead of 2314681.0236?

    The two feasible points are found at different points in time. Gurobi first finds a feasible solution point with value 2314681.2478 and ~500 seconds, a different heuristic finds a slightly better point with objective value 2314681.0236.

    It seems that "clean-up phase" did not deteriorate the value (2314681.2478 at the 393s) for a minimize problem, instead gurobi got a better one (2314681.0236 at the 873s). 

    The clean-up phase is called only once at the end of the optimization process, i.e., between the last line of the B&B algorithm and the output about optimal termination.

    Do these two values correspond to the same feasible point? 

    No, see my next point.

    Gurobi found a point with objective value 2314681.2478. Then, the clean-up phase ''delete'' some constraint and and bound violations, which results a better solution 2314681.0236. But such a gap is irrelevant, then gurobi returns a worse one (2314681.2478). 

    No, this is not how this works. Gurobi finds a feasible solution point with value 2314681.2478 at 393 seconds. It then finds a slightly better solution point with value 2314681.0236. After some termination criteria is reached (in this case time limit is hit), Gurobi takes the solution point with objective value 2314681.0236 and starts a "clean-up phase" where it tries it improve constraint/bound violations. In this phase the objective value is slightly deteriorated to value  2314681.247625.

    Note that the final feasible point \(x\) with final objective value 2314681.247625 is (slightly) different from the feasible point \(y\) with objective value 2314681.0236 seen at 873 seconds because \(y\) has been "cleaned up", i.e., it has lower violations compared to \(x\). \(x\) is not equal to the point found at 393 seconds.

    I hope this made it more clear.

    Best regards, 
    Jaromił

    0
  • Runfeng Yu
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi Jaromił,

    Thanks for your patient answer, now I finally understand how it works!

    Best regards,

    Runfeng

     

    0

Please sign in to leave a comment.