networkx.algorithms.approximation.ramsey.ramsey_R2

ramsey_R2(G)[source]

Compute the largest clique and largest independent set in G.

This can be used to estimate bounds for the 2-color Ramsey number R(2;s,t) for G.

This is a recursive implementation which could run into trouble for large recursions. Note that self-loop edges are ignored.

Parameters

G (NetworkX graph) – Undirected graph

Returns

max_pair – Maximum clique, Maximum independent set.

Return type

(set, set) tuple