networkx.algorithms.clique.graph_clique_number¶
-
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.
Parameters: - G (NetworkX graph) – An undirected graph.
- cliques (list) – 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()
.
Returns: The size of the largest clique in
G
.Return type: Notes
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.