diff options
Diffstat (limited to 'networkx/algorithms/approximation/clique.py')
| -rw-r--r-- | networkx/algorithms/approximation/clique.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/networkx/algorithms/approximation/clique.py b/networkx/algorithms/approximation/clique.py index 72286363..cf74c95e 100644 --- a/networkx/algorithms/approximation/clique.py +++ b/networkx/algorithms/approximation/clique.py @@ -40,6 +40,12 @@ def maximum_independent_set(G): iset : Set The apx-maximum independent set + Examples + -------- + >>> G = nx.path_graph(10) + >>> nx.approximation.maximum_independent_set(G) + {0, 2, 4, 6, 9} + Raises ------ NetworkXNotImplemented @@ -79,6 +85,12 @@ def max_clique(G): clique : set The apx-maximum clique of the graph + Examples + -------- + >>> G = nx.path_graph(10) + >>> nx.approximation.max_clique(G) + {8, 9} + Raises ------ NetworkXNotImplemented @@ -135,6 +147,12 @@ def clique_removal(G): max_ind_cliques : (set, list) tuple 2-tuple of Maximal Independent Set and list of maximal cliques (sets). + Examples + -------- + >>> G = nx.path_graph(10) + >>> nx.approximation.clique_removal(G) + ({0, 2, 4, 6, 9}, [{0, 1}, {2, 3}, {4, 5}, {6, 7}, {8, 9}]) + Raises ------ NetworkXNotImplemented @@ -180,6 +198,12 @@ def large_clique_size(G): k: integer The size of a large clique in the graph. + Examples + -------- + >>> G = nx.path_graph(10) + >>> nx.approximation.large_clique_size(G) + 2 + Raises ------ NetworkXNotImplemented |
