Problems, Problem Spaces, and Search • Define the Problem

Problems, Problem Spaces,
and Search
• Define the Problem
• Analyse the problem
• Isolate and represent the
task knowledge
• Choose the best problemsolving technique
Chapter 2
Defining the Problem as a
State Space Search
Example - Water Jug
You are given two jugs, a 4-gallon
one and a 3-gallon one. Neither has
any measring markers on it. There
is a pump that can be used to fill
the jugs with water. How can you
get exactly 2 gallons of water into
the 4-gallon jug?
initial state (0,0)
goal state (2,n)
Chapter 2
1 if x<4 ->
2 if y<3 ->
3 if x>0 ->
4 if y>0 ->
5 if x>0 ->
6 if y>0 ->
7 if x+y>=4 and y>0 ->
8 if x+y>=3 and x>0 ->
9 if x+y<=4 and y>0 ->
10 if x+y<=3 and x>0 ->
11 (0,2) ->
12 (2,y) ->
Chapter 2
Formal Description of a Problem
1- Define a state space
2- Specify initial states
3- Specify goal states
4- Specify set of rules that describe the
actions available
Chapter 2
Production System
A set of Rules
One or more databases
A control stsretegy
A Rule applier
Chapter 2
Control Strategies
The requirements of a good control
strategy are :
it causes motion
it is systematic
Chapter 2
Algorithm : Breadth-First Search
(0,0) (1,3)
(4,3) (0,0)
Algorithm : Depth-First Search
Chapter 2
Advantage of Depth-First Search
Less Memory
By chance, it may find a solution
without examining much of the
search space at all
Advantage of Breadth-First
It will not get trapped exploring a blind
If there is a solution then BFS is
guaranteed to find it
If there are multiple solution, a minimal
solution will be found
Chapter 2
Heurestic Search
The traveling Salesman Problem
A Simple motion-causing and systemic
control structure can solve the problem
in time propootional to:
(N-1) !
Applying nearest neighbor heurestic
A heurestic function is a function that
maps from problem state descriptions
to measures of desirability , usually
represented as numbers
Chapter 2
Problem Characteristics
Is the Problem Decomposable?
Integration, Blocks World
Can Solution Steps Be Ignored or Undone ?
Theorem Proving, 8-Puzzle, Chess
Is the Universe Predictable?
8-Puzzle, Bridge
Is a Good Solution Absolute or Relative ?
Answering question, Salesman Problem
Is the Solution a State or a Path?
NLUnderstanding, Water Jug
What is the Role of Knowledge?
Chess, newspaper story understanding
Does the Task Require Interaction witha
Theorem proofing, Medical Diagnosis
Chapter 2
Production System Characteristics
• A Monotonic Production System is a
production system in which the
application of a rule never prevents the
later application of another rule that
could also have been applied at the time
the first rule was selected
• A Nonmonotonic Production System
is one in which the above condition is
not true
• A Partially commutative Production
System is a production system with the
property that if the application of a
particular sequence of rules transforms
state x into state y , then any
permutation of those rules that is
allowable also transforms state x into
state y
• A commutative Production System is
a production system that is both
monotonic and partially commutative.
Chapter 2
Issues in the Design of
Search Programs
• Forward versus backward reasoning
• Matching rules against state
• Representing each node of the search
Additional Problems
The Missionaries and Cannibals Problem
The Tower of Hanoi
The Monkey and Banana Problem
Chapter 2