问题
I have implemented an A* algorithm for solving the 15-puzzle. I made a research for finding some viable or admissible heuristics, looking for a fast solution, and i find that using 4*Manhattan Distance as heuristic always solve any 15-puzzle in less than a second. I tried this and effectively works. I tried to find a answer for that but i cant find it.
Any one can explain this?
回答1:
4* manhattan distance is not admissible heuristic, this makes the algorithm behave "closer" to greedy best first (where the algorithm chooses which node to develop solely based on the heuristic function). This makes the algorithm sometimes prefer depth of solutions and exploration over breadth and optimality.
The idea is similar to what happens in A*-Epsilon, where you allow A* to develop none optimal nodes up to a certain bound in order to speed up your algorithm, Actually - I suspect you will get the same (or similar results) if you run A*-Epsilon with Manhattan distance and epsilon = 3
. (If I am correct, this makes the solution you find in the modified heuristic bounded by 4*OPTIMAL
, where OPTIMAL is the length of the optimal path)
来源:https://stackoverflow.com/questions/13075199/why-a-is-faster-if-i-use-4xmanhattan-distances-as-heuristic-for-15-puzzle