Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

networkx.algorithms.bipartite.basic.is_bipartite

is_bipartite(G)[source]

Returns True if graph G is bipartite, False if not.

Parameters:G (NetworkX graph)

Examples

>>> from networkx.algorithms import bipartite
>>> G = nx.path_graph(4)
>>> print(bipartite.is_bipartite(G))
True