(u, graph, visited_edge, path=None)
| 7 | |
| 8 | # using dfs for finding eulerian path traversal |
| 9 | def dfs(u, graph, visited_edge, path=None): |
| 10 | path = (path or []) + [u] |
| 11 | for v in graph[u]: |
| 12 | if visited_edge[u][v] is False: |
| 13 | visited_edge[u][v], visited_edge[v][u] = True, True |
| 14 | path = dfs(v, graph, visited_edge, path) |
| 15 | return path |
| 16 | |
| 17 | |
| 18 | # for checking in graph has euler path or circuit |