0% found this document useful (0 votes)
77 views29 pages

Lec5 Problem Reducti AOstar

The document discusses problem reduction and AND-OR graphs. It provides an example of using AND-OR graphs to represent decomposing the goal of "Prepare Dinner" into subgoals of making hamburgers and fried rice. It then summarizes best-first search approaches for AND-OR graphs, including the Problem Reduction and AO* algorithms. Key points are that AND-OR graphs require finding all solution paths rather than a single path, and algorithms must account for interaction between subgoals to find optimal solutions.

Uploaded by

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

Lec5 Problem Reducti AOstar

The document discusses problem reduction and AND-OR graphs. It provides an example of using AND-OR graphs to represent decomposing the goal of "Prepare Dinner" into subgoals of making hamburgers and fried rice. It then summarizes best-first search approaches for AND-OR graphs, including the Problem Reduction and AO* algorithms. Key points are that AND-OR graphs require finding all solution paths rather than a single path, and algorithms must account for interaction between subgoals to find optimal solutions.

Uploaded by

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

Problem - Reduction

And-or Graphs (Trees)


• Useful for representing decomposable problems.
• The decomposition generates and arcs and or
arcs.
• The original problem corresponds to the root.
• An AND node is solved if all its children nodes
are solved.
• An OR node is solved if one of the children
nodes is solved.
Example of Problem – Reduction

Goal:Prepare Dinner

Goal: Make Hamborgers Goal:Make Fried rice

Prepare- Toast Fry Make Cook


Patties Buns Vegetables Masala Rice
Example of Problem – Reduction (Contd..)

• Each arm of and arc leads to its own


solution node.
• The solution of and-or graph is a path from
start node to a set of nodes representing
solution states.
Best-First Search and Problem - Reduction

Best-First Search has to be modified to handle


and-or graphs
A f1(B) = 5, f1 (C) = 3, f1 (D) = 4

f1 = estimate of heuristic
function value
B C D
(5) (3) (4)
Fig. – 2(a)
Best-First Search and Problem – Reduction
(Contd..)
• Assume that every operation has a uniform cost 1.
• The ARC with single successor has a cost 1.
• And Arc with multiple successors has a cost 1 for each
successor.
• The cost of A when B is followed 5 + 1 = 6.
• The cost of A when and AND arc is followed 3+4+1+1=
9.
• If only f1 values are compared, C is to be chosen. Node
to be selected must depend not on f1 value only
Best-First Search and Problem – Reduction
(Contd..)
• Fig. 2-b. Illustrates this
• To use AC, AD is also to be followed.
• To use CG arc CH is also to be used.
• The path from A through B to E and F is
better with A total cost of 18.
Best-First Search and Problem – Reduction
(Contd..)
(18) A
(38)
B C D

(17) (9) (27)


E F G H I J
(5) (10) (3) (4) (15) (10)
Fig. 2(b)
ALGORITHM : PROBLEM REDUCTION

1. Initialize the graph to the start node.


2. Loop until the start node is labeled
solved or its cost goes above futility ( A
value too expensive to be practical)
a) Traverse the graph, starting at initial
node, and follow the current best path,
and accumulate the set of nodes that are
on the path and have not been expanded
or labeled as solved
ALGORITHM : PROBLEM REDUCTION (Contd..)

b) - Pick one of the unexpanded nodes and expand it.


- If there are no successor assign futility to it.
- Otherwise add its successors to the graph and for
each of them compute f1 (use only h1, ignore g).
- If f1 of any node is 0, mark it as solved.
c) Change f1 of newly expanded nodes to reflect the f1
values provided by its successors.
- Propagate the change backward through the graph.
- If any node contains a successor arc whose
descendents are solved, label it solved.
ALGORITHM : PROBLEM REDUCTION (Contd..)

• While going up the graph, at each node


visited, decide which of its successor
arcs is the best, and make the part of
current best path.
• So the current best path may change.
• This backward propagation is not in BFS.
Back Propagation : Example

A (5) A (6)

(9)

B C D
(3) (4) (5)
Back Propagation : Example (Contd..)

A A

B (9) C D B C D
(3) (4) (10) (4) (10)
E F G H E F
(4) (4) (5) (7) (4) (4)
Node= A,Successors= B,C & D Node =B Successor G,H
Observations about OR graph &
AND - OR graphs

B C D A
Unsolvable
G H E F D
C
I J (5) E (2)
Fig.5 -(a) Fig.5 -(b)
Observations about OR graph &
AND - OR graphs (Contd..)
• Search strategies for OR graph find a single
path to a goal.
- solution for and-or graphs is a path from start
node to a set of solution states.
• In Best-First (or graph) the desired path from
one node to another was always with lowest
cost. This is not always true in and or graph.
• When searching and-or graph due to and arcs
a longer path may be better as in Fig. 5 (a).
Observations about OR graph &
AND - OR graphs (Contd..)

