API Documentation
OptiGraph Methods
Plasmo.OptiGraph — Type
OptiGraphThe core modeling object of Plasmo.jl. An optigraph represents an optimization model as a set of OptiNode and OptiEdge objects.
Plasmo.OptiNode — Type
OptiNode{GT<:AbstractOptiGraph} <: AbstractOptiNodeA data structure meant to encapsulate variables, constraints, an objective function, and other model data. An optinode is "lightweight" in the sense that it does not directly contain model data, but instead acts as an interface that maps to a backend where the model data is stored. This avoids the need to generate memory overhead through container structures in cases when a node contains very little model data.
Plasmo.OptiEdge — Type
OptiEdge{GT<:AbstractOptiGraph} <: AbstractOptiEdgeA data structure meant to encapsulate linking constraints and other model data. An optiedge is "lightweight" in the sense that it does not directly contain model data, but instead acts as an interface that maps to a backend where the model data is stored. This avoids the need to generate memory overhead through container structures in cases when a node contains very little model data.
Plasmo.@optinode — Macro
@optinode(optigraph, expr...)Add a new optinode to optigraph. The expression expr can either be
- of the form
nodenamecreating a single optinode with the variable namevarname - of the form
nodename[...]or[...]creating a container of optinodes using JuMP Containers
Plasmo.@linkconstraint — Macro
@linkconstraint(graph::OptiGraph, expr)Add a linking constraint described by the expression expr.
@linkconstraint(graph::OptiGraph, ref[i=..., j=..., ...], expr)Add a group of linking constraints described by the expression expr parametrized by i, j, ...
The @linkconstraint macro works the same way as the JuMP.@constraint macro.
Plasmo.@nodevariables — Macro
@nodevariables(iterable, expr...)Call the JuMP.@variable macro for each optinode in a given container
Plasmo.set_to_node_objectives — Function
set_to_node_objectives(graph::OptiGraph)Set the graph objective to the summation of all of its optinode objectives. Assumes the objective sense is an MOI.MIN_SENSE and accounts for the sense of node objectives accordingly.
Note that building nonlinear objective functions is much slower than linear or quadratic because nonlienar expressions cannot be updated in place.
Plasmo.graph_backend — Function
graph_backend(graph::OptiGraph)Return the intermediate backend used to map the optigraph to an optimizer. Plasmo.jl currently only supports a backend to MathOptInterface.jl optimizers, but future versions intend to support GraphOptInterface.jl as a structured backend.
graph_backend(node::OptiNode)Return the GraphMOIBackend that holds the associated node model attributes
graph_backend(edge::OptiEdge)Return the GraphMOIBackend that holds the associated edge model attributes
Plasmo.graph_index — Function
graph_index(ref::RT) where {RT<:Union{NodeVariableRef,ConstraintRef}}Return the the corresponding variable or constraint index corresponding to a reference.
graph_index(
backend::GraphMOIBackend,
ref::RT
) where {RT<:Union{NodeVariableRef,ConstraintRef}}Return the actual variable or constraint index of the backend model that corresponds to the local index of a node or edge.
Plasmo.source_graph — Function
source_graph(node::OptiNode)Return the optigraph that contains the optinode. This is the optigraph that defined said node and stores node object dictionary data.
source_graph(edge::OptiEdge)Return the optigraph that contains the optiedge. This is the optigraph that defined said edge and stores edge object dictionary data.
Plasmo.add_subgraph — Function
add_subgraph(graph::OptiGraph; name::Symbol=Symbol(:sg, Symbol(UUIDs.uuid4())))Create and add a new subgraph to the optigraph graph.
add_subgraph(graph::OptiGraph; name::Symbol=Symbol(:sg, Symbol(UUIDs.uuid4())))Add an existing subgraph to an optigraph. The subgraph cannot already be part of another optigraph. It also should not have nodes that already exist in the optigraph.
Plasmo.add_subgraph(rgraph::RemoteOptigraph; worker::Int=1)Add a RemoteOptiGraph as a subgraph to rgraph. This instantiates a new RemoteOptiGraph that contains a remote graph on worker worker
add_subgraph(rgraph::RemoteOptiGraph, rsubgraph::RemoteOptiGraph)Add rsubgraph as a subgraph to rgraph
Plasmo.local_subgraphs — Function
local_subgraphs(graph::OptiGraph)::Vector{OptiGraph}Retrieve the local subgraphs of graph.
Plasmo.local_subgraphs(rgraph::RemoteOptiGraph)Returns the vector of sub-RemoteOptiGraphs stored directly on rgraph Does not include subgraphs nested in subgraphs
Plasmo.all_subgraphs — Function
all_subgraphs(graph::OptiGraph)::Vector{OptiGraph}Retrieve all subgraphs of graph. Includes subgraphs within other subgraphs.
Plasmo.all_subgraphs(rgraph::RemoteOptiGraph)Returns a vector of all sub-RemoteOptiGraphs contained in rgraph and all sub-RemoteOptiGraphs nested within any of these sub-RemoteOptiGraphs.
Plasmo.num_local_subgraphs — Function
num_local_subgraphs(graph::OptiGraph)::IntRetrieve the number of local subgraphs in graph. Does not include graph in subgraphs.
Plasmo.num_local_subgraphs(rgraph::RemoteOptiGraph)Returns the number of sub-RemoteOptiGraphs stored directly on rgraph Does not include subgraphs nested in subgraphs
Plasmo.num_subgraphs — Function
num_subgraphs(graph::OptiGraph)::IntRetrieve the total number of subgraphs in graph. Include subgraphs within subgraphs.
Plasmo.num_subgraphs(rgraph)Returns the number of all sub-RemoteOptiGraphs contained in rgraph, including subgraphs of subgraphs
Plasmo.add_node — Function
add_node(
graph::OptiGraph; label=Symbol(graph.label, Symbol(".n"), length(graph.optinodes)+1
)Add a new optinode to graph. By default, the node label is set to be "n<i+1>" where "i" is the number of nodes in the graph.
add_node(graph::OptiGraph, node::OptiNode)Add an existing optinode (created in another optigraph) to graph. This copies model data from the other graph to the new graph.
add_node(rgraph::RemoteOptiGraph)Add a new optinode to rgraph.
add_node(rgraph::RemoteOptiGraph, label::Symbol)Add a new optinode to rgraph with the name label
Plasmo.get_node — Function
get_node(graph::OptiGraph, idx::Int)Retrieve the optinode in graph at the given index.
Plasmo.local_nodes — Function
local_nodes(graph::OptiGraph)::Vector{<:OptiNode}Retrieve the optinodes defined within the optigraph graph. This does not return nodes that exist in subgraphs.
Plasmo.local_nodes(rgraph::RemoteOptiGraph)Returns a vector of RemoteNodeRefs for all nodes stored on rgraph's remote OptiGraph. This returns all nodes on remote OptiGraph, but none of the nodes on the sub-RemoteOptiGraphs.
NOTE: the remote OptiGraph stored on rgraph may contain multiple sub-opitgraphs, and this function still returns all nodes contained on these "local" subgraphs.
Plasmo.all_nodes — Function
all_nodes(graph::OptiGraph)::Vector{<:OptiNode}Recursively collect all optinodes in graph by traversing each of its subgraphs.
Plasmo.all_nodes(rgraph::RemoteOptiGraph)Returns a vector of RemoteNodeRefs for all nodes stored on remote OptiGraphs on rgraph and all of its subgraphs
Plasmo.collect_nodes — Function
collect_nodes(jump_func::T where T <: JuMP.AbstractJuMPScalar)Retrieve the optinodes contained in a JuMP expression.
Plasmo.num_local_nodes — Function
num_local_nodes(graph::OptiGraph)::IntReturn the number of local nodes in the optigraph graph.
Plasmo.num_nodes — Function
num_nodes(graph::OptiGraph)::IntReturn the total number of nodes in graph by recursively checking subgraphs.
Plasmo.num_local_variables — Function
num_local_variables(graph::OptiGraph)Return the number of local variables in graph. Does not include variables in subgraphs.
num_local_variables(rgraph::RemoteOptiGraph)Return the number of variables stored on the OptiGraph of the RemoteOptiGraph Does not include variables on subgraphs
Plasmo.add_edge — Function
add_edge(
graph::OptiGraph,
nodes::OptiNode...;
label=Symbol(graph.label, Symbol(".e"), length(graph.optiedges) + 1),
)Add a new optiedge to graph that connects nodes. By default, the edge label is set to be "e<i+1>" where "i" is the number of edges in the graph.
add_edge(graph::OptiGraph, edge::OptiEdge)Add an existing optiedge (created in another optigraph) to graph. This copies model data from the other graph to the new graph.
Plasmo.get_edge — Function
get_edge(graph::OptiGraph, nodes::Set{<:OptiNode})Retrieve the optiedge in graph. that connects nodes.
get_edge(graph::OptiGraph, nodes::OptiNode...)Convenience method. Retrieve the optiedge in graph that connects nodes.
get_edge(rgraph::RemoteOptiGraph, rnodes::Set{<:RemoteNodeRef})Retrieve the remote optiedge in rgraph that connects rnodes.
get_edge(rgraph::RemoteOptiGraph, rnodes::RemoteNodeRef...)Convenience method. Retrieve the remote optiedge in rgraph that connects rnodes.
Plasmo.get_edge_by_index — Function
get_edge_by_index(graph::OptiGraph, idx::Int64)Retrieve the optiedge in graph that corresponds to the given index.
get_edge_by_index(rgraph::RemoteOptiGraph, idx::Int64)Retrieve the remote optiedge in graph that corresponds to the given index.
Plasmo.has_edge — Function
has_edge(graph::OptiGraph, nodes::Set{<:OptiNode})Return whether an edge that connects nodes exists in the graph.
Plasmo.local_edges — Function
local_edges(graph::OptiGraph)Retrieve the edges that exists in graph. Does not return edges that exist in subgraphs.
local_edges(rgraph::RemoteOptiGraph)Retrieve the edges that exists in rgraph. Does not return edges that exist in subgraphs.
Plasmo.all_edges — Function
all_edges(graph::OptiGraph)::Vector{<:OptiNode}Recursively collect all optiedges in graph by traversing each of its subgraphs.
all_edges(rgraph::RemoteOptiGraph)::Vector{<:InterWorkerEdge}Recursively collect all remote optiedges in rgraph by traversing each of its subgraphs.
Plasmo.num_local_edges — Function
num_local_edges(graph::OptiGraph)::IntReturn the number of local edges in the optigraph graph.
num_local_edges(rgraph::RemoteOptiGraph)::IntReturn the number of local edges in the optigraph rgraph.
Plasmo.num_edges — Function
num_edges(graph::OptiGraph)::IntReturn the total number of nodes in graph by recursively checking subgraphs.
num_edges(graph::RemoteOptiGraph)::IntReturn the total number of edges in graph by recursively checking subgraphs.
Plasmo.num_local_link_constraints — Function
num_local_link_constraints(
graph::OptiGraph,
func_type::Type{<:Union{JuMP.AbstractJuMPScalar,Vector{<:JuMP.AbstractJuMPScalar}}},
set_type::Type{<:MOI.AbstractSet},
)Retrieve the number of local linking constraints with function func_type and set set_type in graph. Does not include linking constraints in subgraphs.
num_local_link_constraints(graph::OptiGraph)Retrieve the number of local linking constraints (all constraint types) in graph. Does not include linking constraints in subgraphs.
Plasmo.num_link_constraints — Function
num_link_constraints(
graph::OptiGraph,
func_type::Type{<:Union{JuMP.AbstractJuMPScalar,Vector{<:JuMP.AbstractJuMPScalar}}},
set_type::Type{<:MOI.AbstractSet},
)Retrieve the total number of linking constraints with function func_type and set set_type in graph. Includes constraints in subgraphs.
num_link_constraints(graph::OptiGraph)Retrieve the number of local linking constraints (all constraint types) in graph. Does not include constraints in subgraphs.
Plasmo.local_link_constraints — Function
local_link_constraints(
graph::OptiGraph,
func_type::Type{<:Union{JuMP.AbstractJuMPScalar,Vector{<:JuMP.AbstractJuMPScalar}}},
set_type::Type{<:MOI.AbstractSet},
)Retrieve the local linking constraints with function func_type and set set_type in graph. Does not include linking constraints in subgraphs.
local_link_constraints(graph::OptiGraph)Retrieve the local linking constraints (all constraint types) in graph. Does not include constraints in subgraphs.
Plasmo.all_link_constraints — Function
all_link_constraints(
graph::OptiGraph,
func_type::Type{<:Union{JuMP.AbstractJuMPScalar,Vector{<:JuMP.AbstractJuMPScalar}}},
set_type::Type{<:MOI.AbstractSet},
)Retrieve all linking constraints with function func_type and set set_type in graph. Does not include constraints in subgraphs.
all_link_constraints(graph::OptiGraph)Retrieve all linking constraints (all constraint types) in graph. Includes linking constraints in subgraphs.
Plasmo.num_local_constraints — Function
num_local_constraints(
graph::OptiGraph,
func_type::Type{<:Union{JuMP.AbstractJuMPScalar,Vector{<:JuMP.AbstractJuMPScalar}}},
set_type::Type{<:MOI.AbstractSet},
)Retrieve the number of local constraints with function func_type and set set_type in graph. Does not include constraints in subgraphs.
num_local_constraints(graph::OptiGraph; count_variable_in_set_constraints = false)Retrieve the number of local constraints (all constraint types) in graph. Does not include constraints in subgraphs.
Plasmo.local_constraints — Function
local_constraints(
graph::OptiGraph,
func_type::Type{<:Union{JuMP.AbstractJuMPScalar,Vector{<:JuMP.AbstractJuMPScalar}}},
set_type::Type{<:MOI.AbstractSet},
)Retrieve the local constraints with function func_type and set set_type in graph. Does not include constraints in subgraphs.
local_constraints(graph::OptiGraph)Retrieve the local constraints (all constraint types) in graph. Does not include constraints in subgraphs.
Plasmo.local_elements — Function
local_elements(graph::OptiGraph)Retrieve the local elements (nodes and edges) in graph. Does not include elements in subgraphs.
Plasmo.all_elements — Function
local_elements(graph::OptiGraph)Retrieve all elements (nodes and edges) in graph. Includes elements in subgraphs.
Base.getindex — Method
Base.getindex(graph::OptiGraph, idx::Int)Get the optinode at the given index.
JuMP.jl Extended Methods
JuMP.set_name — Function
JuMP.set_name(graph::OptiGraph, name::Symbol)Set the name of graph to name.
JuMP.index — Function
JuMP.index(graph::OptiGraph, nvref::NodeVariableRef)Return the backend model index of node variable nvref
JuMP.backend — Function
JuMP.backend(graph::OptiGraph)Return the backend model object for graph.
JuMP.value — Function
JuMP.value(graph::OptiGraph, nvref::NodeVariableRef; result::Int=1)Return the primal value of nvref in graph. Note that this value is specific to the optimizer solution to the graph. The nvref can have different values for different optigraphs it is contained in.
JuMP.add_variable — Function
JuMP.add_variable(node::OptiNode, v::JuMP.AbstractVariable, name::String="")Add variable v to optinode node. This function supports use of the @variable JuMP macro. Optionally add a base_name to the variable for printing.
JuMP.add_variable(rnode::RemoteNodeRef, v::JuMP.AbstractVariable, name::String="")Add variable v to RemoteNodeRef rnode. This function supports use of the @variable JuMP macro. Optionally add a base_name to the variable for printing.
JuMP.num_variables — Function
JuMP.num_variables(graph::OptiGraph)Return the total number of variables in graph.
JuMP.num_variables(rgraph::RemoteOptiGraph)Return the total number of variables stored on the OptiGraph of the RemoteOptiGraph including variables stored on all subgraphs
JuMP.all_variables — Function
JuMP.all_variables(graph::OptiGraph)Return all of the variables in graph.
JuMP.local_variables(rgraph::RemoteOptiGraph)Return all of the variables stored on the OptiGraph of the RemoteOptiGraph including all sub-RemoteOptiGraphs
JuMP.local_variables(rgraph::RemoteNodeRef)Return all of the variables stored on the OptiNode represented by RemoteNodeRef
JuMP.start_value — Function
JuMP.start_value(graph::OptiGraph, nvref::NodeVariableRef)Return the start value for variable nvref in graph. Note that different graphs can have different start values for node variables.
JuMP.set_start_value — Function
JuMP.set_start_value(
graph::OptiGraph,
nvref::NodeVariableRef,
value::Union{Nothing,Real}
)Set the start value of variable nvref in graph. Note that different graphs can have different start values for node variables.
JuMP.add_constraint — Function
JuMP.add_constraint(graph::OptiGraph, con::JuMP.AbstractConstraint, name::String="")Add a new constraint to graph. This method is called internally when a user uses the JuMP.@constraint macro.
JuMP.add_constraint(node::OptiNode, con::JuMP.AbstractConstraint, name::String="")Add a constraint con to optinode node. This function supports use of the @constraint JuMP macro.
JuMP.add_constraint(rgraph::RemoteOptiGraph, con::JuMP.AbstractConstraint, name::String="")Add a new constraint to rgraph (which will be placed on rgraph's remote OptiGraph if applicable). This method is called internally when a user uses the JuMP.@constraint macro.
JuMP.add_constraint(rnode::RemoteNodeRef, con::JuMP.AbstractConstraint, name::String="")Add a constraint con to the node which rnode represents. This function supports use of the @constraint JuMP macro.
JuMP.list_of_constraint_types — Function
JuMP.list_of_constraint_types(graph::OptiGraph)::Vector{Tuple{Type,Type}}List all of the constraint types in graph.
JuMP.num_constraints — Function
JuMP.num_constraints(
graph::OptiGraph,
func_type::Type{<:Union{JuMP.AbstractJuMPScalar,Vector{<:JuMP.AbstractJuMPScalar}}},
set_type::Type{<:MOI.AbstractSet},
)Return all the number of contraints in graph with func_type and set_type.
JuMP.num_constraints(graph::OptiGraph; count_variable_in_set_constraints=true)Return the total number of constraints in graph. If count_variable_in_set_constraints is set to true, this also includes variable bound constraints.
JuMP.num_constraints(
element::OptiElement,
function_type::Type{
<:Union{JuMP.AbstractJuMPScalar,Vector{<:JuMP.AbstractJuMPScalar}},
},set_type::Type{<:MOI.AbstractSet})::Int64Return the total number of constraints on an element.
JuMP.all_constraints — Function
JuMP.all_constraints(
graph::OptiGraph,
func_type::Type{
<:Union{JuMP.AbstractJuMPScalar,Vector{<:JuMP.AbstractJuMPScalar}},
},
set_type::Type{<:MOI.AbstractSet}
)Return all of the constraints in graph with func_type and set_type.
JuMP.all_constraints(graph::OptiGraph)Return all of the constraints in graph (all function and set types).
JuMP.objective_value — Function
JuMP.objective_value(graph::OptiGraph)Retrieve the current objective value on optigraph graph.
JuMP.dual_objective_value — Function
JuMP.dual_objective_value(graph::OptiGraph; result::Int=1)Return the dual objective value for graph. Specify result for cases when a solver returns multiple results.
JuMP.objective_sense — Function
JuMP.objective_sense(graph::OptiGraph)Return the objective sense for graph.
JuMP.objective_function — Function
JuMP.objective_function(graph::OptiGraph)Return the objective function for graph.
JuMP.objective_function_type — Function
JuMP.objective_sense(graph::OptiGraph)Return the objective function type for graph.
JuMP.objective_bound — Function
JuMP.objective_bound(graph::OptiGraph)Return the objective bound for the current solution for graph.
JuMP.set_objective — Function
JuMP.set_objective(
graph::OptiGraph,
sense::MOI.OptimizationSense,
func::JuMP.AbstractJuMPScalar
)Set the objective function and objective sense for graph. This method is called internally when a user uses the JuMP.@objective macro.
JuMP.set_objective_function — Function
JuMP.set_objective_function(graph::OptiGraph, expr::JuMP.AbstractJuMPScalar)Set the objective function of graph.
JuMP.set_objective_sense — Function
JuMP.set_objective_sense(graph::OptiGraph, sense::MOI.OptimizationSense)Set the objective sense of graph.
JuMP.set_objective_coefficient — Function
JuMP.set_objective_coefficient(
graph::OptiGraph,
variable::NodeVariableRef,
coeff::Real
)Set the objective function coefficient for variable to coefficient coeff.
JuMP.set_optimizer — Function
JuMP.set_optimizer(
graph::OptiGraph,
JuMP.@nospecialize(optimizer_constructor);
add_bridges::Bool=true
)Set the optimizer on graph by passing an optimizer_constructor.
JuMP.set_optimizer(
node::OptiNode,
JuMP.@nospecialize(optimizer_constructor);
add_bridges::Bool=true
)Set the optimizer for an optinode.This internally creates a new optigraph that is used to optimize the node. Calling this method on a node returns the newly created graph.
JuMP.add_nonlinear_operator — Function
JuMP.add_nonlinear_operator(
graph::OptiGraph,
dim::Int,
f::Function,
args::Vararg{Function,N};
name::Symbol=Symbol(f),
) where {N}Add a nonlinear operator to a graph.
JuMP.optimize! — Function
JuMP.optimize!(
graph::OptiGraph;
kwargs...,
)Optimize graph using the current set optimizer.
JuMP.termination_status — Function
JuMP.termination_status(graph::OptiGraph)Return the solver termination status of graph if a solver has been executed.
JuMP.primal_status — Function
JuMP.primal_status(graph::OptiGraph; result::Int=1)Return the primal status of graph if a solver has been executed.
JuMP.dual_status — Function
JuMP.dual_status(graph::OptiGraph; result::Int=1)Return the dual status of graph if a solver has been executed.
JuMP.relative_gap — Function
JuMP.relative_gap(graph::OptiGraph)Return the relative gap in the current solution for graph.
JuMP.constraint_ref_with_index — Function
JuMP.constraint_ref_with_index(
element::OptiElement,
idx::MOI.ConstraintIndex{<:MOI.AbstractScalarFunction, <:MOI.AbstractScalarSet}
)Return a ConstraintRef given an optigraph element and MOI.ConstraintIndex. Note that the index is the index corresponding to the graph backend, not the element index.
JuMP.constraint_ref_with_index(backend::GraphMOIBackend, idx::MOI.Index)Return the constraint reference (or variable reference) associated with the graph index in backend. Returns a JuMP.ConstraintRef (or NodeVariableRef) object.
JuMP.object_dictionary — Function
JuMP.object_dictionary(graph::OptiGraph)Return the object dictionary for graph.
Interop with JuMP.jl
Plasmo.set_jump_model — Function
Set a JuMP.Model to `node`. This copies the model data over and does not mutatethe model in any way.
Graph Projections
Plasmo.GraphProjection — Type
GraphProjectionA mapping between OptiGraph elements (nodes and edges) and elements in a graph projection. A graph projection can be for example a hypergraph, a bipartite graph or a standard graph.
Plasmo.hyper_projection — Function
hyper_projection(graph::OptiGraph)Retrieve a hypergraph representation of the optigraph graph. Returns a GraphProjection that maps elements between the optigraph and the projected graph.
Plasmo.edge_hyper_projection — Function
edge_hyper_projection(graph::OptiGraph)Retrieve an edge-hypergraph representation of the optigraph graph. This is sometimes called the dual-hypergraph representation of a hypergraph.
Plasmo.clique_projection — Function
clique_projection(graph::OptiGraph)Retrieve a standard graph representation of graph. The projection contains a standard Graphs.Graph and a mapping between its elements and the given optigraph. This projection works by creating an edge for each pair of nodes in each hyperedge.
Plasmo.edge_clique_projection — Function
edge_clique_projection(graph::OptiGraph)Retrieve the edge-graph representation of optigraph graph. This is sometimes called the line graph of a hypergraph.
Plasmo.bipartite_projection — Function
bipartite_graph(graph::OptiGraph)Create a bipartite graph representation from graph. The bipartite graph contains two sets of vertices corresponding to optinodes and optiedges respectively.
Partitioning and Aggregation
Plasmo.Partition — Type
PartitionA data structure that describes a (possibly recursive) graph partition.
Plasmo.assemble_optigraph — Function
assemble_optigraph(nodes::Vector{<:OptiNode}, edges::Vector{OptiEdge})Create a new optigraph from a collection of nodes and edges.
Assemble a new optigraph from a given `Partition`.Plasmo.apply_partition! — Function
apply_partition!(graph::OptiGraph, partition::Partition)Generate subgraphs in an optigraph using a partition.
Plasmo.aggregate — Function
aggregate(graph::OptiGraph; name=Symbol(UUIDs.uuid4()))Aggregate an optigraph into a graph containing a single optinode. An optional name can be used to name the new optigraph. Returns the new optinode (which points to a new graph with source_graph(node)) and a mapping from the original graph variables and constraints to the new node variables and constraints.
Plasmo.aggregate_to_depth — Function
aggregate_to_depth(graph::OptiGraph, max_depth::Int64=0)Aggregate graph by converting subgraphs into optinodes. The max_depth determines how many levels of subgraphs remain in the new aggregated optigraph. For example, a max_depth of 0 signifies there should be no subgraphs in the aggregated optigraph. Return a new aggregated optigraph and reference map that maps elements from the old optigraph to the new aggregate optigraph.
Plasmo.aggregate_to_depth! — Function
aggregate_to_depth!(graph::OptiGraph, max_depth::Int64=0)Aggregate graph by converting subgraphs into optinodes. The max_depth determines how many levels of subgraphs remain in the new aggregated optigraph. For example, a max_depth of 0 signifies there should be no subgraphs in the aggregated optigraph. This version of the method modifies the optigraph and transforms it into the aggregated version.
Graph Topology
Graphs.all_neighbors — Function
Graphs.all_neighbors(hyper::HyperGraphProjection, node::OptiNode)Retrieve the optinode neighbors of node in the optigraph graph. Uses an underlying hypergraph to query for neighbors.
Graphs.induced_subgraph — Function
Graphs.induced_subgraph(graph::OptiGraph, nodes::Vector{OptiNode})Create an induced subgraph of optigraph given a vector of optinodes.
Graphs.neighborhood — Function
neighborhood(
hyper::HyperGraphProjection,
nodes::Vector{OptiNode},
distance::Int64
)::Vector{OptiNode}Return the optinodes within distance of the given nodes in the optigraph graph.
Plasmo.incident_edges — Function
incident_edges(hyper::HyperGraphProjection, nodes::Vector{OptiNode})Retrieve incident edges to a set of optinodes.
incident_edges(hyper::HyperGraphProjection, node::OptiNode)Retrieve incident edges to a single optinode.
Plasmo.incident_edges(rgraph::RemoteOptiGraph)Get the set of incident edges to a given rgraph. This requires the rgraph to have a parent graph, which is what will be search to get the incident edges
Plasmo.induced_edges — Function
induced_edges(graph::OptiGraph, nodes::Vector{OptiNode})Retrieve induced edges to a set of optinodes.
Plasmo.identify_edges — Function
identify_edges(hyper::HyperGraphProjection, node_vectors::Vector{Vector{OptiNode}})Identify induced edges and edge separators from a vector of optinode partitions.
Arguments
hyper::HyperGraphProjection: AHyperGraphProjectionobtained fromhyper_projection.node_vectors::Vector{Vector{OptiNode}}: A vector of vectors that containOptiNodes.
Returns
- partition_optiedges::Vector{Vector{OptiEdge}}: The
OptiEdgevectors for each partition. - cross_optiedges::Vector{OptiEdge}: A vector of optiedges that cross partitions.
Plasmo.identify_nodes — Function
identify_nodes(hyper::HyperGraphProjection, node_vectors::Vector{Vector{OptiEdge}})Identify induced nodes and node separators from a vector of optiedge partitions.
Plasmo.expand — Function
expand(hyper::HyperGraphProjection, subgraph::OptiGraph, distance::Int64)Return a new expanded subgraph given the optigraph graph and an existing subgraph subgraph. The returned subgraph contains the expanded neighborhood within distance of the given subgraph.
<!– @docs PlasmoPlots.layout_plot PlasmoPlots.matrix_plot –>