Re: [Numpy-discussion] Optimize Floyd-Wallshall algorithm with Numpy

2010-11-06 Thread K. Sun
np.minimum( dis, route + route.T ) return np.array( dis ) * josef.p...@gmail.com [2010-11-06 15:46:17 -0400]: >On Sat, Nov 6, 2010 at 3:28 PM, K. Sun wrote: >> Hello, >> >> I wrote the following code with numpy to implement the Floyd-Wallshall >> algorithm to c

[Numpy-discussion] Optimize Floyd-Wallshall algorithm with Numpy

2010-11-06 Thread K. Sun
Hello, I wrote the following code with numpy to implement the Floyd-Wallshall algorithm to compute the pair-wise shortest path in a undirected weighted graph. It is really slow when N ~ 10k, while the same implementation in matlab is much faster. I am sorry I don't want to run it again to present