networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersBackRef
complete_bipartite_graph(n1, n2, create_using=None)

The graph is composed of two partitions with nodes 0 to (n1 - 1) in the first and nodes n1 to (n1 + n2 - 1) in the second. Each node in the first is connected to each node in the second.

Notes

Nodes are the integers 0 to :None:None:`n1 + n2 - 1` unless either n1 or n2 are containers of nodes. If only one of n1 or n2 are integers, that integer is replaced by range of that integer.

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.complete_bipartite_graph

Parameters

n1, n2 : integer or iterable container of nodes

If integers, nodes are from :None:None:`range(n1)` and :None:None:`range(n1, n1 + n2)`. If a container, the elements are the nodes.

create_using : NetworkX graph instance, (default: nx.Graph)

Return graph of this type.

Returns the complete bipartite graph :None:None:`K_{n_1,n_2}`.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.generators.classic.complete_multipartite_graph networkx.algorithms.bipartite.basic.density networkx.algorithms.bipartite.projection.generic_weighted_projected_graph networkx.algorithms.bipartite.basic.degrees

Local connectivity graph

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


GitHub : /networkx/algorithms/bipartite/generators.py#22
type: <class 'function'>
Commit: