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

[feature] JuMP: Support accessing the attribute MathOptInterface.ConstraintDual(1) #169

Open
oyamad opened this issue May 13, 2019 · 1 comment

Comments

@oyamad
Copy link
Member

oyamad commented May 13, 2019

Is it possible to get the dual solution from a JuMP model constructed from a polyhedron?

using Polyhedra
using JuMP
using Clp
using LinearAlgebra

hrep = HalfSpace([-1, 0], 0)  HalfSpace([0, -1], 0)  HalfSpace([1, 1], 1)
model = Model(with_optimizer(Clp.Optimizer, LogLevel=0))
@variable(model, x[1:2])
con = @constraint(model, x in hrep)
@objective(model, Max, dot([1, 0], x))
optimize!(model)
value.(x)
2-element Array{Float64,1}:
  1.0
 -0.0

But dual and shadow_price do not work:

dual(con)
ArgumentError: Constraint bridge of type `Polyhedra.PolyhedraToLPBridge{Float64,MathOptInterface.ScalarAffineFunction{Float64}}` does not support accessing the attribute `MathOptInterface.ConstraintDual(1)`.

...
shadow_price(con)
The shadow price is not defined or not implemented for this type of constraint.

...
@blegat
Copy link
Member

blegat commented May 13, 2019

Not yet. We need to figure out what it would be.
It could be a struct providing a mapping between H-Rep indices and the dual of the corresponding constraint

@oyamad oyamad changed the title JuMP: accessing the attribute MathOptInterface.ConstraintDual(1) [feature] JuMP: Support accessing the attribute MathOptInterface.ConstraintDual(1) May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants