summaryrefslogtreecommitdiff
path: root/networkx
diff options
context:
space:
mode:
authorPurvi Chaurasia <97350598+PurviChaurasia@users.noreply.github.com>2023-03-23 23:14:30 +0530
committerGitHub <noreply@github.com>2023-03-23 23:14:30 +0530
commit5d617714b5cbaf5648ed1d2b3369758399324f60 (patch)
treee605cfb62cfc8546888c7a7d16b95a67810ebfd5 /networkx
parenta41a11e516f4345d84ed356433cd543aab914643 (diff)
downloadnetworkx-5d617714b5cbaf5648ed1d2b3369758399324f60.tar.gz
Add example script for mst (#6525)
* Fix negative edge cycle function raising exception for empty graph and added relevant test function * Unresolved change * Added example script for generating mst * unresolved changes * update plot_mst.py * Fixed typo Co-authored-by: Dan Schult <dschult@colgate.edu> --------- Co-authored-by: Dan Schult <dschult@colgate.edu>
Diffstat (limited to 'networkx')
-rw-r--r--networkx/algorithms/shortest_paths/weighted.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/networkx/algorithms/shortest_paths/weighted.py b/networkx/algorithms/shortest_paths/weighted.py
index f5ff3ee1..a717b671 100644
--- a/networkx/algorithms/shortest_paths/weighted.py
+++ b/networkx/algorithms/shortest_paths/weighted.py
@@ -2138,6 +2138,7 @@ def negative_edge_cycle(G, weight="weight", heuristic=True):
"""
if G.size() == 0:
return False
+
# find unused node to use temporarily
newnode = -1
while newnode in G: