Dijkstra's Shortest Path algorithm

Bjorn Pettersen pbjorn at uswest.net
Wed Dec 13 18:40:31 CET 2000


Roy Katz wrote:

> [snip]

> btw -- we're holding a competition for the fastest program in my C++
> class.  I'm probably in the top four in my section (1.77 seconds for 500
> nodes with 10k edges, 1 query). The average for my class is around 20
> seconds (this was the final project).  Weird! the biggest lags occur in
> reading in the data! but I guess, that's what we get with
> object orientation -- more layers to tunnel through.

Yes, unfortunately, if you want fast IO you shouldn't use the iostreams
library (the new standards compliant one is even slower than the old
iostreams.h version since it has to go through locale *sigh*).

fopen/fread etc. are still available when you need speed (and usually much
easier on the eye also <wink>).

-- bjorn




More information about the Python-list mailing list