A Shortest Path Algorithm With Minimum Number Of Nodes Traversed

后端 未结 4 973
夕颜
夕颜 2021-01-01 07:38

I am looking for a Dijkstra\'s algorithm implementation, that also takes into consideration the number of nodes traversed.

What I mean is, a typical Dijkstra\'s algo

4条回答
  •  孤城傲影
    2021-01-01 08:17

    I'm going to go out on a limb here, but have you tried the A* algorithm? I may have understood your question wrong, but it seems like A* would be a good starting point for what you want to do.

    Check out: http://en.wikipedia.org/wiki/A*_search_algorithm

    Some pseudo code there to help you out too :)

提交回复
热议问题