diff options
| author | Jordi Torrents <jordi.t21@gmail.com> | 2016-11-28 15:49:10 +0100 |
|---|---|---|
| committer | Jordi Torrents <jordi.t21@gmail.com> | 2017-04-02 15:49:22 +0200 |
| commit | e8b8a8e7a280a52bece3d64cc09aec87add99b84 (patch) | |
| tree | 30e96628ec72c0c7a2424582f0659f4f8587176d /networkx/algorithms/approximation/connectivity.py | |
| parent | 562c733ade67eb41c5e2d005e585ddfc18cf82ef (diff) | |
| download | networkx-e8b8a8e7a280a52bece3d64cc09aec87add99b84.tar.gz | |
Fixes for k-components tests and node connectivity approximation doctests (#5)
* Use octahedral instead of icosahedral for connectivity approx docs.
The approximation algorithm for node connectivity fails on the
icosahedral graph depending on node iteration order. We use the
octahedral graph instead as example in the docstrings.
* Fix k-components tests avoiding hard-coded node labels.
In order to support the new dict implementation of python 3.6 we
have to avoid hard-coding node labels for the k-components of the
example graphs in k-components tests. We now test the number of
k-components found, their number of nodes, and their node
connectivity to make sure that the algorithms are correct.
Diffstat (limited to 'networkx/algorithms/approximation/connectivity.py')
| -rw-r--r-- | networkx/algorithms/approximation/connectivity.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/networkx/algorithms/approximation/connectivity.py b/networkx/algorithms/approximation/connectivity.py index 727a3eb8..67b2ee47 100644 --- a/networkx/algorithms/approximation/connectivity.py +++ b/networkx/algorithms/approximation/connectivity.py @@ -53,12 +53,12 @@ def local_node_connectivity(G, source, target, cutoff=None): Examples -------- - >>> # Platonic icosahedral graph has node connectivity 5 + >>> # Platonic octahedral graph has node connectivity 4 >>> # for each non adjacent node pair >>> from networkx.algorithms import approximation as approx - >>> G = nx.icosahedral_graph() - >>> approx.local_node_connectivity(G, 0, 6) - 5 + >>> G = nx.octahedral_graph() + >>> approx.local_node_connectivity(G, 0, 5) + 4 Notes ----- @@ -148,11 +148,11 @@ def node_connectivity(G, s=None, t=None): Examples -------- - >>> # Platonic icosahedral graph is 5-node-connected + >>> # Platonic octahedral graph is 4-node-connected >>> from networkx.algorithms import approximation as approx - >>> G = nx.icosahedral_graph() + >>> G = nx.octahedral_graph() >>> approx.node_connectivity(G) - 5 + 4 Notes ----- |
