Skip to content

Commit e7d121b

Browse files
larshumslarse
authored andcommitted
Fix undefined name
1 parent cac923d commit e7d121b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

thealgorithms/graphs/Directed_and_Undirected_Weighted_Graph.py

+4
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def cycle_nodes(self):
153153
indirect_parents = []
154154
ss = s
155155
anticipating_nodes = set()
156+
on_the_way_back = False
156157

157158
while True:
158159
# check if there is any non isolated nodes
@@ -200,6 +201,7 @@ def has_cycle(self):
200201
indirect_parents = []
201202
ss = s
202203
anticipating_nodes = set()
204+
on_the_way_back = False
203205

204206
while True:
205207
# check if there is any non isolated nodes
@@ -368,6 +370,7 @@ def cycle_nodes(self):
368370
indirect_parents = []
369371
ss = s
370372
anticipating_nodes = set()
373+
on_the_way_back = False
371374

372375
while True:
373376
# check if there is any non isolated nodes
@@ -415,6 +418,7 @@ def has_cycle(self):
415418
indirect_parents = []
416419
ss = s
417420
anticipating_nodes = set()
421+
on_the_way_back = False
418422

419423
while True:
420424
# check if there is any non isolated nodes

0 commit comments

Comments
 (0)