Understanding log warnings for MIP problem
AnsweredWhile trying to solve an MIP model, I tried to look into the log file. I read the documentation https://www.gurobi.com/documentation/9.1/refman/mip_logging.html for the log file but I still don't understand or know how to deal with the warnings I got in my log file below.
1) Warning: Model contains large matrix coefficients
Warning: Model contains large rhs
Is this caused by the fact that my constraints range in big interval? and how to solve this issue, added to the setting NumericFocus which slows the model.
2) Warning: 1 variables dropped from basis
What does it mean if a variable drops from basis, and how can I know which one and avoid this from happening?
3) Warning: max constraint violation (2.8125e01) exceeds tolerance
Warning: max bound violation (1.5259e05) exceeds tolerance
(possibly due to large matrix coefficients)
Thread count: 12 physical cores, 24 logical processors, using up to 24 threads
Optimize a model with 30649 rows, 10033 columns and 27365 nonzeros
Model fingerprint: 0x43ceffa0
Variable types: 9925 continuous, 108 integer (108 binary)
Coefficient statistics:
Matrix range [1e+00, 1e+11]
Objective range [1e+00, 1e+00]
Bounds range [1e+00, 5e+03]
RHS range [5e+00, 1e+14]
Warning: Model contains large matrix coefficients
Warning: Model contains large rhs
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
Presolve removed 25473 rows and 129 columns
Presolve time: 0.03s
Presolved: 5176 rows, 9904 columns, 26808 nonzeros
Variable types: 9808 continuous, 96 integer (96 binary)
Warning: 1 variables dropped from basis
Root relaxation: objective 2.697254e+15, 6906 iterations, 0.44 seconds (0.44 work units)
Nodes  Current Node  Objective Bounds  Work
Expl Unexpl  Obj Depth IntInf  Incumbent BestBd Gap  It/Node Time
0 0 2.6973e+15 0 44  2.6973e+15   1s
0 0 2.6973e+15 0 11  2.6973e+15   1s
0 0 2.6973e+15 0 8  2.6973e+15   1s
0 0 2.6973e+15 0 8  2.6973e+15   1s
0 0 2.6973e+15 0 7  2.6973e+15   1s
0 0 2.6973e+15 0 7  2.6973e+15   1s
0 0 2.6973e+15 0 7  2.6973e+15   1s
0 0 2.6973e+15 0 7  2.6973e+15   1s
0 0 2.6973e+15 0 7  2.6973e+15   1s
0 0 2.6973e+15 0 7  2.6973e+15   1s
0 2 2.6973e+15 0 7  2.6973e+15   1s
189 221 infeasible 12  2.6973e+15  282 8s
234 300 2.6973e+15 13 11  2.6973e+15  369 10s
452 671 2.6973e+15 36 15  2.6973e+15  557 19s
709 673 2.6973e+15 24 79  2.6973e+15  562 21s
711 675 2.6973e+15 46 75  2.6973e+15  561 26s
1030 944 2.6973e+15 19 66  2.6973e+15  29.3 30s
* 1116 965 35 2.697254e+15 2.6973e+15 0.00% 42.4 31s
Explored 1171 nodes (471655 simplex iterations) in 31.16 seconds (27.94 work units)
Thread count was 24 (of 24 available processors)
Solution count 1: 2.69725e+15
Optimal solution found (tolerance 1.00e04)
Warning: max constraint violation (2.8125e01) exceeds tolerance
Warning: max bound violation (1.5259e05) exceeds tolerance
(possibly due to large matrix coefficients)
Best objective 2.697253636296e+15, best bound 2.697253636296e+15, gap 0.0000%
If you have a documentation or a link for Gurobi warnings or have some insight, I would appreciate it.
Thank you.

Hello Amal,
The large matrix and RHS coefficients in your model appear to be causing numerical issues within the solution process. The other warnings are symptoms of such numerical issues.
Ideally, all ranges should have a width of 1e4 or less, and we should definitely worry when any of them is bigger than 1e8. In your model the matrix coefficient and RHS ranges of [1e+00, 1e+11] and [5e+00, 1e+14] are significantly larger than this rule of thumb. For more information, you can read our Guidelines for Numerical Issues. I recommend reformulating/rescaling your model to avoid such large ranges and solving it again.
Best regards,
Dan
0 
Hi Dan,
thank you for your answer.
what does it mean if the model is achieving an optimal objective value even though those warnings exist? that's what I find it difficult to understand.
Also, I tried to change some parameters as mentioned in the documentation but still faced the same warnings. I then thought of decreasing the big M value which is part of my model, and no longer had the warnings, the result though seem a little bit confusing as if it's no longer optimising for that value of M. Any insights of how I can maintain small range while using the big M value in my model?
Thank you
0 
Hello Amal,
As discussed in the Guidelines for Numerical Issues (see here), Gurobi relies on floatingpoint numbers for representing data and performing computations. Floatingpoint numbers are amenable to computation on standard computer hardware, but only store a finite approximation to each number. This necessitates the use of numerical tolerances. For example, a solution is considered feasible even if it violates some constraints by a very small amount (which is controlled by the parameter FeasibilityTol with a default value of 1e6).
So how could a solution that violates this tolerance be returned? Before solving a MIP, Gurobi applies a presolve routine to compute an equivalent model with reduced size and improved numerical properties – the presolved model is then solved, and the solution is translated back to the original model. In some cases, a solution satisfies the numerical tolerances for the presolved model, but when translated back to the original formulation, the violations may be larger, resulting in warning messages such as those you have encountered. This is often the result of numerical issues, which can be due to large coefficients.
This behavior may be resolved by reformulating your model to avoid having a very large “big M.” To do this, you could try using your knowledge of the problem to choose an M as small as possible, while still having a correct model. Or you may find it helpful to scale some variables and constraints by changing the units (e.g., instead of a variable representing the number of units produced, use a variable representing thousands of units produced). Another option could be to use the Gurobi indicator constraint as an alternative to bigM.
I hope this helps,
Dan
0 
Thank you Dan for your answer. I am looking into the different explanation and suggestions you provided.
Another question that is bugging me is that in my case the objective range is equal to 1. Do you have a possible explanation for that? with my little knowledge, I think it should be an interval . Thank you
Objective range [1e+00, 1e+00]
0 
Hello Amal,
Sure, this statistic reports the range of the absolute values of the nonzero coefficients.
Objective range [1e+00, 1e+00]
So the above range indicates that the objective coefficients had values of 1, 0, or 1.
Dan
0 
Dan Steffy, I'm having the same problem mentioned above "Warning: 1 variables dropped from basis." Can you clarify what it means?
0 
Hello Gabriel,
Warning: ... variables dropped from basis.
The above warning is typically a sign that the solver is experiencing numerical difficulties. It occurs when a basis encountered in the simplex algorithm is detected to be singular, and the solver remedies this by dropping some variables from the basis and forming a different basis. This may be done by replacing some structural variables in the basis with slack variables.
If you are experiencing the above warning message, please consult the Guidelines for Numerical Issues or the suggestions earlier in this discussion for guidance on improving the numerical properties of your model.
0
Please sign in to leave a comment.
Comments
7 comments