diff --git a/src/optiedge.jl b/src/optiedge.jl index ebf4736..b01d11c 100644 --- a/src/optiedge.jl +++ b/src/optiedge.jl @@ -118,10 +118,9 @@ function JuMP.constraint_object(linkref::LinkConstraintRef) return linkref.optiedge.linkconstraints[linkref.idx] end -#TODO: Update this function JuMP.dual(linkref::LinkConstraintRef) optiedge = JuMP.owner_model(linkref) - id = optiedge.backend.last_solution_id + # this grabs the last solution return MOI.get(optiedge.backend, MOI.ConstraintDual(), linkref) end diff --git a/src/optigraph.jl b/src/optigraph.jl index 7a4e1e0..f30456e 100644 --- a/src/optigraph.jl +++ b/src/optigraph.jl @@ -889,8 +889,9 @@ Retrieve the dual value of `linkref` on optigraph `graph`. """ function JuMP.dual(graph::OptiGraph, linkref::LinkConstraintRef) optiedge = JuMP.owner_model(linkref) - id = graph.id - return MOI.get(optiedge.backend, MOI.ConstraintDual(), linkref) + edge_pointer = optiedge.backend.optimizers[graph.id] + dual_value = MOI.get(optiedge.backend, MOI.ConstraintDual(), linkref) + return dual_value end # set start value for a graph backend