Game Playing (Tic-Tac-Toe), ANDOR graph By Chinmaya, Hanoosh,Rajkumar.

Slides:



Advertisements
Similar presentations
Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
Advertisements

Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
Games & Adversarial Search
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
Game Playing Games require different search procedures. Basically they are based on generate and test philosophy. At one end, generator generates entire.
Adversarial Search Chapter 6 Section 1 – 4.
Adversarial Search Chapter 5.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
MINIMAX SEARCH AND ALPHA- BETA PRUNING: PLAYER 1 VS. PLAYER 2.
Adversarial Search 對抗搜尋. Outline  Optimal decisions  α-β pruning  Imperfect, real-time decisions.
1 Adversarial Search Chapter 6 Section 1 – 4 The Master vs Machine: A Video.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
G51IAI Introduction to AI Minmax and Alpha Beta Pruning Garry Kasparov and Deep Blue. © 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.
All rights reservedL. Manevitz Lecture 31 Artificial Intelligence A/O* and Minimax L. Manevitz.
This time: Outline Game playing The minimax algorithm
1 Game Playing Chapter 6 Additional references for the slides: Luger’s AI book (2005). Robert Wilensky’s CS188 slides:
Game Playing CSC361 AI CSC361: Game Playing.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.6: Adversarial Search Fall 2008 Marco Valtorta.
Min-Max Trees Based on slides by: Rob Powers Ian Gent Yishay Mansour.
1 search CS 331/531 Dr M M Awais A* Examples:. 2 search CS 331/531 Dr M M Awais 8-Puzzle f(N) = g(N) + h(N)
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Game Tree Search based on Russ Greiner and Jean-Claude Latombe’s notes.
Adversarial Search and Game Playing Examples. Game Tree MAX’s play  MIN’s play  Terminal state (win for MAX)  Here, symmetries have been used to reduce.
Games & Adversarial Search Chapter 6 Section 1 – 4.
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Notes adapted from lecture notes for CMSC 421 by B.J. Dorr
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Lecture 5 Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Lecture 6: Game Playing Heshaam Faili University of Tehran Two-player games Minmax search algorithm Alpha-Beta pruning Games with chance.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
October 3, 2012Introduction to Artificial Intelligence Lecture 9: Two-Player Games 1 Iterative Deepening A* Algorithm A* has memory demands that increase.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 6 –Adversarial Search Thursday –AIMA, Ch. 6 –More Adversarial Search The “Luke.
Problem Reduction Search: AND/OR Graphs & Game Trees Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Minimax with Alpha Beta Pruning The minimax algorithm is a way of finding an optimal move in a two player game. Alpha-beta pruning is a way of finding.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
Game Playing. Introduction One of the earliest areas in artificial intelligence is game playing. Two-person zero-sum game. Games for which the state space.
Quiz 4 : Minimax Minimax is a paranoid algorithm. True
CSCI 4310 Lecture 6: Adversarial Tree Search. Book Winston Chapter 6.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
CMSC 421: Intro to Artificial Intelligence October 6, 2003 Lecture 7: Games Professor: Bonnie J. Dorr TA: Nate Waisbrot.
Adversarial Search Chapter 6 Section 1 – 4. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time.
Adversarial Search 2 (Game Playing)
Adversarial Search and Game Playing Russell and Norvig: Chapter 6 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Adversarial Search In this lecture, we introduce a new search scenario: game playing 1.two players, 2.zero-sum game, (win-lose, lose-win, draw) 3.perfect.
Adversarial Search Chapter 5 Sections 1 – 4. AI & Expert Systems© Dr. Khalid Kaabneh, AAU Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
ADVERSARIAL SEARCH Chapter 6 Section 1 – 4. OUTLINE Optimal decisions α-β pruning Imperfect, real-time decisions.
Game Playing Why do AI researchers study game playing?
Adversarial Search and Game-Playing
PENGANTAR INTELIJENSIA BUATAN (64A614)
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Games & Adversarial Search
Games & Adversarial Search
Artificial Intelligence
Games & Adversarial Search
Games & Adversarial Search
Artificial Intelligence
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Based on slides by: Rob Powers Ian Gent
Artificial Intelligence
Games & Adversarial Search
Games & Adversarial Search
Unit II Game Playing.
Presentation transcript:

Game Playing (Tic-Tac-Toe), ANDOR graph By Chinmaya, Hanoosh,Rajkumar

Outline of the Talk  Game Playing  Tic-Tac-Toe  Minimax Algorithm  Alpha Beta Prunning  AndOr graph and AO* Algorithm  Summary  References

Games vs Search Problems  "Unpredictable" opponent : specifying a move for every possible opponent reply  Time limits : unlikely to find goal, must approximate

Game Playing Strategy  Maximize winning possibility assuming that opponent will try to minimize (Minimax Algorithm)  Ignore the unwanted portion of the search tree (Alpha Beta Pruning)  Evaluation(Utility) Function  A measure of winning possibility of the player

Tic-Tac-Toe e(p) = = 1  Initial State: Board position of 3x3 matrix with 0 and X.  Operators: Putting 0’s or X’s in vacant positions alternatively  Terminal test: Which determines game is over  Utility function: e(p) = (No. of complete rows, columns or diagonals are still open for player ) – (No. of complete rows, columns or diagonals are still open for opponent ) X O

