# 06_AdversarialSearch - Game Playing An AI Favorite...

This preview shows pages 1–3. Sign up to view the full content.

9/23/2009 1 Adversarial Search Game Playing An AI Favorite • structured task •c lea r definition of success and failure •doe s not require large amounts of knowledge (at first glance) •fo cu s on games of perfect information • multiplayer, chance Game Playing Initial State is the initial board/position Successor Function defines the set of legal moves from any position Terminal Test determines when the game is over Utility Function gives a numeric outcome for the game Game Playing as Search 1 A 3 A 2 A MAX MIN 3 2 2 AAA A AA AA A 12 12 8 4 6 14 5 11 13 21 22 23 31 32 33 Two Ply For chess, only win, lose, draw. Backgammon: +192 to 192. Partial Search Tree for Tic Tac Toe x x x xxx xx x MIN(O) MAX(X) x x xo o ooo o o o o oo o o x x x x x x x x x x x o …… MAX(X) MIN(O) TERMINAL UTILITY 0 +1 1 Simplified Minimax Algorithm 1. Expand the entire tree below the root. 2. Evaluate the terminal nodes as wins for the minimizer or maximizer (i.e. utility). 3. Select an unlabeled node, n , all of whose children have been assigned values. If there is no such node, we're done ‐‐‐ return the value assigned to the root. 4. If n is a minimizer move, assign it a value that is the minimum of the values of its children. If n is a maximizer move, assign it a value that is the maximum of the values of its children. Return to Step 3.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
9/23/2009 2 Example: MinMax 1 1 1 1 1 1 A B C D 1 1 1 Another Example 1 A 3 A 2 A MAX MIN 3 2 2 AAA A AA AA A 12 12 8 4 6 14 5 11 13 21 22 23 31 32 33 According to minimax, which action to take? A=A1 B=A2 C=A3 Another Example 1 A 3 A 2 A 3 3 2 2 MAX MIN 3 2 2 A 12 12 8 4 6 14 5 11 13 21 22 23 31 32 33 Minimax function MINIMAX DECISION( game ) returns an operator for each op in OPERATORS[game] do VALUE[ op ] MINIMAX VALUE(APPLY( op,game ), game ) end return the op with the highest VALUE[ op ] function MINIMAX VALUE( state,game ) returns a utility value if TERMINAL TEST[ game ]( state ) then return UTILITY[ game ]( state ) else if MAX is to move in state then return the highest MINIMAX VALUE of SUCCESSORS( state ) else return the lowest MINIMAX VALUE of SUCCESSORS( state ) Improving Minimax: Pruning Idea: Avoid generating the whole search tree Approach: Analyze which subtrees have no influence on the solution Example 1 Utilities: [ 1 … 1] A
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 05/30/2010 for the course CS 4700 taught by Professor Joachims during the Fall '07 term at Cornell.

### Page1 / 7

06_AdversarialSearch - Game Playing An AI Favorite...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online