How can I find all 'long' simple acyclic paths in a graph?
问题 Let's say we have a fully connected directed graph G . The vertices are [a,b,c] . There are edges in both directions between each vertex. Given a starting vertex a , I would like to traverse the graph in all directions and save the path only when I hit a vertex which is already in the path. So, the function full_paths(a,G) should return: - [{a,b}, {b,c}, {c,d}] - [{a,b}, {b,d}, {d,c}] - [{a,c}, {c,b}, {b,d}] - [{a,c}, {c,d}, {d,b}] - [{a,d}, {d,c}, {c,b}] - [{a,d}, {d,b}, {b,c}] I do not need