Bug in Gurobi when modifying QP model with Presolve=0 and Method=2 or -1

193 views
Skip to first unread message

Bob Hughes

unread,
Mar 10, 2016, 3:25:55 AM3/10/16
to Gurobi Optimization
I think there is a bug in Gurobi where, in certain cases, after modifying a model, resetting it, and optimizing it, the model returns the results from the original unmodified model instead of the new model.  I have a reproduction of the error (a C# project), see attached.

Looking at the log file, it seems like the barrier algorithm isn't even invoked for the modified model.

As far as I can tell, it only happens for QP models when Presolve=0 and Method=2 or -1.  If you run the test, it will pass for all values of Presolve and Method except for these values.
GurobiBug.zip

Kostja Siefen

unread,
Mar 14, 2016, 3:46:03 AM3/14/16
to Gurobi Optimization
Hi Bob,

Thank you very much for reporting this issue. It will be fixed in the next technical release (6.5.2).

Kostja

Bob Hughes

unread,
Apr 8, 2016, 2:15:32 AM4/8/16
to Gurobi Optimization
Hi Kostja,

I think there is another, different, bug that also occurs when you modify a model.  See the attached reproduction - loading a model, optimizing it, then modifying the RHS of a linear constraint, then optimizing again causes the second optimization to throw an exception "Gurobi.GRBException: Q matrix is not positive semi-definite (PSD) at Gurobi.GRBModel.Optimize()".  However, if you save down the modified model, reload it, then optimize it, or call Reset on the modified model before optimizing it, it works fine.

Regards,

Bob
GurobiBug.zip

Kostja Siefen

unread,
Apr 11, 2016, 7:04:53 AM4/11/16
to Gurobi Optimization
Hi Bob,

Thanks for your time and effort to report this issue. It is already fixed and will be included in the upcoming technical release (6.5.2).

Kostja

Bob Hughes

unread,
Apr 11, 2016, 6:54:17 PM4/11/16
to Gurobi Optimization
Thanks Kostja - out of interest, was the issue fixed due to my reporting of the issue, or was it already fixed prior to that?

Kostja Siefen

unread,
Apr 12, 2016, 1:45:12 AM4/12/16
to Gurobi Optimization
This issue was fixed as a result of your report. Thanks again!

Kostja

Bob Hughes

unread,
Apr 15, 2016, 12:13:20 AM4/15/16
to Gurobi Optimization
Hi Kostja,

I think there is another unrelated bug.

The attached zip file contains 9 different models (each saved as a .lp file).  When run with Gurobi versions 6.5.0 or 6.5.1 (e.g., using gurobi_cl.exe), each one of them fails with Error 10020 (Q_NOT_PSD).  However, they all solve without error when run with Gurobi version 6.0.4.

Regards,

Bob
qpsd.zip

Kostja Siefen

unread,
Apr 15, 2016, 10:16:04 AM4/15/16
to Gurobi Optimization
Hi Bob,

Thanks again for your report. This is the same issue that we previously fixed and it will be included in versions 6.5.2. In the meantime as a workaround you can convert your objective function from max to min.

Best wishes,
Kostja

Bob Hughes

unread,
May 11, 2016, 10:18:27 PM5/11/16
to Gurobi Optimization
Hi Kostja,

I was experimenting with using SetPWLObj (https://www.gurobi.com/documentation/6.5/refman/cs_grbmodel_setpwlobj.html) and found some issues when the objective function is quadratic.

I've attached two models (model0.lp and model1.lp) which are logically equivalent, the only functional difference being that model0.lp uses sets of linear constraints in places where model1.lp using PWLObj.

Solving model0.lp gives:
Barrier solved model in 15 iterations and 0.16 seconds
Optimal objective 8.75645006e+00

While solving model1.lp gives:
Barrier performed 38 iterations in 0.28 seconds
Numerical trouble encountered

If you then delete the term [ - 6 tdp ^2   ] / 2 from the objective function in both models and try again, then both models give exactly the same answer:
Solved in 16 iterations and 0.07 seconds
Optimal objective  1.022645006e+01

So the issue must be related to the quadratic term and the use of the barrier algorithm somehow.

Regards,

Bob
model1.lp
model0.lp

Sonja Mars

unread,
May 12, 2016, 8:53:36 AM5/12/16
to gur...@googlegroups.com
Hi Bob,

We are currently investigating this issue.

In your models you have for example bounds like this:
pn_5 <= 0.1916666666666667
and like this:
tp_0 <= 0.29

Can you please confirm that the values like 0.29 are not truncated, meaning it really is 0.29 and not something like 0.2916666666666667? This can cause numerical issues and we just want to make sure that with the model everything is correct.

Thanks,
Sonja
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> <model1.lp><model0.lp>

Bob Hughes

unread,
May 12, 2016, 2:31:03 PM5/12/16
to Gurobi Optimization
Thanks Sonja.  I can confirm that none of the values are truncated, the lp files were generated by model.Write(...).

Sonja Mars

unread,
May 13, 2016, 1:02:31 AM5/13/16
to gur...@googlegroups.com
Hi Bob,

Thanks for checking and also thanks for reporting this.

I discussed your issue with the Gurobi developers. They informed me that this is a know issue with our current version and they already fixed it for our upcoming 6.5.2 release. Unfortunately, I don't have a date yet, when this version will be released.

Thanks again and best regards,
Sonja

Sonja Mars

unread,
Jun 30, 2016, 2:24:10 AM6/30/16
to gur...@googlegroups.com
Hi Bob,

This is just to let you know that we released 6.5.2. With this release the reported issue should be fixed. Let us know if you see any further issues.

Thanks and best regards,
Sonja
Reply all
Reply to author
Forward
0 new messages