Redirecting you to http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm