A* Algorithm for very large graphs, any thoughts on caching shortcuts?

前端 未结 9 1330
鱼传尺愫
鱼传尺愫 2021-01-30 12:37

I\'m writing a courier/logistics simulation on OpenStreetMap maps and have realised that the basic A* algorithm as pictured below is not going to be fast enough for large maps (

9条回答
  •  悲&欢浪女
    2021-01-30 12:50

    There's a really great article that Microsoft Research wrote on the subject:

    http://research.microsoft.com/en-us/news/features/shortestpath-070709.aspx

    The original paper is hosted here (PDF):

    http://www.cc.gatech.edu/~thad/6601-gradAI-fall2012/02-search-Gutman04siam.pdf

    Essentially there's a few things you can try:

    1. Start from the both the source as well as the destination. This helps to minimize the amount of wasted work that you'd perform when traversing from the source outwards towards the destination.
    2. Use landmarks and highways. Essentially, find some positions in each map that are commonly taken paths and perform some pre-calculation to determine how to navigate efficiently between those points. If you can find a path from your source to a landmark, then to other landmarks, then to your destination, you can quickly find a viable route and optimize from there.
    3. Explore algorithms like the "reach" algorithm. This helps to minimize the amount of work that you'll do when traversing the graph by minimizing the number of vertices that need to be considered in order to find a valid route.

提交回复
热议问题