Returns bipartite node sets of graph G.
Raises an exception if the graph is not bipartite.
Parameters : | G : NetworkX graph |
---|---|
Returns : | (X,Y) : two-tuple of sets
|
See also
Examples
>>> G=nx.path_graph(4)
>>> X,Y=nx.bipartite_sets(G)
>>> list(X)
[0, 2]
>>> list(Y)
[1, 3]