Skip to content

Commit

Permalink
Updated function for calling dual on different subgraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
dlcole3 committed Sep 26, 2023
1 parent 6a371f5 commit 3df7e3f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/optigraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,14 @@ 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)

last_solution_id = optiedge.backend.last_solution_id
optiedge.backend.last_solution_id = graph_id

dual_value = MOI.get(optiedge.backend, MOI.ConstraintDual(), linkref)
optiedge.backend.last_solution_id = last_solution_id

return dual_value
end

# set start value for a graph backend
Expand Down

0 comments on commit 3df7e3f

Please sign in to comment.