plastro.plasticity.graph_from_connectivities

plastro.plasticity.graph_from_connectivities(adj_matrix, cell_names: List[str]) Graph[source]

Convert sparse adjacency matrix to NetworkX graph.

Parameters:
  • adj_matrix (scipy.sparse.csr_matrix) – Sparse adjacency matrix where 1 indicates connected nodes.

  • cell_names (List[str]) – List of cell names corresponding to matrix rows/columns.

Returns:

Graph with nodes labeled by cell names.

Return type:

networkx.Graph

Raises:

AttributeError – If adj_matrix is not a supported sparse matrix type.