Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[solved] Q not PSD error with Gurobi 0.9? #285

Closed
Nikita-Belyak opened this issue Feb 4, 2020 · 12 comments
Closed

[solved] Q not PSD error with Gurobi 0.9? #285

Nikita-Belyak opened this issue Feb 4, 2020 · 12 comments

Comments

@Nikita-Belyak
Copy link

The package Gurobi.jl seems to be not updated in accordance with the current release of the software Gurobi 9.0. As it has been announced on the official website Gurobi 9.0 is already capable of solving non-convex quadratic problems, however, when trying to use the latest version of the software to solve JuMP MIQCQP I receive the following message
image
Could you please have a look at this issue?
Please find attached the .pdf with the formulation of the model I used and .jl with the JuMP formulation of it in the enclosed archive Non-convex MIQCQP example.zip

Screenshot from the gurobi website

@odow
Copy link
Member

odow commented Feb 4, 2020

You need to set the NonConvex parameter to 2. See: https://www.gurobi.com/documentation/9.0/refman/nonconvex.html

model = Model(with_optimizer(Gurobi.Optimizer, NonConvex = 2))

Given the number of complaints about this, it's a little annoying that Gurobi doesn't highlight this more in their documentation.

Edit: I've opened a support ticket: https://support.gurobi.com/hc/en-us/community/posts/360056747952-Suggest-users-set-NonConvex-2-for-non-PSD-quadratics-

@odow odow changed the title Non-convex quadratic problems solver update considering Gurobi 9.0 [solved] Q not PSD error with Gurobi 0.9? Feb 4, 2020
@odow
Copy link
Member

odow commented Feb 4, 2020

I've changed the title because there will undoubtedly be more people that come looking for this question.

@Nikita-Belyak
Copy link
Author

Thank you very much for your help. I just tried that and I got the following
image
Do you know by any chance how to fix this?

@odow
Copy link
Member

odow commented Feb 4, 2020

You need to ensure you have the latest tagged version of Gurobi.jl (0.7.5).

Run

import Pkg
Pkg.update()
Pkg.status()

@Nikita-Belyak
Copy link
Author

Nikita-Belyak commented Feb 4, 2020

received this [2e9cd046] Gurobi v0.7.4
Tried even Pkg.update("Gurobi") but the version remains the same.
Could you please give a bit of advice on how could I possibly overcome this issue?

@odow
Copy link
Member

odow commented Feb 4, 2020

You likely have another package holding you back.

What's the output of Pkg.status()?

In general, you should use Julia environments to avoid this: https://julialang.github.io/Pkg.jl/stable/environments/

@Nikita-Belyak
Copy link
Author

julia> Pkg.status()
Status ~/.julia/environments/v1.2/Project.toml
[07493b3f] Alpine v0.1.3
[7c4d4715] AmplNLWriter v0.5.0
[c52e3926] Atom v0.11.3
[336ed68f] CSV v0.5.23
[9961bab8] Cbc v0.6.6
[a93c6f00] DataFrames v0.20.0
[31c24e10] Distributions v0.22.4
[f6369f11] ForwardDiff v0.10.9
[2e9cd046] Gurobi v0.7.4
[7073ff75] IJulia v1.21.0
[b6b21f68] Ipopt v0.6.1
[4076af6c] JuMP v0.20.1
[e5e0dc1b] Juno v0.7.2
[f4570300] MathOptFormat v0.4.0
[0db19996] NBInclude v2.1.0
[76087f3c] NLopt v0.5.1
[91a5bcdd] Plots v0.28.4
[d330b81b] PyPlot v2.8.2
[fdbf4ff8] XLSX v0.5.8
[9a3f8284] Random
[2f01184e] SparseArrays

@Nikita-Belyak
Copy link
Author

Thank you, I will use a separate project further

@odow
Copy link
Member

odow commented Feb 4, 2020

You can also try ] add Gurobi@0.7.5 and see what the error is.

In general, it isn't recommended to have this many packages in your global environment for precisely this reason. For every project you do, make a new environment with the minimal subset of packages you need.

For example, Alpine and AmplNLWriter are installed at versions which don't support JuMP 0.20. It gets pretty confusing if lots of packages are all fighting for version requirements.

@Nikita-Belyak
Copy link
Author

Thank you very much for your help. I just solved it

@odow
Copy link
Member

odow commented Feb 11, 2020

In good news, the next version of Gurobi will have a more informative error message.

@odow
Copy link
Member

odow commented May 4, 2020

Closing. Fixed by new error message in Gurobi 9.0.2.

@odow odow closed this as completed May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants