written 6.2 years ago by |
The heuristic function is a way to inform the search about the direction to a goal.
It provides an informed way to guess which neighbor of a node will lead to a goal. It must use only information that can be readily obtained about a node
The objective of a heuristic is to produce a solution in a reasonable time frame that is good enough for solving the problem at hand.
This solution may not be the best of all the actual solutions to this problem, or it may simply approximate the exact solution. But it is still valuable because finding it does not require a prohibitively long time.
The representation may be approximate cost of the path from the goal node or number of hopes required to reach to the goal.
The heuristic function that we are considering, for a node n is, h (n) =estimated cost of the cheapest path from the state at node n to a goal.
Example: For Travelling Salesman Problem, the sum of the distances traveled so far can be a simple heuristic function.
It is of two types: Maximize or Minimize function.
In maximization, greater the cost of node, better is node while in minimization, lower the cost better is the node.