0% found this document useful (0 votes)
162 views15 pages

Ai HF

Heuristic methods are techniques used for problem solving when an exhaustive search is impractical. Heuristic search employs heuristics to help guide the search process and reduce alternatives. A heuristic function ranks alternatives based on available information to help decide which branch to follow. Common techniques for finding effective heuristics include using sub-problem solutions or relaxed problem solutions as estimates. Generate-and-test and hill climbing are example heuristic search algorithms that generate and evaluate candidates to find an optimal solution.

Uploaded by

jimmi481
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views15 pages

Ai HF

Heuristic methods are techniques used for problem solving when an exhaustive search is impractical. Heuristic search employs heuristics to help guide the search process and reduce alternatives. A heuristic function ranks alternatives based on available information to help decide which branch to follow. Common techniques for finding effective heuristics include using sub-problem solutions or relaxed problem solutions as estimates. Generate-and-test and hill climbing are example heuristic search algorithms that generate and evaluate candidates to find an optimal solution.

Uploaded by

jimmi481
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 15

Artificial Intelligence

What is Heuristic?
Heuristic refers to experience-based techniques for problem solving, learning, and discovery. Where an exhaustive search is impractical, heuristic methods are used to speed up the process of finding a satisfactory solution. Examples of this method include using a rule of thumb, common sense etc.

Heuristic Search
Heuristic search is an AI search technique that employs heuristic for its moves. Heuristics help to reduce the number of alternatives . These techniques are often called weak methods.

Heuristic Functions
A heuristic function is a function that ranks alternatives in various search algorithms at each branching step based on the available information (heuristically) in order to make a decision about which branch to follow during a search. For example, for shortest path problems, a heuristic function is defined on the nodes of a search tree, which serves as an estimate of the cost of the cheapest

Finding heuristics
The problem of finding an admissible heuristic with a low branching factor for common search tasks has been extensively researched in the artificial intelligence community. Several common techniques are used: Solution costs of sub-problems often serve as useful estimates of the overall solution cost. A common idea is to use a pattern database that stores the exact solution cost of every sub-problem instance. The solution of a relaxed problem (independent moves) often serves as a useful admissible estimate of the original. Given a set of admissible heuristic functions , the function is an admissible heuristic that dominates all of them.

Heuristics giving lower branching factors at every node in the search tree are preferred for the resolution of a particular problem, as they are more computationally efficient.

Example

Heuristic function to estimate the number of steps required to solve an 8-puzzle from a given state. Two simple heuristic functions are: h1(n)= the number of misplaced tiles. In the pictured example, the start state has h1(n)= 8. This is also known as the Hamming Distance. Clearly, is an admissible heuristic because any tile that is out of place will have to be moved at least once. h2(n)= the sum of the distances of the tiles from their goal positions. Because tiles cannot be moved diagonally, the distance counted is the sum of horizontal and vertical distances. This is also known as the Manhattan Distance. In the pictured example, the start state has h2(n)= 3 + 1 + 2 + 2 + 2 + 3 + 3 + 2 = 18. Clearly, is an admissible heuristic because any move can, at best, move one tile one step closer to the goal.

Generate-and-Test
Algorithm:
1. Generate a possible solution. For some problems, this means generating a particular point in the problem space. For others it means generating a path from a start state 2. Test to see if this is actually a solution by comparing the chosen point or the endpoint of the chosen path to the set of acceptable goal states. 3. If a solution has been found, quit, otherwise return to step 1.

Generate-and-Test
In its most systematic form, it is simply an exhaustive search of the problem space. Operate by generating solutions randomly. Also called as British Museum algorithm Dendral: Which infers the structure of organic compounds using NMR spectrogram. It uses plangenerate-test.

Simple Hill Climbing


Algorithm: 1. Evaluate the initial state. If it is also goal state, then return it and quit. Otherwise continue with the initial state as the current state. Loop until a solution is found or until there are no new operators left to be applied in the current state:
a. b. Select an operator that has not yet been applied to the current state and apply it to produce a new state Evaluate the new state
i. ii. If it is the goal state, then return it and quit. If it is not a goal state but it is better than the current state, then make it the current state.

2.

iii. If it is not better than the current state, then continue in

Steepest-Ascent Hill Climbing


Algorithm:
1. Evaluate the initial state. If it is also a goal state, then return it and quit. Otherwise, continue with the initial state as the current state. Loop until a solution is found or until a complete iteration produces no change to current state: a. b. Let SUCC be a state such that any possible successor of the current state will be better than SUCC For each operator that applies to the current state do:
i. ii. Apply the operator and generate a new state Evaluate the new state. If it is a goal state, then return it and quit. If not, compare it to SUCC. If it is better, then set SUCC to this state. If it is not better, leave SUCC alone.

2.

c.

If the SUCC is better than the current state, then set current state to SUCC,

Example

H1(n)= Add one point for a block that is resting on the thing it is supposed to be resting on. Subtract one point for every block that is sitting on the wrong thing. H2(n)= For each block that has a correct support structure (i.e. complete set structure underneath it is as it should be), add one point for every block in the support structure. For each block that has an incorrect support structure, subtract one point for every block in the existing

In the example, on applying the second heuristic function the difference between hill climbing and steepest ascent can be understood.

You might also like