I am trying to implement a dfs to find cycles in a string graph. For example the graph:
walkways_info = """\
U 3
0 1
1 2
2 0
"""
Would return True. I am currently having the issue that my if statement:
if current_vertex in visited or int(graph[i].split()[1]) in visited:
It is outputting False but I don't want it to output anything at this stage.
Updated code Here
I'd appreciate some help.