Minimax Algorithm  Generate the game tree  Apply the utility function to each terminal state to get its value  Use these values to determine the utility of the nodes one level higher up in the search tree  From bottom to top  For a max level, select the maximum value of its successors  For a min level, select the minimum value of its successors  From root node select the move which leads to highest value

Game tree for Tic-Tac-Toe Courtesy : Artificial Intelligence and Soft Computing. Behavioural and Cognitive Modelling of the Human Brain

Courtesy : Principles of Artificial Intelligence, Nilsson

Properties of Minimax  Complete : Yes (if tree is finite)  Time complexity : O(b d )  Space complexity : O(bd) (depth-first exploration)

Observation  Minimax algorithm, presented above, requires expanding the entire state-space.  Severe limitation, especially for problems with a large state-space.  Some nodes in the search can be proven to be irrelevant to the outcome of the search

Alpha-Beta Strategy  Maintain two bounds: Alpha ( α ): a lower bound on best that the player to move can achieve Beta ( β ): an upper bound on what the opponent can achieve  Search, maintaining α and β  Whenever α ≥ β higher, or β ≤ α higher further search at this node is irrelevant

How to Prune the Unnecessary Path  If beta value of any MIN node below a MAX node is less than or equal to its alpha value, then prune the path below the MIN node.  If alpha value of any MAX node below a MIN node exceeds the beta value of the MIN node, then prune the nodes below the MAX node.

Example

Tic-Tac-Toe (MAX) Start X : MAX player 0 : MIN player e(p) = (rows + cols + diagonals open to ‘X’) – (Same to ‘0’) e(p) = 0 X X X e = 8 – 4 = 4 e = 8 – 5 = 3 e = 8 – 6 = 2 e = 5 – 4 = 1e = 5 – 3 = 2 X X 0 0 X’s Turn 0’s Turn Courtesy : CS621-Artificial Intelligence, 2007, Prof. Pushpak Bhatacharya

Alpha-Beta Search Algorithm  If the MAXIMIZER nodes already possess α min values, then their current α min value = Max ( α min value, α ’min); on the other hand, if the MINIMIZER nodes already possess β max values, then their current β max value = Min ( β max value, β ’max).  If the estimated β max value of a MINIMIZER node N is less than the α min value of its parent MAXIMIZER node N’ then there is no need to search below the node MINIMIZER node N. Similarly, if the α min value of a MAXIMIZER node N is more than the β max value of its parent node N’ then there is no need to search below node N.

Alpha-Beta Analysis  Pruning does not affect the final result.  Assume a fixed branching factor and a fixed depth  Best case: b d/2 + b (d/2)-1  Approximate as b d/2  Impact ? Minmax: 10 9 = 1,000,000,000 Alpha-beta: = 110,000  But best-case analysis depends on choosing the best move first at cut nodes (not always possible)  The worst case : No cut-offs, and Alpha-Beta degrades to Minmax

AND OR GRAPH

AND OR Graph  OR graphs : generally used for data driven approach  AND OR graphs: used for Goal driven approach  Problems solvable by decomposing into sub problems some of which is to be solved.  Graph consisting of OR arcs and AND arcs  OR : the node has to be solved.  AND : all the nodes in the arc has to be solved Courtesy : Artificial Intelligence and Soft Computing. Behavioural and Cognitive Modelling of the Human Brain

How to explore  Expand nodes  Propagate values to ancestors  Futility  If the estimated cost of a solution becomes greater than futility then abandon the search  A threshold such that any solution with higher cost is too expensive to be practical

AO* (high level view) 1. Given the Goal node, find its possible off-springs. 2. Estimate the h values at the leaves. The cost of the parent of the leaf (leaves) is the minimum of the cost of the OR clauses plus one or the cost of the AND clauses plus the number of AND clauses. After the children with minimum h are estimated, a pointer is attached to point from the parent node to its promising children. 3. One of the unexpanded OR clauses / the set of unexpanded AND clauses, where the pointer points from its parent, is now expanded and the h of the newly generated children are estimated. The effect of this h has to be propagated up to the root by re-calculating the f of the parent or the parent of the parents of the newly created child /children clauses through a least cost path. Thus the pointers may be modified depending on the revised cost of the existing clauses.

AO* illustration Courtesy : Artificial Intelligence and Soft Computing. Behavioural and Cognitive Modelling of the Human Brain

Summary  Explore game tree  Min max  Alpha Beta  When perfection is unattainable, we must approximate  AND OR graph  How to explore  AO*

References  D. E. Knuth and R. W. Moore. An analysis of alpha-beta pruning. Artificial Intelligence, 6:293–326, 1975  Rich, E. and Knight, K., Artificial Intelligence, McGraw-Hill, New York,  Nilson, J. N., Principles of Artificial Intelligence, Morgan-Kaufmann, San Mateo, CA, pp ,1980.  Russel, S. and Norvig, P., Artificial Intelligence: A Modern Approach, Prentice-Hall, Englewood Cliffs, NJ,  Amit Konar, Artificial Intelligence and Soft Computing Behavioral and Cognitive Modeling of the Human Brain, CRC Press 2000.