18AI55 - Module 2 Notes
18AI55 - Module 2 Notes
AI&ML V Sem
Module 2-Chapter 3
Problem reduction and Game Playing
Problem reduction, Problem Reduction & Game Playing Bounded look-ahead
strategy, Alpha-beta pruning, Two player perfect information games
3.1 Problem Reduction
One AND arc may point to any number of successors, all of which must
be solved.
Such structure is called AND–OR graph rather than simply AND graph.
Acquire TV
AND–OR Graph
To find a solution in AND–OR graph, we need an algorithm similar
to A*
with the ability to handle AND arc appropriately.
In search for AND-OR graph, we will also use the value of heuristic
function f for each node.
Page 1
18AI55 Artificial Intelligence Module II
AI&ML V Sem
Accumulate the set of nodes that are on the best path which have not yet
been expanded.
Add its successors to the graph and compute f (using only h) for each of
them.
Mark the best path which could be different from the current best path.
Let us assume that each arc with single successor will have a cost
of 1 and each AND arc with multiple successor will have a cost of 1
for each of its components for the sake of simplicity.
A
(20) (19) initially estimated values
Initially we start from start node A and compute heuristic values for
each of its successors, say {B, (C and D)} as {19, (8, 9)}.
The estimated cost of paths from A to B is 20 (19 + cost of one arc from A
to B) and from A to (C and D) path is 19 ( 8+9 + cost of two arcs A to C
and A to D).
Page 2
18AI55 Artificial Intelligence Module II
AI&ML V Sem
These values are propagated up and the revised costs of path from A
through (C and D) is calculated as 28 (9 + 17 + cost of arcs A to C and A
to D).
This path is still best path so far, so further explore path from A to B.
The process continues until either a solution is found or all paths have
lead to dead ends, indicating that there is no solution.
Cyclic Graph
We can now state precisely the steps taken for performing heuristic
search of an AND-OR graph.
Page 3
18AI55 Artificial Intelligence Module II
AI&ML V Sem
Page 4
18AI55 Artificial Intelligence Module II
AI&ML V Sem
Example
Solved Solved
Solved Solved
Page 5
18AI55 Artificial Intelligence Module II
AI&ML V Sem
Compute h(INIT).
{1
Traverse the graph starting from INIT and follow the current best
path.
Accumulate the set of nodes that are on the path which have not
yet been expanded or labeled as SOLVED.
Select one of these unexpanded nodes. Call it NODE and expand it.
{2
Until S is empty
{3
Page 6
18AI55 Artificial Intelligence Module II
AI&ML V Sem
2}
1}
2 4 Unsolvable
5 6
9 10
Explanation
Now node 10 is expanded at the next step and one of its successors is
node 5.
This new path to 5 is longer than the previous path to 5 going through 3.
Page 7
18AI55 Artificial Intelligence Module II
AI&ML V Sem
But since the path through 3 will only lead to a solution as there is no
solution to 4, so the path through 10 is better.
A (10)
D (3)
E (2) C (5)
Assume that both C and E ultimately lead to a solution.
Looking just at the alternative from D, the path from node E is the best
path but it turns out that C is must anyways, so it is better also to use it
to satisfy D.
But to solve D, the path from node E is the best path and will try to solve
E.
AO* algorithm does not consider such interactions, so it will find a non-optimal
path.
Page 8
18AI55 Artificial Intelligence Module II
AI&ML V Sem
Improve the test procedure so that the best moves (paths) will be
recognized and explored first.
Let us consider only two player discrete, perfect information games, such
as tic-tac-toe, chess, checkers etc.
Two-player games are easier to imagine & think and more common to
play.
For example,
The game begins from a specified initial state and ends in position that
can be declared win for one, loss for other or possibly a draw.
Page 9
18AI55 Artificial Intelligence Module II
AI&ML V Sem
Its successors are the positions that the first player can reach in
one move, and
Each non-terminal nodes in the game tree can be labeled WIN, LOSS or
DRAW by a bottom up process similar to the "Solve" labeling procedure
in AND/OR graph.
Page 10
18AI55 Artificial Intelligence Module II
AI&ML V Sem
Let us denote
• MAX X
• MIN Y,
• WIN W,
• DRAW D and
• LOSS L.
The status of the leaf nodes is assigned by the rules of the game
whereas, those of non-terminal nodes are determined by the
labeling procedure.
Solving a game tree means labeling the root node by WIN, LOSS,
or DRAW from Max player point of view.
MAX X (W)
For most of the games, tree of possibilities is far too large to be generated
and evaluated backward from the terminal nodes in order to determine
the optimal first move.
Examples:
Evaluation Function
Page 12
18AI55 Artificial Intelligence Module II
AI&ML V Sem
One - ply search
A (8)
E F G H I J K
(9) (-6) (0) (3) (2) (-4) (-3)
Page 13