Skip to content

Commit

Permalink
fix issue with querying wrong graph backend on subgraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
jalving committed Jan 29, 2024
1 parent b5e10cc commit b8d8205
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/optigraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Base.show(io::IO, graph::OptiGraph) = Base.print(io, graph)
# JuMP.value_type(::Type{OptiGraph{T}}) where {T} = T

function graph_backend(graph::OptiGraph)
return graph.backend
return graph.optimizer_graph.backend
end

### Add subgraph
Expand Down Expand Up @@ -108,7 +108,7 @@ function add_node(
node_index = NodeIndex(length(graph.optinodes)+1)
optinode = OptiNode{OptiGraph}(graph, node_index, label)
push!(graph.optinodes, optinode)
add_node(graph.backend, optinode)
add_node(graph_backend(graph), optinode)
return optinode
end

Expand All @@ -134,7 +134,7 @@ function add_edge(
)
edge = OptiEdge{OptiGraph}(graph, label, OrderedSet(collect(nodes)))
push!(graph.optiedges, edge)
add_edge(graph.backend, edge)
add_edge(graph_backend(graph), edge)
return edge
end

Expand Down

0 comments on commit b8d8205

Please sign in to comment.