How to design the heuristic for A* when there are multiple goals in the grid map?

落爺英雄遲暮 提交于 2019-12-10 21:12:18

问题


I am facing a problem that I have to use A* to search through the map, and there are multiple goals in this map to reach. My aim is to expand the least nodes in the map, any idea on how to design the heuristic for this A* algorithm? thanks


回答1:


Assuming by "multiple goals" you mean you want to reach any one, just take the minimum of all the heuristics. Assuming your heuristic is consistent, this is still a consistent heuristic.

If instead you're trying to reach all of them, this is essentially the traveling salesman problem, which is NP-Complete.



来源:https://stackoverflow.com/questions/18779090/how-to-design-the-heuristic-for-a-when-there-are-multiple-goals-in-the-grid-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!