有哪些不错的自动寻路算法?

自动寻路算法。
原理和实现

阅读 11k
7 个回答

楼上给的amitp的文章非常不错,他还有一篇 Pathfinding for tower defence 介绍了不同情况下适用的寻路算法(如单起点/单终点,单起点/多终点,多起点/多终点)。

http://www.redblobgames.com/pathfinding/tower-defense/

系統地介紹了各種 尋路算法,還有可交互逐步動畫。

  1. One source, one destination:
    Greedy Best First Search
    A* - commonly used in games
  2. One source, all destinations, or all sources, one destination:
    Breadth First Search - unweighted edges
    Dijkstra’s Algorithm - adds weights to edges
    Bellman-Ford - supports negative weights
  3. All sources, all destinations:
    Floyd-Warshall
    Johnson’s Algorithm
新手上路,请多包涵

深度优先也可以的

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题