7.3.3.2. networkx.algorithms.bipartite.matrix.from_biadjacency_matrix¶
-
networkx.algorithms.bipartite.matrix.from_biadjacency_matrix(A, create_using=None, edge_attribute='weight')[source]¶ Creates a new bipartite graph from a biadjacency matrix given as a SciPy sparse matrix.
Parameters: 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)).
See also
biadjacency_matrix,from_numpy_matrixNotes
The nodes are labeled with the attribute bipartite set to an integer 0 or 1 representing membership in part 0 or part 1 of the bipartite graph.
If create_using is an instance of
networkx.MultiGraphornetworkx.MultiDiGraphand the entries of A are of typeint, then this function returns a multigraph (of the same type as create_using) with parallel edges. In this case, edge_attribute will be ignored.References
[1] http://en.wikipedia.org/wiki/Adjacency_matrix#Adjacency_matrix_of_a_bipartite_graph