get_bipartite_incidence_graph
(function from pyomo.contrib.incidence_analysis.interface
)
- pyomo.contrib.incidence_analysis.interface.get_bipartite_incidence_graph(variables, constraints, **kwds)[source]
Return the bipartite incidence graph of Pyomo variables and constraints.
Each node in the returned graph is an integer. The convention is that, for a graph with N variables and M constraints, nodes 0 through M-1 correspond to constraints and nodes M through M+N-1 correspond to variables. Nodes correspond to variables and constraints in the provided orders. For consistency with NetworkX’s “convention”, constraint nodes are tagged with
bipartite=0
while variable nodes are tagged withbipartite=1
, although these attributes are not used.- Parameters:
variables (List of Pyomo VarData objects) – Variables that will appear in incidence graph
constraints (List of Pyomo ConstraintData objects) – Constraints that will appear in incidence graph
include_fixed (Bool) – Flag for whether fixed variable should be included in the incidence
- Return type:
networkx.Graph