1 | initial version |
I'm not sure if this is the most efficient, but I did find a way. If you want the the path to begin with (v1, v2), then you can use:
S = list(SubgraphSearch(G, graphs.PathGraph(n)))
S[:] = [path for path in S if (path[0] == v1 and path[1] == v2)]