Skip to content

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

@xdewx

Description

@xdewx

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions