graph_clique_number(G, cliques=None)[source]#

Returns the clique number of the graph.

The clique number of a graph is the size of the largest clique in the graph.

Deprecated since version 3.0: graph_clique_number is deprecated in NetworkX 3.0 and will be removed in v3.2. The graph clique number can be computed directly with:

max(len(c) for c in nx.find_cliques(G))
GNetworkX graph

An undirected graph.


A list of cliques, each of which is itself a list of nodes. If not specified, the list of all cliques will be computed, as by find_cliques().


The size of the largest clique in G.


You should provide cliques if you have already computed the list of maximal cliques, in order to avoid an exponential time search for maximal cliques.