approx_maximum_clique

approx_maximum_clique#

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

Return an approximate maximum clique.

Parameters:
gGraph

Graph to be used. Edge directions are ignored.

Returns:
cliquenumpy.ndarray

The vertices of a clique.

See also

largest_cliques

Exact cliques of maximum size

large_clique_size

Size of a large clique

maximum_weight_clique

Clique of maximum total vertex weight

Notes

A clique is a set of pairwise adjacent vertices (ignoring the edge directions), and a maximum clique is one of the largest size. The clique returned is the independent set found by clique_removal() in the complement graph, which approximates the maximum within a factor \(O(V/\log^2 V)\) [boppana-approximating-1992]; the complement takes time and memory \(O(V^2)\). The exact maximum is found by maximum_weight_clique().

References

[boppana-approximating-1992]

Ravi Boppana and Magnús M. Halldórsson, “Approximating maximum independent sets by excluding subgraphs”, BIT 32, 180-196 (1992), DOI: 10.1007/BF01994876 [sci-hub, @tor]

Examples

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