gnmk_random_graph(n, m, k, seed=None, directed=False)
Produces a bipartite graph chosen randomly out of the set of all graphs with n top nodes, m bottom nodes, and k edges. The graph is composed of two sets of nodes. Set A has nodes 0 to (n - 1) and set B has nodes n to (n + m - 1).
If k > m * n then a complete bipartite graph is returned.
This graph is a bipartite version of the :None:None:`G_{nm}`
random graph model.
The nodes are assigned the attribute 'bipartite' with the value 0 or 1 to indicate which bipartite set the node belongs to.
This function is not imported in the main namespace. To use it use nx.bipartite.gnmk_random_graph
The number of nodes in the first bipartite set.
The number of nodes in the second bipartite set.
The number of edges
Indicator of random number generation state. See Randomness<randomness>
.
If True return a directed graph
Returns a random bipartite graph G_{n,m,k}.
from nx.algorithms import bipartite G = bipartite.gnmk_random_graph(10,20,50)
See :The following pages refer to to this document either explicitly or contain code examples using this.
networkx.drawing.layout.bipartite_layout
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them