Different results using different stopping criteria
AnsweredHi,
I explain the problem first and number my questions (3 in total) in between as I go.
I need to run a large example and use the result to calculate some expressions. So, I planned to use a stopping criterion so I decided to test model.Params.MIPGap and model.Params.TimeLimit criteria. First, I tested time limit of 20 seconds and I got the result below. As you see, it reached 83% in 20 seconds but it failed to calculate the expressions I defined.
After that I tested model.Params.MIPGap=0.9 and I got the result below:
1. As you can see in the result below, it took 43 seconds to reach 90% gap which is different that the result above (83% in 20 seconds) which is one of my questions here in this post. I appreciate if you can explain why.
2. The other question that I have is why didn't it calculate the expressions (I defined) in the first run (time limit) but it calculated those in the run using Gap criterion?
3. Is there any way to record the objective function bounds in the final solution and use them in a formula? To clarify, I want to take the average of the upper bound and lower bound (14.17 and 0.45) and use it as a parameter in a different problem.
I appreciate all your help!

 With different parameter settings, Gurobi will take different paths through the search tree. Hence it may find different solutions at different points in time. You can see from your logs that this is happening here. (By experimenting with the Seed parameter, you can see even more different paths.)
 How are the expressions defined? In your first run, Gurobi finishes with status 9 (time limit reached), in the second one with status 2 (optimal solution found). Some attributes may only be available when an optimal solution has been found.
 You can query the incumbent objective value and the best known bound by using the model attributes ObjVal and ObjBound.
Please sign in to leave a comment.
Comments
1 comment