0% found this document useful (0 votes)
31 views17 pages

AND/OR Graphs

The document describes the AO* algorithm for searching AND/OR graphs. The AO* algorithm extends A* search to AND/OR graphs by examining multiple nodes simultaneously and propagating cost information up the graph. It works by expanding nodes on the most promising path, computing heuristics for successors, and propagating costs up to ancestors when successors are solved or costs change. An example traces the steps of AO* search on a sample AND/OR graph.

Uploaded by

dhdhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views17 pages

AND/OR Graphs

The document describes the AO* algorithm for searching AND/OR graphs. The AO* algorithm extends A* search to AND/OR graphs by examining multiple nodes simultaneously and propagating cost information up the graph. It works by expanding nodes on the most promising path, computing heuristics for successors, and propagating costs up to ancestors when successors are solved or costs change. An example traces the steps of AO* search on a sample AND/OR graph.

Uploaded by

dhdhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

AND/OR graphs

 Some problems are best represented as


achieving subgoals, some of which
achieved simultaneously and
independently (AND)
 Up to now, only dealt with OR options
Acquire Car

Steal car Earn Money Buy car


Searching AND/OR graphs
 A solution in an AND-OR tree is a sub tree
whose leafs are included in the goal set

 Cost function: sum of costs in AND node


f(n) = f(n1) + f(n2) + …. + f(nk)

 How can we extend A* to search AND/OR


trees? The AO* algorithm.
AND/OR search
 We must examine several nodes
simultaneously when choosing the next
move
A
(9) A
(3) B D (5)
(4) C 38
B C D
17 9 27
E F G H I J
(5) (10) (3) (4) (15) (10)
AND/OR Best-First-Search
 Traverse the graph (from the initial node)
following the best current path.
 Pick one of the unexpanded nodes on that
path and expand it. Add its successors to
the graph and compute f for each of them
 Change the expanded node’s f value to
reflect its successors. Propagate the
change up the graph.
 Reconsider the current best solution and
repeat until a solution is found
AND/OR Best-First-Search
example
1. 2.
A A
(5) (9)
(3) B D (5)
(4) C
3.
A
(9) D (10)
B (3) C (4)
(10)
E (4) F (4)
AND/OR Best-First-Search
example

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:

i. Remove a node from S and call it CURRENT.


ii. Compute the cost of each of the arcs emerging from
CURRENT. Assign minimum cost of its successors as its h.
iii. Mark the best path out of CURRENT by marking the arc that
had the minimum cost in step ii
iv. Mark CURRENT as SOLVED if all of the nodes connected to
it through new labeled arc have been labeled SOLVED
v. If CURRENT has been labeled SOLVED or its cost was just
changed, propagate its new cost back up through the graph.
So add all of the ancestors of CURRENT to S.
An Example
An Example
(8) A
An Example
[12] A [13]
4 5
5
(1) B D (8)

(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

You might also like