AND/OR Graphs
AND/OR Graphs
4.
A
(12)
B (6) C (4) D (10)
(10)
G (5) H (7) E (4) F (4)
A Longer path may be better
A
B C D A
G H E F Unsolvable
B C D
I J G H E F Unsolvable
I J
Interacting Sub goals
C E
(5) (2)
AO* algorithm
1. Let G be a graph with only starting node INIT.
2. Repeat the followings until INIT is labeled SOLVED or
h(INIT) > FUTILITY
a) Select an unexpanded node from the most promising path
from INIT (call it NODE)
b) Generate successors of NODE. If there are none, set
h(NODE) = FUTILITY (i.e., NODE is unsolvable); otherwise
for each SUCCESSOR that is not an ancestor of NODE do
the following:
i. Add SUCCESSSOR to G.
ii. If SUCCESSOR is a terminal node, label it SOLVED and set
h(SUCCESSOR) = 0.
iii. If SUCCESSPR is not a terminal node, compute its h
AO* algorithm (Cont.)
c) Propagate the newly discovered information up the
graph by doing the following: let S be set of SOLVED
nodes or nodes whose h values have been changed
and need to have values propagated back to their
parents. Initialize S to Node. Until S is empty repeat
the followings:
(2)
C
An Example
[15] A [13]
4 5
5
(4) B 2 D (8)
(2)
C
An Example
[15] A [8]
4 5
5
(4) B 2 D (3)
(2)
C 2
4
(1) E
(0) G
An Example
[15] A [9]
4 5
5
(4) B 2 D (4)
(2)
C 2
2
4
(3) E
3
(0) G
An Example
[15] A Solved
4 5
5 Solved
(4) B 2 D
(2)
C 2
2
4
(3) E
3
(0) G Solved