Graph Problems (was Re: Is there a map or graph module?)

Lilith lilyth at
Fri Mar 19 19:37:53 CET 2004

lilyth at (Lilith) wrote in message news:<75200cbc.0403190755.5765890a at>...
> Josiah Carlson <jcarlson at> wrote in message news:<c3dpmp$7r5$1 at>...
> > Lilith wrote:
> > > Is there a python module somewhere (been searching today, no luck)
> > > which has efficiently coded various graph-handling routines, such as
> > > finding the shortest path through a graph, or the set of all paths
> > > through a graph? I'm not a compsci-educated person, so coding my own
> > > would be less parsimonious.
> > > Thanks for any suggestions!
> > 
> > Thank Guido,
> That's not working for me. I should have mentioned I tried that, but I
> get a slew of these errors:
>     > File "", line 40, in find_all_paths
>     > newpaths = find_all_paths(graph, node, end, path)
>     > RuntimeError: maximum recursion depth exceeded
> Guido's example works fine when I use his simple graph. When I plug in
> my 9000-node graph, I get those problems even if the nodes are a few
> steps away. I think my network is too big for that code.
> I imagine there's some kind of recursion limit I can set somewhere,
> but it's probably a problem in that the code can't handle larger
> graphs. Not only does find_all_paths crash, but so does find_path.

Just in case my second posting didn't get through on one, I did find
the way to use the sys module to up the recursion limit. Never had to
use that one, thanks in advance for anyone who points that out, ahead
of time. (I'm on Google, so I'm lagging behind a few hours)

More information about the Python-list mailing list