Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def DFSVisit(x, y, value):
- if (x == y): return True
- for neighbs in range(len(x.neighbours)):
- if (x.neighbours_value[neighbs] < value and x.neighbours_vis[neighbs] == False):
- res = DFSVisit(x.neighbours[neighbs], y, x.neighbours_value[neighbs])
- if not res:
- x.neighbours_vis[neighbs] = True
- else:
- print(x.number)
- return res
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement