def find_all_paths(graph, start, end):

    def find_all_paths_aux(adjlist, start, end, path):
        path = path + [start]
if start == end:
    return [path]
paths = []
for node in (adjlist[start] - set(path)):
    paths.extend(find_all_paths_aux(adjlist, node, end, path))
return paths
adjlist = [set(graph.neighbors(node)) for node in range(graph.vcount())]
return find_all_paths_aux(adjlist, start, end, [])
Path between two nodes