This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
from_biadjacency_matrix(A, create_using=None, edge_attribute='weight')¶
Creates a new bipartite graph from a biadjacency matrix given as a SciPy sparse matrix.
- A (scipy sparse matrix) – A biadjacency matrix representation of a graph
- create_using (NetworkX graph) – Use specified graph for result. The default is Graph()
- edge_attribute (string) – Name of edge attribute to store matrix numeric value. The data will have the same type as the matrix entry (int, float, (real,imag)).
The nodes are labeled with the attribute set to an integer 0 or 1 representing membership in part 0 or part 1 of the bipartite graph.
If is an instance of
networkx.MultiDiGraphand the entries of are of type
int, then this function returns a multigraph (of the same type as ) with parallel edges. In this case, will be ignored.