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

Obtaining duals of convex problem with second order cone constraints not possible using Gurobi optimizer #217

Closed
junglegobs opened this issue Jun 20, 2019 · 2 comments · Fixed by #216
Labels
Wrapper: MathOptInterface Issue is specific to MOI wrapper

Comments

@junglegobs
Copy link

I have a convex problem (which therefore should have duals) yet these don't seem to work. I can solve the problem just fine, but if I try to obtain the duals of a constraint I either get NaN or AssertionError: dual >= 0.0. Minimum working example below, I'm guessing it might be specific to Gurobi?

using JuMP
using Gurobi

m = Model(with_optimizer(Gurobi.Optimizer))

@variable(m, x >= 0)
@variable(m, y >= 0)
@variable(m, z >= 0)

@constraint(m, con1, x + y == 2)
@constraint(m, con2, x + y + z >= 0)
@constraint(m, con3, x^2 >= y^2 + z^2)

optimize!(m)

dual(con1)
dual(con2)
dual(con3)
@odow
Copy link
Member

odow commented Jun 20, 2019

Yes, this is specific to Gurobi. I'm currently re-writing the wrapper (#216) and something weird is going on. I'll investigate.

I'm going to transfer this issue to Gurobi.jl.

@odow odow transferred this issue from jump-dev/JuMP.jl Jun 20, 2019
@odow odow added the Wrapper: MathOptInterface Issue is specific to MOI wrapper label Jun 20, 2019
@odow
Copy link
Member

odow commented Jun 20, 2019

Gurobi will only compute duals for QCP problems if you pass QCPDual=1. See https://groups.google.com/d/msg/gurobi/hq6EvyT-mxs/hlVX3sTLAQAJ

This is fixed in the wrapper re-write. See f164589

@odow odow closed this as completed in #216 Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Wrapper: MathOptInterface Issue is specific to MOI wrapper
Development

Successfully merging a pull request may close this issue.

2 participants