How to optimize Dijkstra algorithm for a single shortest path between 2 nodes?

前端 未结 3 738
轮回少年
轮回少年 2020-12-18 07:23

I was trying to understand this implementation in C of the Dijkstra algorithm and at the same time modify it so that only the shortest path between 2 specific nodes (source

3条回答
  •  臣服心动
    2020-12-18 08:21

    The biggest improvement you can make over Dijkstra is using A* instead. Of course, this requires that you have a heuristic function.

提交回复
热议问题