independence_number

independence_number#

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

Return the size of the largest independent vertex set of a graph.

Parameters:
gGraph

Graph to be used. Edge directions are ignored.

Returns:
alphaint

The independence number.

See also

largest_independent_vertex_sets

Independent vertex sets of maximum size

clique_number

Size of a largest clique

clique_removal

Approximate maximum independent vertex set

Notes

An independent vertex set is a set of vertices no two of which are adjacent (ignoring the edge directions), and the independence number is

\[\alpha(G) = \max\{|I| : I \text{ is an independent set of } G\}.\]

It is the clique number of the complement graph (see complement_graph() and clique_number()), which is computed in time exponential in the worst case, after the complement is built in time \(O(V^2)\).

Examples

>>> print(gt.independence_number(gt.circular_graph(7)))
3