A-star: heuristic for multiple goals

前端 未结 3 1424
情话喂你
情话喂你 2020-12-19 04:47

Let\'s consider a simple grid, where any point is connected with at most 4 other points (North-East-West-South neighborhood).

I have to write program, that computes

3条回答
  •  萌比男神i
    2020-12-19 05:40

    Use Dijkstra's algorithm, which has as it's output the minimal cost to all reachable points. Then you just select the goal points from the output.

提交回复
热议问题