def make_max_clique_graph(G, create_using=None):
 B = (create_using if (create_using is not None) else networkx.Graph())
 B.clear()
 cliques = list(enumerate((set(c) for c in find_cliques(G))))
 B.add_nodes_from((i for (i, c) in cliques))
 clique_pairs = combinations(cliques, 2)
 B.add_edges_from(((i, j) for ((i, c1), (j, c2)) in clique_pairs if (c1 & c2)))
 return B

def make_max_clique_graph ( G , create_using = None ) : B = ( create_using if ( create_using is not None ) else networkx . Graph ( ) ) B . clear ( ) cliques = list ( enumerate ( ( set ( c ) for c in find_cliques ( G ) ) ) ) B . add_nodes_from ( ( i for ( i , c ) in cliques ) ) clique_pairs = combinations ( cliques , 2 ) B . add_edges_from ( ( ( i , j ) for ( ( i , c1 ) , ( j , c2 ) ) in clique_pairs if ( c1 & c2 ) ) ) return B
returns the maximal clique graph of the given graph .