• And-or graph (Problem Reduction


Algorithms) fail to take into account
interaction between sub-goals.
• In Fig. 5(b), since the algorithm does not
consider interaction between C and D, it
will find a non optimal path.
AO* Algorithm
• Problem-Reduction is a simplification of AO*.
• A* uses two lists open and closed,
• AO* uses single structure graph.
• Each node points to immediate successors and
immediate predecessors.
• Each node has h1 value.
h1 is the cost of a path from the node to a set of
solution nodes.
• g is not stored as the nodes on the best path will
be considered for expansion.
AO* Algorithm (Contd..)
ALGORITHS : AO*
1. Let graph consist of initial node INIT
compute h1 (INIT)
2. Until INIT is labeled solved or until h1 >
FUTILITY repeat the following.
(A node is solved if all its successors are
solved. A solution is found if INIT is
solved. FUTILITY is a high value).
AO* Algorithm (Contd..)
• Expand INIT and select one of the
unexpanded nodes.
• (a) Trace the labeled arcs from INIT and select
one of the unexpanded nodes that occur on
this path. Call the selected one as NODE.
• (b) Generate the successors of NODE; if no
successors,
h1(NODE) = FUTILITY; means NODE is not
solvable. If there are successors, for each
successor that is not also an ancestor of
NODE, do the following.
AO* Algorithm (Contd..)
i) Add successor to graph.
ii) If successor is a terminal node, label it solved,
and assign h1 a value of 0.
iii) If successor is not a terminal node, compute
h1.
iv) Propagate the new information up the graph
as follows:
v) Let S be the set of nodes that have been
labeled solved or whose h1 values have to be
changed.
AO* Algorithm (Contd..)
• Initialize S to node.
• Until S is empty, repeat the following –
i) Select a node current and remove it
from S. If possible, select current such
that none of its descendants in graph
occurs in S.
ii) Compute the cost of each of the arcs
emerging from current.
AO* Algorithm (Contd..)
• Select the arc with minimum cost as the best
path from current.
• Mark current solved if all of the nodes connected
to it through the new arc have been solved.
• If current has been labeled solved or if the cost
of current was just changed then the cost must
be propagated back up the graph.
• For this add all of the ancestors of current to S.
Observations about AO* Algorithm

• AO* always finds a minimum cost solution tree if


one exists.
• The propagation of cost change back up through
a large number of paths that are already known
not to be very good.
• The ancestors of a node whose cost was altered
are added to the set of nodes whose cost must
also be revised.
• The backward cost propagation is guaranteed to
terminate even on graphs containing cycles.
Observations about AO* Algorithm (Contd..)

A (7)

B (10) C (6)

D (3) E (5)

Fig. 4-1
An unnecessary
Backward Propagation
Observations about AO* Algorithm (Contd..)

• Suppose after expanding node E the cost of E is


updated to 10 and back propagated to B and C.
• Then the path through C will be better (Q 16 >
12).
• If B is not updated then path through B would
have been better (Q 12>11) and new value of E
would have been counted after expanding D,
and the path through C will again be better.
Observations about AO* Algorithm (Contd..)

A (11)

B (13) C (10)

D (5) E (6) F (3)

G (5)
Fig. 4-2 (a)
A necessary
Backward Propagation
Observations about AO* Algorithm (Contd..)

A (14)

B (13) C (15)

D (5) E (6) F (3)

G (10)

H (9)
Fig. 4-2 (b) A necessary Backward Propagation
Observations about AO* Algorithm (Contd..)

• In Fig. 4.2(a), if the cost of G is revised to


10 as in Fig. 4.2(b) and if it is not
immediately propagated back to E, then
the change will never be recorded and a
non-optimal solution through B may be
discovered.
DESIRABLE PROPERTIES OF
HEURISTIC SEARCH ALGORITHMS
Admissibility Condition : Algorithm A is
admissible if it is guaranteed to return an
optimum solution when one exists (A* is
admissible).
Completeness Condition : A is complete
if it always terminates with a solution when
one exists.
DESIRABLE PROPERTIES OF
HEURISTIC SEARCH ALGORITHMS
(Contd..)
Dominance Property : Let A1 and A2 be
admissible algorithms with heuristic
functions h1* and h2*.
• A1 is said to be more informed than A2
whenever h1*(n) > h2*(n) " nodes n.
A1 is also said to dominate A2.
Optimality Property : A is optimal over a
class of algorithms if A dominates all
members of the class.

You might also like