Weaker constraint returns worse solutionAwaiting user input
Me and a colleague are working on a MIP with a linear objective, trying to reconfigure a network (0 = off, 1 = on) with a constraint on allowed switch events. When allowing more switch events (increasing a parameter at the rhs of one of our inequality constraints), the model returns a worse solution than when this constraint was tighter. We suspect this is due to some numerical issue, possibly concerning integrality but do not know how. It should be added that when we have a more conservative presolve (presolve = 1), the optimal solution is sometimes improved, sometimes not. The same goes for ScaleFlag. How can this be the case? Can presolve accidentally remove the optimal solution? (Parts of) the output looks as follows:
Optimize a model with 570308 rows, 855992 columns and 2557949 nonzeros
Model fingerprint: 0xa8afd1eb
Model has 3192 quadratic constraints
Variable types: 287814 continuous, 568178 integer (568178 binary)
Matrix range [1e-03, 5e+02]
QMatrix range [3e-07, 1e+00]
QLMatrix range [1e+00, 1e+00]
Objective range [1e+00, 1e+00]
Bounds range [2e-03, 5e+02]
RHS range [1e+00, 1e+03]
QRHS range [8e-10, 4e-02]
Presolve removed 568045 rows and 852006 columns
Presolve time: 1.60s
Presolved: 17486 rows, 8309 columns, 49902 nonzeros
Presolved model has 1 quadratic constraint(s)
Presolved model has 1589 bilinear constraint(s)
Variable types: 7280 continuous, 1029 integer (1027 binary)
Root relaxation: objective -2.000000e-01, 10146 iterations, 0.79 seconds (0.85 work units)
Thanks in advance!
/Gabriel and Lovisa
Hi Gabriel and Lovisa,
Just from looking at the Coefficient statistics of your model, it is very likely that the algorithm runs into numerical issues and can as a result provide contradicting results. We provide a lot of details about scaling and good model formulations in our Guidelines for Numerical Issues. You should definitely try playing with the NumericFocus parameter.
the model returns a worse solution than when this constraint was tighter.
Did you try writing out the solution to a sol file and providing it as MIP Start for the other formulation? You can write the solution from command line via the ResultFile parameter or via the write method if you are using gurobipy.
Please sign in to leave a comment.