How to get upper and lower bound in gurobi numerical trouble?
AnsweredGurobi Optimizer version 10.0.2 build v10.0.2rc0 (win64)
CPU model: 13th Gen Intel(R) Core(TM) i9-13900H, instruction set [SSE2|AVX|AVX2]
Thread count: 14 physical cores, 20 logical processors, using up to 20 threads
Optimize a model with 892 rows, 227 columns and 1855 nonzeros
Model fingerprint: 0x2e4d060c
Model has 25878 quadratic objective terms
Model has 1 quadratic constraint
Coefficient statistics:
Matrix range [1e+00, 3e+00]
QMatrix range [7e-08, 7e+00]
QLMatrix range [1e-02, 1e+02]
Objective range [7e-02, 3e+03]
QObjective range [6e-07, 9e+02]
Bounds range [2e-02, 8e-01]
RHS range [1e+00, 1e+00]
QRHS range [3e+03, 3e+03]
Presolve removed 106 rows and 0 columns
Presolve time: 0.01s
Presolved: 945 rows, 387 columns, 18755 nonzeros
Presolved model has 2 second-order cone constraints
Ordering time: 0.00s
Barrier statistics:
AA' NZ : 7.101e+04
Factor NZ : 9.428e+04 (roughly 1 MB of memory)
Factor Ops : 1.132e+07 (less than 1 second per iteration)
Threads : 14
Objective Residual
Iter Primal Dual Primal Dual Compl Time
0 -3.65144973e+06 -1.06626631e+05 1.92e+04 5.07e+02 5.66e+04 0s
1 -1.55886588e+06 -1.69191760e+05 8.06e+03 2.09e+02 2.41e+04 0s
2 -6.15077444e+05 -1.68818541e+05 3.03e+03 1.21e+02 9.40e+03 0s
3 -1.67227954e+05 -1.68686595e+05 8.32e+02 5.73e+01 2.78e+03 0s
4 -7.42635042e+04 -1.34655496e+05 2.71e+02 2.28e+01 9.93e+02 0s
5 -3.25414410e+04 -1.27645683e+05 2.02e+01 2.20e+00 1.55e+02 0s
6 -3.05100030e+04 -6.78161174e+04 1.23e+01 5.60e-01 5.80e+01 0s
7 -2.98998919e+04 -5.68722202e+04 6.08e+00 3.86e-01 3.63e+01 0s
8 -2.94756538e+04 -4.06043271e+04 3.65e+00 1.35e-01 1.51e+01 0s
9 -2.93242602e+04 -3.21634991e+04 2.14e+00 3.20e-02 4.83e+00 0s
10 -2.92312482e+04 -2.99168380e+04 1.28e+00 7.17e-03 2.10e+00 0s
11 -2.91665019e+04 -2.84252782e+04 1.07e+00 3.40e-03 1.47e+00 0s
12 -2.91150395e+04 -2.76693555e+04 9.80e-01 2.75e-03 1.35e+00 0s
13 -2.90749624e+04 -2.69336474e+04 9.36e-01 2.43e-03 1.43e+00 0s
14 -2.89542756e+04 -2.42020119e+04 7.86e-01 1.72e-03 1.58e+00 0s
15 -2.88327706e+04 -2.29284149e+04 7.30e-01 1.61e-03 1.38e+00 0s
16 -2.88141551e+04 -2.00787029e+04 7.03e-01 1.46e-03 1.38e+00 0s
17 -2.87424209e+04 -1.31977559e+04 6.74e-01 1.32e-03 1.40e+00 0s
18 -2.87266812e+04 -5.68018428e+03 6.51e-01 1.29e-03 1.08e+00 0s
19 -2.87442117e+04 2.21589114e+04 6.47e-01 1.27e-03 1.28e+00 0s
20 -2.87297574e+04 5.80449093e+04 6.43e-01 1.32e-03 1.25e+00 0s
21 -2.87317719e+04 5.12343361e+05 6.40e-01 1.99e-03 1.54e+00 0s
22 -2.87318173e+04 2.73101965e+07 6.40e-01 1.97e-03 1.77e+01 0s
23 -3.64370612e+07 -3.84767968e+05 1.92e+05 1.69e+03 2.04e+06 0s
24 -2.41278192e+06 -7.23746062e+04 1.25e+04 1.51e+02 1.79e+04 0s
25 -5.26996672e+05 -5.27122534e+04 2.63e+03 6.99e+01 2.53e+03 0s
26 -3.27757352e+05 -3.74250115e+04 1.67e+03 5.45e+01 1.70e+03 0s
27 -1.98396679e+05 -5.11512940e+04 9.08e+02 2.47e+01 7.42e+02 0s
28 -1.11982672e+05 -3.67371361e+04 4.79e+02 1.69e+01 5.36e+02 0s
29 -7.25235612e+04 -3.44440930e+04 2.44e+02 5.35e+00 2.07e+02 0s
30 -5.99722735e+04 -3.71380497e+04 1.44e+02 3.37e+00 1.39e+02 0s
31 -3.83104508e+04 -3.22315391e+04 5.15e+01 1.84e+00 5.14e+01 0s
32 -3.34278461e+04 -3.05594503e+04 2.99e+01 1.17e+00 3.34e+01 0s
33 -3.09620471e+04 -3.05517937e+04 1.43e+01 4.72e-01 1.54e+01 0s
34 -3.08181025e+04 -3.12303956e+04 7.70e+00 2.65e-01 1.00e+01 0s
35 -2.98721451e+04 -2.98527911e+04 2.69e+00 6.89e-02 2.98e+00 0s
36 -2.95738893e+04 -2.93868683e+04 1.60e+00 2.32e-02 1.60e+00 0s
37 -2.94132551e+04 -2.92327326e+04 1.27e+00 1.71e-02 1.52e+00 0s
38 -2.92263408e+04 -2.87310176e+04 1.14e+00 1.17e-02 2.61e+00 0s
39 -2.89365531e+04 -2.84154536e+04 1.08e+00 1.03e-02 3.83e+00 0s
40 -2.61208600e+04 -2.06276126e+04 1.15e+00 7.99e-04 6.18e+01 0s
41 4.72128157e+04 5.92993554e+05 1.01e+00 7.84e-02 7.24e+03 0s
42* 3.48882295e+07 3.97915122e+07 2.78e-04 1.06e-02 1.03e-01 0s
43* 3.20404957e+10 2.88014221e+10 3.12e-07 7.85e-03 1.02e-04 0s
44* 3.11972253e+13 3.05829682e+13 4.05e-08 7.33e-03 1.07e-07 0s
45* 1.88613918e+16 2.78683658e+16 1.18e-07 7.49e+01 3.12e-10 0s
46* 3.00576132e+17 5.63126894e+17 7.10e-07 2.80e+04 1.38e-11 0s
47* 4.29401508e+17 1.50543185e+20 2.28e-07 1.65e+02 8.44e-10 0s
48* 3.51600336e+18 1.53626040e+20 1.98e-07 9.61e+03 9.32e-11 0s
49* 9.54421037e+19 1.54640515e+20 1.30e-07 1.74e+06 6.35e-11 0s
50* 1.94016765e+21 1.64842456e+20 7.68e-08 3.73e+05 1.65e-10 0s
51* 5.26480943e+21 1.69848209e+21 4.16e-07 4.80e+04 1.11e-10 0s
52* 3.60290492e+22 4.49165509e+21 7.80e-07 6.46e+04 1.81e-10 0s
53* 1.37941948e+23 3.13419728e+22 5.51e-07 9.83e+04 2.90e-10 0s
54* 2.17931713e+23 2.83785832e+23 9.89e-05 8.14e+04 2.97e-10 0s
55* 5.46150043e+23 4.65320522e+23 9.90e-05 1.07e+05 3.60e-10 0s
Barrier performed 55 iterations in 0.20 seconds (0.11 work units)
Numerical trouble encountered
I encountered numerical trouble while using Gurobi, as you can see from the logs above. In this optimization problem, I want to find the upper and lower bounds, but objval and objbound only return NULL. I would like to know if I can determine the bounds from the logs as follows:
Upper Bound: The minimum value of Primal during all iterations, which is -3.65144973e+06.
Lower Bound: The maximum value of Dual during all iterations, which is -1.06626631e+05.
I am looking forward to your assistance.
-
Official comment
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
Hi Yanxin,
I would like to know if I can determine the bounds from the logs as follows:
No, you cannot do this.
Your model includes signs of numerical challenges including a quadratic matrix range of 8 orders of magnitude and tiny coefficient values smaller than the default feasibility/optimality tolerance values of 1e-6. Consider experimenting with different combinations of the parameters below to solve the model to optimality:
- NumericFocus: You can start experimenting with value 1 and increase it to 2 and 3 if the issue persists.
- ScaleFlag: Consider experimenting with values 2 and 0
- Aggregate: Consider turning off the aggregator by setting it to 0
- Presolve: Since presolve tends to worsen the numerics, you can also consider experimenting with a more conservative presolve strategy (1) or turning it completely off (0).
- Quad: Consider setting this parameter to 1 to use a higher precision for Cholesky factorization
Best regards,
Maliheh
0
Post is closed for comments.
Comments
2 comments