Is A* the best pathfinding algorithm?

前端 未结 4 1904
春和景丽
春和景丽 2020-12-22 17:40

It is generally said that A* is the best algorithm to solve pathfinding problems.

Is there any situation when A* is not the best algorithm

4条回答
  •  庸人自扰
    2020-12-22 18:05

    A* is special because can be morphed into other path-finding algorithms by playing with how it evaluates nodes and the heuristics it uses. You can do this to simulate Djikstra's, best-first-search, breadth-first-search, and depth-first-search.

    Furthermore, it's often easy to speed it up. For instance, if you multiply an admissible heuristic by a constant, c, you can guarantee that the cost of the resulting sequence of nodes is no more than c times the optimal result.

    For instance, take this awesome paper by Ian Davis (written for Star Trek Armada). A* is used with a hierarchical set of waypoints, which results in a rough path. THEN, in order to smooth the path, they run A* again on a new, generated graph containing the nodes on the path and those nearby to get a more reasonable path. Finally, they run rubber-banding to remove redundant nodes.

    So, A* isn't the solution to everything, but it's a very versatile tool.

提交回复
热议问题