0% found this document useful (0 votes)
2 views

Ch 3

The document discusses various heuristic search techniques, including Generate and Test, Hill Climbing, Best First Search, Constraint Satisfaction, and Means End Analysis. Each technique is explained with examples, highlighting their processes and applications in problem-solving. The effectiveness of these methods depends on the problem domain and the heuristics applied.

Uploaded by

ANIK CHAKRABORTY
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Ch 3

The document discusses various heuristic search techniques, including Generate and Test, Hill Climbing, Best First Search, Constraint Satisfaction, and Means End Analysis. Each technique is explained with examples, highlighting their processes and applications in problem-solving. The effectiveness of these methods depends on the problem domain and the heuristics applied.

Uploaded by

ANIK CHAKRABORTY
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Heuristic Search Techniques

Heuristic Search
• Are a set of general purpose search
techniques.
• Can be described independently of any
problem domain.
• Their efficacy is highly dependent on the
applied problem domain since they are unable
to overcome combinatorial explosion.
• Two methods already discussed (DFS and
BFS).
2
Generate and Test
Algorithm: Generate and Test
1. Generate a possible solution. For some problems, this
means generating a particular point on problem space.
For others, it means generating a path from start state.
2. Test to see if it is actually a solution by comparing the
chosen point or end point of chosen path to the set of
acceptable states.
3. If solution has been found quit. Otherwise return to
step 1.
• Is a DFS procedure.

3
Example: Colored Blocks Problem

• Four six sided cubes each side of the cube


painted one of the four colors.
• Task: arrangement of the cubes in a row such
that on all four sides of the row one block face
of each color is showing.
• Solution: There are more, say, red faces than
there are any colors. While placing a block
with red faces use as few of them as outside
faces.

4
Hill climbing
• In pure generate and test procedure, the test
function responds only with yes or know.
• Hill climbing is a variant of generate and test
in which the feedback from the test procedure
decides the direction of search process.
• Test function is augmented with a heuristic
function to provide an estimate of how close a
given state is to the goal state.

5
Simple Hill Climbing

6
Colored Blocks Problem Revisited
• Heuristic function: Sum of the number of
different colors on each of four sides ( value 16 in
this case).
• Rule: Pick up a block and rotate it 90 degree in
any direction.
• Application of hill climbing: Generate a new state
by selecting a block and rotating it. If the
resulting state is better, keep it. If not return to
the previous state an try a different combination.

7
Best First Search
• DFS is good because it allows solution to be
found without all competing branches having
to be expanded.
• BFS is good because it does not get trapped in
dead end paths.
• BFS combines the effectiveness of both by
following a single path at a time but switching
paths when some competing path looks more
promising than the current one.

8
How does it work?
• At each step of the search process the most
promising node is selected by applying an
appropriate heuristic.
• The node is then expanded using appropriate set
of rules.
• If it is the solution then the search process stops.
• Otherwise all the new nodes are added to the set
of nodes generated so far.
• Again the most promising node is selected and
the process continues.

9
Example

10
• The heuristic function is an estimate of the cost
of getting to the solution from a given node.
• BFS is applied on a directed graph in which each
node represents a point in problem space. Each
node contains a description of the problem state,
an indication how promising it is, list of nodes
generated from it and the parent link.
• Such a graph is called an OR graph, since each
branch represents an alternate problem solving
path.

11
Two list of nodes are required....

• OPEN: nodes that have been generated and


have had the heuristic function applied on
them but have not yet been examined(i.e.
their successors generated).
• CLOSED: nodes that have been examined.

12
Heuristic Function….

• Estimates the merit of each node generated.


• Indicated as f1.
• Defined as the sum of two functions g and h1.
• g is a measure of the cost of getting from
initial state to current state.
• H1 is the estimate of the cost of getting from
the current node to the goal state.

13
14
Constraint Satisfaction
• Goal is to discover some problem state that
satisfies a given set of constraints.
• Ex: Cryptarithmetic puzzles.
• Is a search procedure that operates in a space of
constraint sets.
• Initial state: problem description.
• Goal state: problem solved following constraints.
• Two step process.

15
• First, constraints are discovered and
propagated as far as possible throughout the
system.
• Second, if the solution is not yet found a guess
is made and added as a new constraint.
• Constraint propagation terminates for one of
the two reasons. First, a contradiction is
detected. Second, propagation has run out of
steam and no further changes can be made on
the basis of current knowledge.

16
17
18
19
20
Means End Analysis
• Previous algorithms used either forward or
backward reasoning.
• MEA uses a mixture of these two techniques.
• Major parts of the problem are solved first
and then these parts appended to get the
solution.
• Difference between current state and goal
state is to be detected.

21
• Operator to be applied to reduce this
difference.
• But this operator may not be applicable to the
current state.
• This kind of backward chaining in which
operators are selected and then sub goals are
set up to establish the preconditions of the
operators are called operator sub goaling.
• If the operator does not produce the goal
state we want then the same process is
applicable.
• Thus the process can be applied recursively.
22
23
24
• Ex: Moving a desk with two things on it.
• Push or Carry operators may be used.
• Preconditions not satisfied for carry(as object
is not small).
• Preconditions for push satisfied.

25
Ex: Moving a desk with two things on it.

• Push or Carry operators


may be used.
• Preconditions not
satisfied for carry(as
object is not small).
• 2nd and 4th preconditions
for push satisfied.
• For 3rd and 4th
preconditions to be
satisfied pickup and
putdown operators are
required.

26
27
28

You might also like