summaryrefslogtreecommitdiff
path: root/networkx/algorithms/components
diff options
context:
space:
mode:
authorMatus Valo <matusvalo@users.noreply.github.com>2022-06-21 14:03:21 +0200
committerGitHub <noreply@github.com>2022-06-21 15:03:21 +0300
commitd783b40bbad19edebaa2d70880d19f9d7cc97387 (patch)
treefa6ed64c48d0f671f79d67cfa6446fc79485c5af /networkx/algorithms/components
parent659f07fdbe099e5faf9a09476a90af7d1323b05b (diff)
downloadnetworkx-d783b40bbad19edebaa2d70880d19f9d7cc97387.tar.gz
Compute `is_strongly_connected` lazily (#5793)
Diffstat (limited to 'networkx/algorithms/components')
-rw-r--r--networkx/algorithms/components/strongly_connected.py2
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")