Graph Problems (was Re: Is there a map or graph module?)
Lilith
lilyth at umich.edu
Fri Mar 19 19:37:53 CET 2004
lilyth at umich.edu (Lilith) wrote in message news:<75200cbc.0403190755.5765890a at posting.google.com>...
> Josiah Carlson <jcarlson at nospam.uci.edu> wrote in message news:<c3dpmp$7r5$1 at news.service.uci.edu>...
> > 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, http://www.python.org/doc/essays/graphs.html
>
> That's not working for me. I should have mentioned I tried that, but I
> get a slew of these errors:
>
> > File "guidograph.py", 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