Significant difference between model execution
AnsweredHi, I am seeking assistance with my complex assignment problem modeled as an MIP. I have two environments currently set up to solve the MIP, one is a development environment which is much like your average use of AMPL and Gurobi. The other is via a webbased tool which uses Java to call AMPL and Gurobi through a user interface for nonmath users.
The development environment took just over 8 hours to solve, where as the webbased tool took about 17 seconds. Both use the same Gurobi compute server. I have attached some information i drew out of both logs below, and have a couple of questions I am hoping you can answer.
Both environments have Gurobi option mipgap = 0.02. The webbased tool returned a feasible solution when reaching just 4% according to the log output. Why is this high than my mipgap tolerance?
The web based tool (17sec run) returned a feasible solution 80 million more than the development environment (8h run)  is this purely due to the random start point?
The webbased tool also remained on the root node, while development tool explored many nodes.
Log summary:
LOG 1: Webbased tool (17 s solve time)
Run time: According to the log: 17s (this is the Gurobi time)
Optimize a model with 2475 rows, 66689 columns and 355340 nonzeros
Model has 1134 general constraints
Variable types: 529 continuous, 66160 integer (66160 binary)
Coefficient statistics:
Matrix range [3e01, 4e+03]
Objective range [2e+01, 2e+06]
Bounds range [1e+00, 1e+01]
RHS range [1e+00, 2e+03
Presolve added 993 rows and 38 columns
Presolve time: 1.38s
Presolved: 3468 rows, 66727 columns, 300908 nonzeros
Extracted 80 lazy constraints
Last row of log output:
Nodes  Current Node  Objective Bounds  Work
Expl Unexpl  Obj Depth IntInf  Incumbent BestBd Gap  It/Node Time
0 0 9.7378e+07 0 641 1.0144e+08 9.7378e+07 4.00%  17s
Nodes explored / unexplored: 0/0
mipgap: 4%
OBJECTIVE FUNCTION VALUE: 99,741,019.47
LOG 2: Development tool
Run Time: 8 hours
Optimize a model with 2472 rows, 81930 columns and 442513 nonzeros
Model has 908 general constraints
Variable types: 529 continuous, 81401 integer (81401 binary)
Coefficient statistics:
Matrix range [4e01, 7e+03]
Objective range [1e+01, 1e+05]
Bounds range [1e+00, 1e+01]
RHS range [1e+00, 2e+03]
Presolve added 700 rows and 0 columns
Presolve removed 0 rows and 164 columns
Presolve time: 1.86s
Presolved: 3172 rows, 81766 columns, 371911 nonzeros
Extracted 80 lazy constraints
Last row of outlev output:
Nodes  Current Node  Objective Bounds  Work
Expl Unexpl  Obj Depth IntInf  Incumbent BestBd Gap  It/Node Time
H 346989 228546 1.976387e+07 1.9429e+07 1.69% 206 29333s
Nodes Explored/unexplored: 346989/ 228546
mipgap: 1.69%
OBJECTIVE FUNCTION VALUE: 19,763,871.47

Just looking at the first lines of the log files, I would guess that you are solving two different models.
For the web tool, you get this:
Optimize a model with 2475 rows, 66689 columns and 355340 nonzeros
For the development tool, you get this:
Optimize a model with 2472 rows, 81930 columns and 442513 nonzeros
0 
thanks yes they are slightly different in the way the original points have been clustered. I hadn't thought this would make such a significant difference
0 
It can happen sometimes that small changes in the model make a big difference...
The web tool returns a solution with a MIP gap of 4% though. Are you sure you correctly set the MIP gap to the same value in both setups? After what time did the solver reach 4% with the development tool? (Could you share complete log files?)
Could you try running exactly the same model with both tools? Could you also try running with different random seeds?
0 
This is the log from the web tool  it seems to be repeated probably due to the developers saving the AMPL log to the same location as the Gurobi log.
It appears to me to be exiting optimization at mipgap = 4% rather than 2%. But looking at the log output seems like it is implemented properly.
0 
we have altered the problem slightly to improve the runtime in the development tool, so now my focus is trying to determine why the webtool stops at mipgap=4%
0 
Looking at the log you have attached, the final mip gap is not displayed. The final objective is 9.9741019e+07. Gurobi Optimizer is reducing the gap between the best bound and the best objective. The last best bound is 9.7378e+07. This is approximately 2% mip gap.
If the log file above is no longer current, please post the current log file.
0 
thanks Jennifer for pointing out that the achieved mipgap is close to 2%  I can see that now.
This is the most current log, I am not sure why the last line and final mipgap is not displaying. There is something strange happening with the way the webtool captures the log. thanks again for your help.
0
Please sign in to leave a comment.
Comments
7 comments