diff options
| author | Matus Valo <matusvalo@users.noreply.github.com> | 2022-06-21 14:03:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-21 15:03:21 +0300 |
| commit | d783b40bbad19edebaa2d70880d19f9d7cc97387 (patch) | |
| tree | fa6ed64c48d0f671f79d67cfa6446fc79485c5af /networkx/algorithms/components | |
| parent | 659f07fdbe099e5faf9a09476a90af7d1323b05b (diff) | |
| download | networkx-d783b40bbad19edebaa2d70880d19f9d7cc97387.tar.gz | |
Compute `is_strongly_connected` lazily (#5793)
Diffstat (limited to 'networkx/algorithms/components')
| -rw-r--r-- | networkx/algorithms/components/strongly_connected.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/networkx/algorithms/components/strongly_connected.py b/networkx/algorithms/components/strongly_connected.py index fc263c11..edb33d3f 100644 --- a/networkx/algorithms/components/strongly_connected.py +++ b/networkx/algorithms/components/strongly_connected.py @@ -350,7 +350,7 @@ def is_strongly_connected(G): """Connectivity is undefined for the null graph.""" ) - return len(list(strongly_connected_components(G))[0]) == len(G) + return len(next(strongly_connected_components(G))) == len(G) @not_implemented_for("undirected") |
