Warning

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

networkx.algorithms.clique.make_clique_bipartite

make_clique_bipartite(G, fpos=None, create_using=None, name=None)[source]

Returns the bipartite clique graph corresponding to G.

In the returned bipartite graph, the “bottom” nodes are the nodes of G and the “top” nodes represent the maximal cliques of G. There is an edge from node v to clique C in the returned graph if and only if v is an element of C.

Parameters
  • G (NetworkX graph) – An undirected graph.

  • fpos (bool) – If True or not None, the returned graph will have an additional attribute, pos, a dictionary mapping node to position in the Euclidean plane.

  • create_using (NetworkX graph constructor, optional (default=nx.Graph)) – Graph type to create. If graph instance, then cleared before populated.

Returns

A bipartite graph whose “bottom” set is the nodes of the graph G, whose “top” set is the cliques of G, and whose edges join nodes of G to the cliques that contain them.

The nodes of the graph G have the node attribute ‘bipartite’ set to 1 and the nodes representing cliques have the node attribute ‘bipartite’ set to 0, as is the convention for bipartite graphs in NetworkX.

Return type

NetworkX graph