diff options
author | Debargha Ganguly <maildebargha@gmail.com> | 2021-04-09 22:26:55 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-09 12:56:55 -0400 |
commit | e85ec084b792bca13e6f26034fce120762b18eb1 (patch) | |
tree | 862f41184ae4153d716b7c31a97bcce587f4ee4d | |
parent | ead0e65bda59862e329f2e6f1da47919c6b07ca9 (diff) | |
download | networkx-e85ec084b792bca13e6f26034fce120762b18eb1.tar.gz |
Updating average_clustering() documentation - Issue #4734 (#4735)
* Updating average_clustering() documentation - Issue #4734
* Fixing documentation to include G
* Adding output, and fixing random seed
-rw-r--r-- | networkx/algorithms/approximation/clustering_coefficient.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/networkx/algorithms/approximation/clustering_coefficient.py b/networkx/algorithms/approximation/clustering_coefficient.py index 56a8f83b..ec61cb83 100644 --- a/networkx/algorithms/approximation/clustering_coefficient.py +++ b/networkx/algorithms/approximation/clustering_coefficient.py @@ -37,6 +37,14 @@ def average_clustering(G, trials=1000, seed=None): c : float Approximated average clustering coefficient. + Examples + -------- + >>> import networkx as nx + >>> from networkx.algorithms import approximation + >>> G = nx.erdos_renyi_graph(10, 0.2, seed=10) + >>> approximation.average_clustering(G, trials=1000, seed=10) + 0.214 + References ---------- .. [1] Schank, Thomas, and Dorothea Wagner. Approximating clustering |