Re: Python Dijkstra Shortest Path

2007-05-16 Thread Gabriel Genellina
En Wed, 16 May 2007 00:39:20 -0300, Hugo Ferreira <[EMAIL PROTECTED]> escribió: > While trying to optimize this: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/119466 > > ... and still have a fast edge lookup, I've done the following tweaks: I've replaced that strange deeply nested

Python Dijkstra Shortest Path

2007-05-15 Thread Hugo Ferreira
While trying to optimize this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/119466 ... and still have a fast edge lookup, I've done the following tweaks: class PathFind(object): def __init__(self): self.G = defaultdict(dict) self.E = defaultdict(dict) def addE