independence_number#
- graph_tool.structure.independence_number(g)[git][source]#
Return the size of the largest independent vertex set of a graph.
- Parameters:
- g
Graph Graph to be used. Edge directions are ignored.
- g
- Returns:
- alpha
int The independence number.
- alpha
See also
largest_independent_vertex_setsIndependent vertex sets of maximum size
clique_numberSize of a largest clique
clique_removalApproximate 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()andclique_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