Professional Documents
Culture Documents
Representation
Shaishav Agrawal
Lecture 5, 6, 7,8
{4, 0} {0, 3}
Fill 3 gallon Fill 3 gallon from 4
gallon
{4, 3} {1, 3}
.. And so
on.
Chess Problem
8
7
6
5
4
3
2
1
a b c d e f g h
Approach
• Specify the starting position of chess board.
• The rules that define legal moves.
• The winning board position.
• The main goal is not only to make legal moves but
also to win the game.
Problems in defining rules
• 10120 separate rules may be possible.
• Can any single person make all possible rules?
• Can any program easily handle all such rules?
Solution
• Generalization of rules.
Example of one generalized
rule
White pawn at square (file e, rank 2) AND
Square (file e, rank 3) is empty AND
Square (file e, rank 4) is empty AND →
Move pawn from Square (file e, rank 2) to
Square (file e, rank 4)
library
school hospital
school hospital
School Hospital
(5) (3)
Factory Park Newsagent
(4) (1) (2)
University (0)
Other heuristic search
methods
• Hill climbing: always choose successor node
with highest score.
• A*: Score based on predicted total path “cost”,
so sum of
o actual cost/distance from initial to current node,
o predicted cost/distance to target node.
Summary
• General search methods can be used to
solve complex problems.
• Problems are formulated in terms of initial
and target state, and the primitive actions that
take you from one state to next.
• May need to use heuristic search for complex
problems, as search space can be too large.