pypsa.Network.adjacency_matrix#
- Network.adjacency_matrix(branch_components=None, investment_period=None, busorder=None, weights=None)#
Construct a sparse adjacency matrix (directed)
- Parameters:
branch_components (iterable sublist of branch_components) – Buses connected by any of the selected branches are adjacent (default: branch_components (network) or passive_branch_components (sub_network))
busorder (pd.Index subset of network.buses.index) – Basis to use for the matrix representation of the adjacency matrix (default: buses.index (network) or buses_i() (sub_network))
weights (pd.Series or None (default)) – If given must provide a weight for each branch, multi-indexed on branch_component name and branch name.
- Returns:
adjacency_matrix – Directed adjacency matrix
- Return type:
sp.sparse.coo_matrix