grinpy.invariants.clique.clique_number

grinpy.invariants.clique.clique_number(G, cliques=None)

Return the clique number of the graph.

A clique in a graph G is a complete subgraph. The clique number is the size of a largest clique.

This function is a wrapper for the NetworkX graph_clique_number() method in networkx.algorithms.clique.

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 networkx.algorithms.clique.find_cliques().
Returns:

The size of a largest clique in G

Return type:

int

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.