for child in a[n]:
    if child not in path:
        child_paths = adjlist_find_paths(a, child, m, path)
for child_path in child_paths:
    paths.append(child_path)
return paths

def paths_from_to(graph, source, dest):
    """Find paths in graph from vertex source to vertex dest."""
a = graph.get_adjlist()
n = source.index
m = dest.index
return adjlist_find_paths(a, n, m)
Все возможные пути от одного узла к другому в направленном дереве (igraph)