PathPlanning icon indicating copy to clipboard operation
PathPlanning copied to clipboard

既然都继承了,为什么还写那么多重复的代码呢?

Open xdewx opened this issue 4 months ago • 1 comments

BFS、DFS、Dijkstra等均继承自AStar,searching方法大同小异,只不过priority的计算方式不同,为什么不抽象出来呢,这样也方便理解不同方法是如何组合演化的? 例如f(n)=g(n)+w*h(n):

  1. w=1时,就是AStar
  2. w=0时,就是Dijkstra
  3. w=1且g(n)=0时,就是Best First

xdewx avatar Aug 19 '25 04:08 xdewx

to keep code independent and easy maybe. And the 'open list' in BFS should be simply a list instead of a heap, entend is not a good idea

k88936 avatar Nov 16 '25 06:11 k88936