clique_number

Contents

clique_number#

graph_tool.structure.clique_number(g)[git][source]#

Return the clique number, i.e. the number of vertices of a largest clique.

Parameters:
gGraph

Graph to be used (the edge directions are ignored).

Returns:
omegaint

The clique number.

See also

largest_cliques

Cliques of maximum size

maximal_cliques

All maximal cliques

large_clique_size

Fast lower bound on the clique number

independence_number

Size of a largest independent vertex set

Notes

A clique is a set of vertices every two of which are adjacent, ignoring the edge directions, and the clique number is

\[\omega(G) = \max\{|C| : C \text{ is a clique of } G\}.\]

The maximal cliques are enumerated with the Bron–Kerbosch algorithm with pivoting [tomita-worst-case-2006], split into one independent subproblem per vertex along a degeneracy order [eppstein-listing-2010], which are solved in parallel. The branches that cannot contain a clique larger than the largest one found so far are pruned. The time is exponential in the worst case.

References

[tomita-worst-case-2006]

Etsuji Tomita, Akira Tanaka, and Haruhisa Takahashi, “The worst-case time complexity for generating all maximal cliques and computational experiments”, Theoretical Computer Science 363, 28-42 (2006), DOI: 10.1016/j.tcs.2006.06.015 [sci-hub, @tor]

[eppstein-listing-2010]

David Eppstein, Maarten Löffler, and Darren Strash, “Listing all maximal cliques in sparse graphs in near-optimal time”, ISAAC 2010, DOI: 10.1007/978-3-642-17517-6_36 [sci-hub, @tor], arXiv: 1006.5440

Examples

>>> g = gt.collection.data["karate"]
>>> print(gt.clique_number(g))
5