Question regarding invalid gap 0.0000% optimality certificate on a MILP
Awaiting user inputHi,
I'm a university user currently working on the optimization of microgrid sizing. I want to ask you about the invalid gap on run that I done.
Environment
Gurobi Optimizer version 13.0.2, build v13.0.2rc1
Platform: linux64 — Rocky Linux 9.7 ("Blue Onyx")
Interface: Python gurobipy, model built via Pyomo
Hardware: 64 physical cores / 64 logical processors available, Threads=32 used
Model size: 2,628,131 rows, 2,628,084 columns, 9,313,841 nonzeros (post-build, pre-presolve)
Solver parameters (identical in both runs discussed below)
Summary
On a stochastic MILP (multi-scenario energy-system capacity planning, 6 scenarios × 5 years, 8760h/year resolution), Gurobi reported a proven-optimal solution with gap 0.0000% (bound = incumbent objective). A separate submission of the identical model, inputs, and solver parameters (run two days later) found a feasible solution roughly 6% lower than the first run's "proven" optimum. Since no feasible point can beat a true optimum in a minimization, the first run's certificate was invalid.
Run A — job 58519303, submitted 2026-07-25:
Coefficient statistics:
Matrix range [1e-08, 3e+06]
QMatrix range [1e+00, 1e+00]
QLMatrix range [1e+00, 1e+00]
Warning: Model contains large matrix coefficient range
Root relaxation: objective 9.615390e+04, 1462393 iterations, 236.25 seconds (1705.93 work units)
...
606 0 cutoff 1 109629.046 109629.046 0.00% 532 10641s
Cutting planes:
Implied bound: 34
MIR: 598
Explored 607 nodes (1785837 simplex iterations) in 10642.53 seconds (26259.34 work units)
Optimal solution found (tolerance 3.00e-02)
Best objective 1.096290459635e+05, best bound 1.096290459635e+05, gap 0.0000%
Reported design: Solar PV 51 kW / Battery 308 kWh / Diesel Genset 30 kW, NPC 109.63 kUSD.
Run B — job 58547964, submitted 2026-07-26, identical model/inputs/parameters:
Coefficient statistics:
Matrix range [4e-06, 3e+06]
QMatrix range [1e+00, 1e+00]
QLMatrix range [1e+00, 1e+00]
...
H 9 10 103035.95840 100408.673 2.55% 61983 33804s
Cutting planes:
Implied bound: 424
MIR: 858
Relax-and-lift: 38046
Explored 11 nodes (2809254 simplex iterations) in 33805.48 seconds (54548.80 work units)
Best objective 1.030359583961e+05, best bound 1.004086732989e+05, gap 2.5499%
Design found: Solar PV 48 kW / Battery 308 kWh / Diesel Genset 5 kW, NPC 103.04 kUSD — 6.0% below Run A's "proven" 109,629.05 optimum, and itself not yet fully converged (2.55% reported gap), so the true optimum is lower still.
Why do think this happen?
-
Hi Ruly,
Thank you for the detailed description and for including the logs.
As a first step, I would recommend checking whether the solution from the later run (objective value 103035.95840) is actually feasible for the model from the first run that reported the optimal objective value of 109629.046. This helps determine whether the two runs are indeed solving the exact same optimization problem or whether there are any differences in the model or data.
For guidance on diagnosing this type of issue, please see our Knowledge Base article: How do I diagnose a suboptimal objective value returned as optimal by Gurobi? It walks through the recommended checks and common causes of this behavior.
Once you've gone through those steps, feel free to share your findings, and we'll be happy to help investigate further.
Best regards,
Simran0 -
A separate submission of the identical model, inputs
This statement is not compatible with the fact the coefficient statistics reported in the two logs are different.
0 -
Hi Simranjit and Riley,
Thanks for the suggestion. I'll check again the model and the guidance.
Regards,
Ruly
0
Please sign in to leave a comment.
Comments
3 comments