27 Jan 2013 sness   » (Journeyer)

Dijkstra's algorithm for shortest paths « Python recipes « ActiveState Code

Dijkstra's algorithm for shortest paths « Python recipes « ActiveState Code: "

6

Dijkstra(G,s) finds all shortest paths from s to each other vertex in the graph, and shortestPath(G,s,t) uses Dijkstra to find the shortest path from s to t. Uses the priorityDictionary data structure (Recipe 117228) to keep track of estimated distances to each vertex.

Python, 87 lines"

'via Blog this'

Syndicated 2013-01-27 01:20:00 from sness

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!