diff options
author | Alimi Qudirah <qudrohbidemi@gmail.com> | 2023-04-24 21:28:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-25 00:28:15 +0400 |
commit | fb67743e868be82f8fef6983f343f0e239b032b0 (patch) | |
tree | 4aa44fd24feb745d58b3b2d87f8c94d9f2865d06 | |
parent | 8b87a5b099e2ff9769d8074b350dc27c96434d8e (diff) | |
download | networkx-fb67743e868be82f8fef6983f343f0e239b032b0.tar.gz |
Added docstrings examples for clique.py (#6576)
* added docstrings examples for clique.py
* Update networkx/algorithms/approximation/clique.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* Update networkx/algorithms/approximation/clique.py
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
* adding corrections
* adding corrections
* adding corrections to examples
* adding corrections
---------
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
-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 |