|
From: | Ahmed Abdeen Hamed |
Subject: | Re: [igraph] All possible path between two nodes |
Date: | Mon, 25 Nov 2013 05:08:08 -0500 |
I had to terminate because my graph might have cycles. I don't need all possible path. I just need a path that's longer the immediate path between two nodes if it exists.For instance:If A->B andalso A->C->B or A->D->BI need to see those two paths.The easiest is probably to temporarily remove the A-B edge from your graph and try the shortest path search again.An alternative is to use a k-shortest-paths algorithm with some low k. Someone else has already ported Yen’s k-shortest-path algorithm to igraph using its Python interface so you might try this:Note that this will modify the edge IDs because it adds and removes edges temporarily. Make sure to copy your graph first before calling yen_igraph() on it.—T.
[Prev in Thread] | Current Thread | [Next in Thread] |