Game Playing CSC361 AI CSC361: Game Playing.

Slides:



Advertisements
Similar presentations
Chapter 6, Sec Adversarial Search.
Advertisements

Artificial Intelligence 1: game playing Lecturer: Tom Lenaerts SWITCH, Vlaams Interuniversitair Instituut voor Biotechnologie.
Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
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.
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
CS 484 – Artificial Intelligence
Adversarial Search Chapter 6 Section 1 – 4.
Adversarial Search Chapter 5.
COMP-4640: Intelligent & Interactive Systems Game Playing A game can be formally defined as a search problem with: -An initial state -a set of operators.
Adversarial Search: Game Playing Reading: Chapter next time.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Adversarial Search CSE 473 University of Washington.
Hoe schaakt een computer? Arnold Meijster. Why study games? Fun Historically major subject in AI Interesting subject of study because they are hard Games.
Adversarial Search 對抗搜尋. Outline  Optimal decisions  α-β pruning  Imperfect, real-time decisions.
An Introduction to Artificial Intelligence Lecture VI: Adversarial Search (Games) Ramin Halavati In which we examine problems.
1 Adversarial Search Chapter 6 Section 1 – 4 The Master vs Machine: A Video.
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
This time: Outline Game playing The minimax algorithm
Lecture 02 – Part C Game Playing: Adversarial Search
1 Game Playing Chapter 6 Additional references for the slides: Luger’s AI book (2005). Robert Wilensky’s CS188 slides:
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)
1 DCP 1172 Introduction to Artificial Intelligence Lecture notes for Chap. 6 [AIMA] Chang-Sheng Chen.
CS 460, Sessions Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Adversarial Search: Game Playing Reading: Chess paper.
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”
CHAPTER 6 : ADVERSARIAL SEARCH
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
Adversarial Search Chapter 5 Adapted from Tom Lenaerts’ lecture notes.
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
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.
Game Playing. Introduction Why is game playing so interesting from an AI point of view? –Game Playing is harder then common searching The search space.
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.
1 Computer Group Engineering Department University of Science and Culture S. H. Davarpanah
October 3, 2012Introduction to Artificial Intelligence Lecture 9: Two-Player Games 1 Iterative Deepening A* Algorithm A* has memory demands that increase.
Chapter 6 Adversarial Search. Adversarial Search Problem Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test.
Game-playing AIs Part 1 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part I (this set of slides)  Motivation  Game Trees  Evaluation.
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.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
1 Adversarial Search CS 171/271 (Chapter 6) Some text and images in these slides were drawn from Russel & Norvig’s published material.
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.
Game Playing: Adversarial Search chapter 5. Game Playing: Adversarial Search  Introduction  So far, in problem solving, single agent search  The machine.
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 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.
Adversarial Search CMPT 463. When: Tuesday, April 5 3:30PM Where: RLC 105 Team based: one, two or three people per team Languages: Python, C++ and Java.
Chapter 5 Adversarial Search. 5.1 Games Why Study Game Playing? Games allow us to experiment with easier versions of real-world situations Hostile agents.
Artificial Intelligence AIMA §5: Adversarial Search
Adversarial Search and Game-Playing
PENGANTAR INTELIJENSIA BUATAN (64A614)
Adversarial Search Chapter 5.
Adversarial Search.
Adversarial Search CMPT 420 / CMPG 720.
Adversarial Search Chapter 6 Section 1 – 4.
Presentation transcript:

Game Playing CSC361 AI CSC361: Game Playing

Game Playing Why is game playing of interest to AI? How are two player games different from state space search? Perfect decision games. Imperfect decision games. AI CSC361: Game Playing

Game Playing: Why? Games have a small well structured state description that completely describes the real game state  so representation is easy. People developing AI programs (i.e. intelligent programs) can test them on games. Although easy to represent they are very hard problems. Chess state space is 10120. AI CSC361: Game Playing

Game Playing: What? Games are a form of multi-agent environment More than one agent in the environment and they affect each others success. Cooperative vs. competitive multi-agent environments. Competitive multi-agent environments give rise to adversarial problems a.k.a. games AI CSC361: Game Playing

Games vs. Search Search – no adversary (Single Player Game) Solution is method for finding goal Evaluation function f(n): estimate of cost from start to goal through given node Games – adversary (Multi-Player Game) Uncertainty: What move? Presence of the other player introduces a kind of uncertainty. Time limits force an approximate solution. Evaluation function  “goodness” of game position Examples: chess, checkers, othello, backgammon AI CSC361: Game Playing

Two Player Games Two players: MAX and MIN MAX moves first and they take turns until the game is over. MAX searches for the best move: Initial state: e.g. board configuration of chess Successor function: list of (move,state) pairs specifying legal moves. Terminal test: Is the game finished? AI CSC361: Game Playing

