Block Triangular Decomposition Solver

pyomo.contrib.incidence_analysis.scc_solver.generate_strongly_connected_components(constraints, variables=None, include_fixed=False, igraph=None)[source]

Yield in order BlockData that each contain the variables and constraints of a single diagonal block in a block lower triangularization of the incidence matrix of constraints and variables

These diagonal blocks correspond to strongly connected components of the bipartite incidence graph, projected with respect to a perfect matching into a directed graph.

Parameters:
  • constraints (List of Pyomo constraint data objects) – Constraints used to generate strongly connected components.

  • variables (List of Pyomo variable data objects) – Variables that may participate in strongly connected components. If not provided, all variables in the constraints will be used.

  • include_fixed (Bool, optional) – Indicates whether fixed variables will be included when identifying variables in constraints.

  • igraph (IncidenceGraphInterface, optional) – Incidence graph containing (at least) the provided constraints and variables.

Yields:

Tuple of BlockData, list-of-variables – Blocks containing the variables and constraints of every strongly connected component, in a topological order. The variables are the “input variables” for that block.

pyomo.contrib.incidence_analysis.scc_solver.solve_strongly_connected_components(block, *, solver=None, solve_kwds=None, use_calc_var=True, calc_var_kwds=None)[source]

Solve a square system of variables and equality constraints by solving strongly connected components individually.

Strongly connected components (of the directed graph of constraints obtained from a perfect matching of variables and constraints) are the diagonal blocks in a block triangularization of the incidence matrix, so solving the strongly connected components in topological order is sufficient to solve the entire block.

One-by-one blocks are solved using Pyomo’s calculate_variable_from_constraint function, while higher-dimension blocks are solved using the user-provided solver object.

Parameters:
  • block (Pyomo Block) – The Pyomo block whose variables and constraints will be solved

  • solver (Pyomo solver object) – The solver object that will be used to solve strongly connected components of size greater than one constraint. Must implement a solve method.

  • solve_kwds (Dictionary) – Keyword arguments for the solver’s solve method

  • use_calc_var (Bool) – Whether to use calculate_variable_from_constraint for one-by-one square system solves

  • calc_var_kwds (Dictionary) – Keyword arguments for calculate_variable_from_constraint

Return type:

List of results objects returned by each call to solve