Unit 2
Problem-solving
and Building Smart
Systems
PROBLEM REPRESENTATION IN AI
Define
8-Puzzle
Missionaries and Cannibals
Cryptarithmetic
Remove 5 Sticks
Water Jug Problem
Real-world
problems
8-Puzzle
Given an initial configuration of 8 numbered tiles on
a 3 x 3 board, move the tiles in such a way so as to
produce a desired goal configuration of the tiles.
8-Puzzle
State: ?
Initial State: ?
Operators: ?
Goal State: ?
Operator table
Name
Cond. Transition
Effect
Empty5
(x,y)(0,y)
Empty 5-gal.
jug
Empty2
(x,y)(x,0)
Empty 2-gal.
jug
5to2
x>3
(x,2)(x,2)
Pour 2-gal.
into 3-gal.
(x,0)(x-2,2)
Pour 5-gal.
into 2-gal.
5to2
x2
5to2part
finding
Touring (traveling salesman)
Logistics
VLSI layout
Robot navigation
Learning
State space
Problem Reduction Space
AND/OR Graphs
State Space
The
we
State Space
The
State Space
State
Goal
world planning
8-puzzle, 15-puzzle
8 queens
Travelling salesman
Set covering
How can these problems be represented by graphs?
Propose corresponding state spaces
8-puzzle
In
blocks world:
actions may have different costs
(blocks have different weights, ...)
Assign
costs to arcs
Cost of solution = cost of solution path
AA
BB
The
2AB
1AC
1AB
1AC
1CB
2BC
1BA
1BC
1AC
3AC
3AC
2AB
1AC
B
3AC
2AB
1AC
1AB
3AC
2AB
1AC
1AB
1CB
3AC
1AC
2AB
1AC
1AB
1CB
3AC
1AC
2AB
1AC
1AB
1CB
2BC
1BA
3AC
1AC
2AB
1AC
1AB
1CB
2BC
1BA
1BC
3AC
1AC
2AB
1AC
1AB
1CB
2BC
1BA
1BC
1AC
AND/OR Graphs
An
One
AndOr Graph
AND/OR Graphs
An
An
Example:Matrix Multiplication
Example:Matrix Multiplication