Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a Heuristic Function

Can someone explain in very simple words what it is. Also provide an example. So for example if u have to find the heuristic function of something how is it supposed to look like?

Take as an example the problem:

For the water jug problem http://www.math.tamu.edu/~dallen/hollywood/diehard/diehard.htm

Devise and explain an admissible heuristic function (h) [not the trivial h(n) = 0]. The cost of an action is defined as 1 unit for performing the action, an additional 1 unit for moving each gallon of water (fill, empty, pour), and an additional 1 unit for wasting each gallon of water (empty). The path cost (g) is the sum of the cost of all the actions.

like image 581
user4303 Avatar asked Oct 01 '14 08:10

user4303


1 Answers

A heuristic function, is a function that calculates an approximate cost to a problem (or ranks alternatives).

For example the problem might be finding the shortest driving distance to a point. A heuristic cost would be the straight line distance to the point. It is simple and quick to calculate, an important property of most heuristics. The true distance would likely be higher as we have to stick to roads and is much harder to calculate.

Heuristic functions are often used in combination with search algorithms. You may also see the term admissible, which means the heuristic never overestimates the true cost. Admissibility can be an important quality and is required for some search algorithms like A*.

like image 89
blueenvelope Avatar answered Oct 26 '22 15:10

blueenvelope