diff options
| author | gfyoung <gfyoung17@gmail.com> | 2017-11-03 04:44:09 -0700 |
|---|---|---|
| committer | Dan Schult <dschult@colgate.edu> | 2017-11-03 07:44:09 -0400 |
| commit | e3566e53793cdccc19a8c2ff9c056e0d7b524634 (patch) | |
| tree | efa640e6e00f33e442c13fa35d4557c0db18f0e6 | |
| parent | d9c0b3a09bdc62a6f3bf1379c9d379aa4f6d5a06 (diff) | |
| download | networkx-e3566e53793cdccc19a8c2ff9c056e0d7b524634.tar.gz | |
Expand documentation regarding strong connectivity (#2732)
* Define strong connectivity in the documentation
* Note strongly connected implies weakly connected
For additional clarity, strong connections imply weak ones by definitions.
| -rw-r--r-- | networkx/algorithms/components/strongly_connected.py | 3 | ||||
| -rw-r--r-- | networkx/algorithms/components/weakly_connected.py | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/networkx/algorithms/components/strongly_connected.py b/networkx/algorithms/components/strongly_connected.py index 6e0e06d8..9b26d3a8 100644 --- a/networkx/algorithms/components/strongly_connected.py +++ b/networkx/algorithms/components/strongly_connected.py @@ -353,6 +353,9 @@ def number_strongly_connected_components(G): def is_strongly_connected(G): """Test directed graph for strong connectivity. + A directed graph is strongly connected if and only if every vertex in + the graph is reachable from every other vertex. + Parameters ---------- G : NetworkX Graph diff --git a/networkx/algorithms/components/weakly_connected.py b/networkx/algorithms/components/weakly_connected.py index 4850e7c6..eea3cfd6 100644 --- a/networkx/algorithms/components/weakly_connected.py +++ b/networkx/algorithms/components/weakly_connected.py @@ -166,9 +166,13 @@ def weakly_connected_component_subgraphs(G, copy=True): def is_weakly_connected(G): """Test directed graph for weak connectivity. - A directed graph is weakly connected if, and only if, the graph + A directed graph is weakly connected if and only if the graph is connected when the direction of the edge between nodes is ignored. + Note that if a graph is strongly connected (i.e. the graph is connected + even when we account for directionality), it is by definition weakly + connected as well. + Parameters ---------- G : NetworkX Graph |