Two Player Games MAX uses search to determine the move at every turn. Payoff or Utility function: Gives numerical value of terminal states. E.g. win (+1), loose (-1) and draw (0) in Tic-tac-toe MAX uses search to determine the move at every turn. Perfect Decision Games: if the search algorithm searches the complete search tree. Imperfect Decision Games: no complete search, search is cut-off earlier. AI CSC361: Game Playing

Tic-Tac-Toe Game Search Tree for -- Tic-Tac-Toe AI CSC361: Game Playing

Min-Max Algorithm At each turn a player must choose the best move to make, in that state of the game. Search Algorithm to find the best move: Min-Max Algorithm. Game Formulation Min-Max Algorithm Best Move AI CSC361: Game Playing

Min-Max Algorithm Max wants to find the best move, calls Min-Max. generates the game tree in depth-first order until terminal states are reached applies the pay-off function to the terminal states to get pay-off value MinMax_Value(n) = maximum value of successors, if n is Max node; or minimum value of successors, if n is Min node. AI CSC361: Game Playing

Min-Max Algorithm The minimax decision AI CSC361: Game Playing

Min-Max Algorithm When Max calls Min-Max algorithm to find the best move, Max assumes that Min will never make a mistake. What if this assumption is not true?  Min making a mistake means Max will do even better. AI CSC361: Game Playing

Min-Max Algorithm: Properties Completeness: Min-Max is complete I.e. guaranteed to return a move.  Time Complexity: O(bm)  Space Complexity: O(bm)  Optimality: It is optimal.  AI CSC361: Game Playing

Min-Max Algorithm: Problem Perfect decision games, using Min-Max search all the way to the terminal states, which is not usually practical because of time limitations. Solution  reduce the number of nodes generated and examined. Alpha-beta pruning avoids generating some nodes. AI CSC361: Game Playing

Alpha-Beta Pruning Uses two values alpha and beta: Alpha = value of best choice found so far at any choice point along the MAX path. Beta = value of best choice found so far at any choice point along the MIN path. Two rules for terminating search: Stop search below any MIN node having a beta value <= to alpha value of any of its max ancestors. Stop search below any MAX node having an alpha value >= to the beta value of any of its min ancestors. AI CSC361: Game Playing

Alpha-Beta Example [-∞,+∞] [-∞, +∞] Range of possible values AI CSC361: Game Playing

Alpha-Beta Example [-∞,3] [-∞,+∞] AI CSC361: Game Playing

Alpha-Beta Example [-∞,3] [-∞,+∞] AI CSC361: Game Playing

Alpha-Beta Example [3,+∞] [3,3] AI CSC361: Game Playing

Alpha-Beta Example [-∞,2] [3,+∞] [3,3] AI CSC361: Game Playing

Alpha-Beta Example , [-∞,2] [3,14] [3,3] [-∞,14] AI CSC361: Game Playing

Alpha-Beta Example , [3,5] [3,3] [−∞,2] [-∞,5] AI CSC361: Game Playing

Alpha-Beta Example [2,2] [−∞,2] [3,3] AI CSC361: Game Playing

Alpha-Beta Example [2,2] [-∞,2] [3,3] AI CSC361: Game Playing

Alpha-Beta: General Case Consider a node n somewhere in the tree If player has a better choice at Parent node of n Or any choice point further up n will never be reached in actual play. Hence when enough is known about n, it can be pruned. AI CSC361: Game Playing

Alpha-Beta Pruning Pruning does not affect final results Entire subtrees can be pruned. Good move ordering improves effectiveness of pruning With “perfect ordering,” time complexity is O(bm/2) Alpha-beta pruning can look twice as far as minimax in the same amount of time Repeated states are again possible. AI CSC361: Game Playing

Imperfect Games Problem with perfect games: Min-max and alpha-beta pruning can take a long time… Imperfect decision games cut-off search earlier at some depth-limit (apply a CUT-OFF test instead of TERMINAL TEST) Apply a heuristic function EVAL instead of a PAYOFF function. AI CSC361: Game Playing

Heuristic EVAL function Idea: produce an estimate of how good the state is in a game. A good quality EVAL improves performance a lot. Requirements: EVAL should order terminal-nodes in the same way as PAYOFF. It should be easy to compute. For non-terminal states the EVAL should be strongly correlated with the actual chance of winning. AI CSC361: Game Playing

Heuristic EVAL function Eval(s) = w1 f1(s) + w2 f2(s) + … + wnfn(s) AI CSC361: Game Playing

Summary State Space Search can be regarded as a single player game. Considered two player games: perfect & imperfect decision Min-Max algorithm is used to determine the best move at every turn. Min-Max can be improved by alpha-beat pruning. Imperfect games cut-off search at a depth-limit to improve performance. AI CSC361: Game Playing