approx_maximum_clique#
- graph_tool.structure.approx_maximum_clique(g)[git][source]#
Return an approximate maximum clique.
- Parameters:
- g
Graph Graph to be used. Edge directions are ignored.
- g
- Returns:
- clique
numpy.ndarray The vertices of a clique.
- clique
See also
largest_cliquesExact cliques of maximum size
large_clique_sizeSize of a large clique
maximum_weight_cliqueClique 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 bymaximum_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