Skip to content

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

@junglegobs

Description

@junglegobs

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions