NetworkX

Previous topic

networkx.cliques_containing_node

Next topic

networkx.make_max_clique_graph

networkx.find_cliques

find_cliques(G)

Search for all maximal cliques in a graph.

This algorithm searches for maximal cliques in a graph. maximal cliques are the largest complete subgraph containing a given point. The largest maximal clique is sometimes called the maximum clique.

This implementation is a generator of lists each of which contains the members of a maximal clique. To obtain a list of cliques, use list(find_cliques(G)). The method essentially unrolls the recursion used in the references to avoid issues of recursion stack depth.

See also

find_cliques_recursive
A recursive version of the same algorithm
Reference
:

Based

http
//doi.acm.org/10.1145/362342.362367

as, Tanaka

http
//dx.doi.org/10.1016/j.tcs.2006.06.015

and

http
//dx.doi.org/10.1016/j.tcs.2008.05.010