[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [igraph] All paths between two nodes in a directed acyclic graph

**From**: |
Tamas Nepusz |

**Subject**: |
Re: [igraph] All paths between two nodes in a directed acyclic graph |

**Date**: |
Wed, 20 Oct 2010 09:39:58 +0100 |

Hello,
>* I'm looking for a way to list all possible paths in a directed acyclic*
>* graph, represented by an igraph object in python.*
There is no such function at the moment, the closest to what you are asking for
is to list all possible *shortest* paths between a node and others (see
Graph.get_all_shortest_paths()).
The solution you have been given on Stack Overflow is nice, I'd make only a
small modification: if you want to invoke `paths_from_to` between a single
vertex pair only, it's better to use Graph.successors() to query the outgoing
neighbors of a vertex instead of constructing an adjacency list in advance (a
large part of which you will probably never use). If you need all possible
paths between all pairs of vertices, then it's better to use
Graph.get_adjlist().
--
Tamas