clique_removal

Contents

clique_removal#

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

Return an approximate maximum independent vertex set and a clique cover.

Parameters:
gGraph

Graph to be used. Edge directions are ignored.

Returns:
isetnumpy.ndarray

The vertices of an independent set.

cliqueslist of numpy.ndarray

Cliques that cover all vertices.

See also

ramsey_r2

A clique and an independent vertex set

maximal_independent_vertex_set

Maximal independent vertex set

independence_number

Exact size of a largest independent vertex set

Notes

An independent vertex set is a set of pairwise non-adjacent vertices, and a clique cover is a partition of the vertices into cliques (sets of pairwise adjacent vertices), ignoring the edge directions. The clique removal algorithm [boppana-approximating-1992] applies ramsey_r2() repeatedly, removing the clique found each time, and keeps the largest independent set, which approximates the maximum within a factor \(O(V/\log^2 V)\). The approximate maximum clique is the independent set of the complement graph (see approx_maximum_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"]
>>> i, cs = gt.clique_removal(g)
>>> print(len(i), sum([len(c) for c in cs]))
19 34