How to determine a Heuristic for an algorithm, say A*, is a good one

2.4k Views Asked by At

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?

1

There are 1 best solutions below

5
On

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

  1. Number of food pallets left?
  2. Distance of the current pallet to the Next Unexplored Pallet?
  3. 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).