Can't get the example dualization to work

I can’t seem to get the first motivating example in Dualization.jl to work (at https://jump.dev/Dualization.jl/dev/examples/)

using JuMP, Dualization
model = Model()
@variable(model, x)
@variable(model, y)
@variable(model, z)
@constraint(model, soccon, [x; y; z] in SecondOrderCone())
@constraint(model, eqcon, x == 1)
@objective(model, Min, y + z)
dual_model = dualize(model)

yields

julia> print(model)
Min y + z
Subject to
 eqcon : x = 1
 soccon : [x, y, z] ∈ MathOptInterface.SecondOrderCone(3)

julia> print(dual_model)
Max _[1]
Subject to
 [-_[1], 1, 1] ∈ MathOptInterface.SecondOrderCone(3)

and in particular dual_model doesn’t recover all the constraints.

I’m on the following versions:

⌃ [191a621a] Dualization v0.5.9
⌃ [4076af6c] JuMP v1.25.0
⌃ [b8f27783] MathOptInterface v1.38.0
1 Like

Welcome to the forum. I believe the dual you get is correct.
The dual of the standard form conic model:

min c'x
Ax = b
x in K

is

max b'y
c - A'y in K

In this case, A = [1 0 0], b = [1], c = [0, 1, 1] and K = SecondOrderCone(3).
Let me know if that clarifies things.
It may be clearer to enable names:

julia> println(dualize(model, dual_names = DualNames()))
┌ Warning: dual names for constrained vector of variables not supported yet.
└ @ Dualization ~/.julia/dev/Dualization/src/dual_equality_constraints.jl:178
Max eqcon
Subject to
 [-eqcon, 1, 1] ∈ MathOptInterface.SecondOrderCone(3)

The warning is because we should set the name soccon to the SOC constraints of the dual but this is not implemented yet.

Hi @brandon-lee-17, welcome to the forum.

I guess your point is that the docs say

but we have substituted soccon out of the formulation.

@blegat: is this intended behavior? If so, we should update the docs.

Yes, the doc was written before we add constrained variables, we should update it