Professional Documents
Culture Documents
Artificial Intelligence
Chapter 2: General Representation
of AI problems
1
AI Problem
• Assume: P is an AI problem.
Artificial Intelligence 3
07:21 PM
Problem Solving in AI
• Problem solving can be converted into a graph
where nodes are the problem states and edges
are actions.
5
Representation of search problems
Graphs and Trees
A search problem is represented using a:
• Directed graph :
– The states are represented as nodes.
– The allowed actions are represented as arcs.
• Undirected graph :
– Edges does not imply directions.
• Weighted graph:
– Edges may have weight (cost).
11
Representing the Search Space
• Basic search problem could be stated as:
– Given [S, s, O, G] where:
• S is the set of states.
• s is the initial state.
• O is the set of state transition operators (actions).
• G is the set of goal state(s).
– Purpose: to find a sequence of state transitions
heading from s to a goal state G.
Artificial Intelligence 12
07:21 PM
Example-2
Search in a Maze
Operator O= {(A, left, B), (A, down, C), (A, right, D), (B, left, E),
(B, down, F), (B, right, A), (E, right, B), (E, down, I), (D, left, A),
(D, down, G), (D, right, H), (H, left, D), (H, down, J), (J, up, H),
(G, up, D), (C, up, A), (F, up, B), (I, up, E)}
Artificial Intelligence 14
07:21 PM
Representing the Search Space
s A
B C D
E F G H
I
J End of Solution
Artificial Intelligence
15
07:21 PM
Example-3
Search in a Puzzle Space
C C
B B
A A
Artificial Intelligence 19
07:21 PM
Search in a Puzzle Space
S G
S =((A,B), (),()) G =((), (),(A,B))
Artificial Intelligence 21
07:21 PM
Missionaries and Cannibals
<Simplified>