summaryrefslogtreecommitdiff
path: root/networkx/algorithms/shortest_paths/generic.py
diff options
context:
space:
mode:
Diffstat (limited to 'networkx/algorithms/shortest_paths/generic.py')
-rw-r--r--networkx/algorithms/shortest_paths/generic.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/networkx/algorithms/shortest_paths/generic.py b/networkx/algorithms/shortest_paths/generic.py
index e5a691e2..2c11eb5d 100644
--- a/networkx/algorithms/shortest_paths/generic.py
+++ b/networkx/algorithms/shortest_paths/generic.py
@@ -403,7 +403,7 @@ def average_shortest_path_length(G, weight=None, method=None):
else:
if method == "floyd-warshall":
all_pairs = nx.floyd_warshall(G, weight=weight)
- s = sum([sum(t.values()) for t in all_pairs.values()])
+ s = sum(sum(t.values()) for t in all_pairs.values())
elif method == "floyd-warshall-numpy":
s = nx.floyd_warshall_numpy(G, weight=weight).sum()
return s / (n * (n - 1))