AI SMPS Problem Decomposition
AI SMPS Problem Decomposition
Problem Decomposition
A First Course in Artificial Intelligence: Chapter 6
Deepak Khemani
Department of Computer Science & Engineering
IIT Madras
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Problem Decomposition
• So far our view of problem solving using search
has been state centered
– the state space is the arena for search
– the solution is expressed as a sequence of states
– even when we talk of solution space, the solution, for example for the TSP
problem, is expressed in terms of states.
• Problem decomposition takes
a goal directed view of problem solving
– the emphasis is on breaking up a problem into smaller problems
• like in backward state space planning: goal à subgoals
– primitive problems are labeled SOLVED
– … otherwise they are LIVE and have to be refined
• like in the SSS* game playing algorithm
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Motivation
• Consider the problem of planning an evening out with friends
• To plan for an activity, a movie followed by dinner
• Let us say the agent proposing the plan works with a MoveGen
as follows
– in the start state pick an activity
– having chosen an activity pick a movie
– having picked a movie pick a restaurant for dinner
– propose the plan
• if not accepted then backtrack
• essentially doing depth first search
• Then the search conducted by the agent may be as follows…
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Depth First Search Start
Saravana Bhavan
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
The culprit? Start
Saravana Bhavan
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Wasted search Start
Chronological backtracking in
The Matrix The Matrix
DFS results in wasted effort
below the Visit Mall node.
Pizza Hut Seven Samurai
Saravana Bhavan
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
The key choices Start
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
An AND-OR tree PlanOuting The solution is a subtree!
Dinner
Outing
OR arc
Movie
Seven Samurai
The Matrix
Bhuvan Shome
Artificial Intelligence: AI
Another option
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
x4 Symbolic Integration
-------------
dx
(1-x2)5/2
x= sin(y)
sin4y
dy
cos4y
z= tan(y/2)
cot–4y dy tan4y dy z4
32 dx
(1+z2)(1-z2)4
dx z4
dz
x4(1+x2) 1+z4
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Symbolic Integration
1 .
(-1 + z2 + 1+z2 ) dz
dz
-dz z2 dz 1+z2
w = -z z = tan(w)
dw dw
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Dendral (1965-1980)
One of the earliest successes of AI was the program Dendral
(for Dendritic Algorithm) developed at Stanford University.
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Structural formulas C C
Candidate structures for
C6H13NO2 generated by C C C
CONGEN [Buchanan 82]. C
C
The hydrogen atoms are N C N
C C O
not shown.
O O O
O C C C C
C C N O O C C
C C N C C C
O C
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Dendral: an Expert System
The program DENDRAL
explored and And-Or graph.
It generated candidate
structures and generated a
synthetic spectrogram.
An Expert System
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Goal Trees
The search space generated for solving And-Or (AO)
problems can be seen as a goal tree.
G
The figure shows that a goal G may be refined in two ways
• the left branch involves solving the subgoal A
• the right branch reduces in to subgoals B and C
• both have to be solved
A B C
A BC
A B C
B C
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Solving Goal Trees
At any point the algorithm AO* maintains a graph generated so far.
The algorithm follows the marked path leading to a set of live nodes.
It refines one of the LIVE nodes by expanding it.
It backs up the cost of the best hyper arc and propagates it upwards.
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
AO*
The algorithm for solving the goal tree, known as the AO* algorithm
(Martelli and Montanari, 1978; Nilsson, 1980) has the following cycle.
• Starting at the root traverse the graph along marked paths till the
algorithm reaches a set of unsolved nodes U.
• Pick a node n from U and refine it.
• Propagate the revised estimate of n up via all ancestors.
• If for a node all AND successors along the marked path are marked
SOLVED mark it SOLVED as well.
• If a node has OR edges emanating from it, and the cheapest
successor is marked SOLVED then mark the node SOLVED.
• Terminate when the root node is marked SOLVED.
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
An illustration
G
46 51
G 2
4 3
h=45
A B C
h=42 h=22 h=24
4 2
3 3
Best option
marked
D E F G
h=23 h=24 h=22 h=18
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
AO*: forward phase
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
AO*: forward phase
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Algorithm AO*
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Admissibility of AO*
Like A* the algorithm AO* is also admissible (finds the least cost solution)
when the heuristic function underestimates the actual cost.
The explanation is the same as before – as long as the partial solutions are
looking better it will keep exploring them.
6 8
10 10
9
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
AO*
11 Node to be expanded
Start
21
6 5
7 4
12
2
6 7 4
2
6 7 8
3 4
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
11
13
2
6
7
7
2
6
7
9
1 4
3 4 10
10
10
10
9
10
10
9
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Solution 8
Start The algorithm terminates as the
root (start) is labeled SOLVED
6 2
7 4
1 1
Solution found with cost = 8
7
6 8
10 10
9
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Edge cost = 10 29
Start
21 Cost of each arc = 10
6 5
7 4
33
35
20
6 7 4
20
6 27 4
20
6 20
33 6
4 33 17
3 10
3 10
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
66
59
20
6
40
20 29
6
33
29
10 10
3 10 19
19
10
10
9
10
10
9
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Explores more nodes 70
69
20
10
40
30
20
10
40
29
10 10
10 10 20
19 6 8
6 8
10
10
10
10
10
9
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Means Ends Analysis
In their seminal work on Human Problem Solving, Newell and Simon proposed a
general purpose strategy for problem solving, which they call the General
Problem Solver (GPS). GPS encapsulated the heuristic approach which they
called Means Ends Analysis.
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
Means Ends Analysis Achieve goal G from state S
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras
End : AO*
Artificial Intelligence: Search Methods for Problem Solving Deepak Khemani, IIT Madras