Reputation: 2890
I am recently learning A* algorithm, I know it takes a heuristic value when finding the potential path, and I also understand what consistent and admissible is for a heuristic. But I am confused that what kind of heuristic is good and why is it good?
BTW, how does heuristics work?
Upvotes: 1
Views: 2501
Reputation: 9412
Selecting a heuristic is, in my opinion, mostly dependent on the problem. Yet, selecting a heuristic becomes easier if the problem is understood in a goal-oriented fashion. At least thats what I do. The idea I follow is this:
The heuristic evaluates to zero at the goal state.
So what are all the scenarios ? What are all the functions that yield zero at the goal?
Possible Heuristics
- Number of food pallets left?
- Distance of the current pallet to the Next Unexplored Pallet?
- Unexplored Area in the grid with food pallets etc
I would go with the last option since it seems more reliable, though all the three will eventually lead to the solution.
So, I believe, you select a heuristic by putting yourself at the goal state and then look back and see what all you have accomplished on the way. So in a sense, a heuristic is nothing but an approximation of what needs to be accomplished ( which evaluates to 0 at the goal).
Upvotes: 1