NetworkX

Previous topic

networkx.algorithms.bipartite.basic.is_bipartite

Next topic

networkx.algorithms.bipartite.basic.sets

networkx.algorithms.bipartite.basic.is_bipartite_node_set

networkx.algorithms.bipartite.basic.is_bipartite_node_set(G, nodes)

Returns True if nodes and G/nodes are a bipartition of G.

Parameters :

G : NetworkX graph

nodes: list or container :

Check if nodes are a one of a bipartite set.

Notes

For connected graphs the bipartite sets are unique. This function handles disconnected graphs.

Examples

>>> from networkx.algorithms import bipartite
>>> G = nx.path_graph(4)
>>> X = set([1,3])
>>> bipartite.is_bipartite_node_set(G,X)
True