From A to B with Edsger and Friends

  • Magnus Lie Hetland


It’s time to return to the second problem from the introduction:1 how do you find the shortest route from Kashgar to Ningbo? If you pose this problem to any map software, you’d probably get the answer in less than a second. By now, this probably seems less mysterious than it (maybe) did initially, and you even have tools that could help you write such a program. You know that BFS would find the shortest path if all stretches of road had the same length, and you could use the DAG shortest path algorithm as long as you didn’t have any cycles in your graph. Sadly, the road map of China contains both cycles and roads of unequal length. Luckily, however, this chapter will give you the algorithms you need to solve this problem efficiently!


Posit Hunt Sorting Prefix 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. Numerische Mathematik, 1(1):269–271.MathSciNetMATHCrossRefGoogle Scholar
  2. Nannicini, G., Delling, D., Liberti, L., and Schultes, D. (2008). Bidirectional A* search for time-dependent fast paths. In Proceedings of the 7th international conference on Experimental algorithms, Lecture Notes in Computer Science, pages 334–346.Google Scholar
  3. Russell, S. and Norvig, P. (2009). Artificial Intelligence: A Modern Approach. Prentice Hall, third edition.Google Scholar

Copyright information

© by Magnus Lie Hetland 2010

Authors and Affiliations

  • Magnus Lie Hetland

There are no affiliations available

Personalised recommendations