user4303
user4303

Reputation: 91

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.

Upvotes: 9

Views: 46640

Answers (6)

niranjandev
niranjandev

Reputation: 1

Human evolutionary behavior is linked to cognitive and hearing intelligence, therefore, the heuristic paths are the easiest approximations. The instant responses are further processed with our inherent logic or elementary learning through our experiential knowledge. So Heuristic Approximation algorithms support our instant conclusions.

Upvotes: 0

Kiran Maniya
Kiran Maniya

Reputation: 8979

To determine the heuristic function, go through the traditional chess problem. generally, chess uses the combination of an algorithm to decide next move. head over to this link. i think it's the example you're looking for. Understand Heuristic Search with Chess

Upvotes: 0

Shakeel Ahmad
Shakeel Ahmad

Reputation: 11

Heuristics Function h(n) tells an estimate of the minimum cost from any vertex n to the goal.Based on the problem we choice the heuristic function, remember that selection of the heuristics funtion is gives true result on all nodes. For more details visit this website: http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html

Upvotes: 0

Sani Huttunen
Sani Huttunen

Reputation: 24385

From wiki

A heuristic function, or simply a heuristic, is a function that ranks alternatives in search algorithms at each branching step based on available information to decide which branch to follow.

I.e. in chess, a Heuristic Function can rule out possible moves that will lead to a worse position (or even loss) for a player and not further analyze the following moves since the result will not get any better.

Doing so the function can search more moves in a shorter time period since it doesn't waste time looking at bad moves.

Upvotes: 2

Paramjot
Paramjot

Reputation: 1

Heuristic function use to calculate the estimated cost of problem. Heuristic function for sliding - tiles puzzles called Manhattan distance. Heuristic function denoted by h(n). A number of algorithms make use of heuristic function including heuristic search, A* algorithm, IDA(iterative deepening-A*).

Upvotes: 0

blueenvelope
blueenvelope

Reputation: 699

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*.

Upvotes: 13

Related Questions