10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.

Slides:



Advertisements
Similar presentations
Chapter 6, Sec Adversarial Search.
Advertisements

Adversarial Search Chapter 6 Sections 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
This lecture topic: Game-Playing & Adversarial Search
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Games & Adversarial Search
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
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.
1 Game Playing. 2 Outline Perfect Play Resource Limits Alpha-Beta pruning Games of Chance.
Adversarial Search Game Playing Chapter 6. Outline Games Perfect Play –Minimax decisions –α-β pruning Resource Limits and Approximate Evaluation Games.
Adversarial Search CSE 473 University of Washington.
Adversarial Search Chapter 6.
Artificial Intelligence for Games Game playing Patrick Olivier
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.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
EIE426-AICV 1 Game Playing Filename: eie426-game-playing-0809.ppt.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
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.
How computers play games with you CS161, Spring ‘03 Nathan Sturtevant.
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.
Games & Adversarial Search Chapter 6 Section 1 – 4.
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.
Game Playing.
Computing & Information Sciences Kansas State University Wednesday, 13 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 9 of 42 Wednesday, 13 September.
1 Computer Group Engineering Department University of Science and Culture S. H. Davarpanah
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 9 of 14 Friday, 10 September.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 6 –Adversarial Search Thursday –AIMA, Ch. 6 –More Adversarial Search The “Luke.
Computing & Information Sciences Kansas State University Lecture 9 of 42 CIS 530 / 730 Artificial Intelligence Lecture 9 of 42 William H. Hsu Department.
Adversarial Search Chapter 6 Section 1 – 4. Search in an Adversarial Environment Iterative deepening and A* useful for single-agent search problems What.
Computing & Information Sciences Kansas State University Wednesday, 12 Sep 2007CIS 530 / 730: Artificial Intelligence Lecture 9 of 42 Wednesday, 12 September.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 9 of 42 Wednesday, 14.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Computing & Information Sciences Kansas State University Monday, 11 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 8 of 42 Monday, 11 September.
Paula Matuszek, CSC 8520, Fall Based in part on aima.eecs.berkeley.edu/slides-ppt 1 CS 8520: Artificial Intelligence Adversarial Search Paula Matuszek.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Adversarial Search Chapter 6 Section 1 – 4. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time.
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.
5/4/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 9, 5/4/2005 University of Washington, Department of Electrical Engineering Spring 2005.
Artificial Intelligence AIMA §5: Adversarial Search
PENGANTAR INTELIJENSIA BUATAN (64A614)
CS 460 Spring 2011 Lecture 4.
Adversarial Search Chapter 5.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search.
Artificial Intelligence
Games & Adversarial Search
Games & Adversarial Search
Artificial Intelligence
Game Playing Fifth Lecture 2019/4/11.
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4.
Presentation transcript:

10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching

10/19/2004TCSS435A Isabelle Bichindaritz2 Learning Objectives Introduction to games Optimal decisions in games Alpha-Beta pruning Real-time decisions

10/19/2004TCSS435A Isabelle Bichindaritz3 Introduction to Games Games as Search Problems –Frameworks: two-player, multi-player; zero-sum; perfect information –Minimax algorithm Perfect decisions Imperfect decisions (based upon static evaluation function) –Issues Quiescence Horizon effect –Need for pruning (alpha-beta pruning)

10/19/2004TCSS435A Isabelle Bichindaritz4 Introduction to Games Perfect Play –General framework(s) –What could agent do with perfect info? Resource Limits –Search ply –Static evaluation: from heuristic search to heuristic game tree search –Examples Tic-tac-toe, connect four, checkers, connect-five Chess, go Games with Uncertainty –Explicit: games of chance (e.g., backgammon, Monopoly, blackjack) –Implicit

10/19/2004TCSS435A Isabelle Bichindaritz5 Games versus Search Problems Unpredictable Opponent –Games are adversarial search problems –Solution is strategy, contingency plan –Time limits Unlikely to find goal Must approximate Plan of Attack –Algorithm for perfect play (J. von Neumann, 1944) –Finite horizon, approximate evaluation (C. Zuse, 1945; C. Shannon, 1950, A. Samuel, ) –First chess program (Turing, 1951) –Pruning to allow deeper search (J. McCarthy, 1956)

10/19/2004TCSS435A Isabelle Bichindaritz6 Types of Games Information: Can Know (Observe) –… outcomes of actions / moves? –… moves committed by opponent? Uncertainty –Deterministic vs. nondeterministic outcomes –Thought exercise: sources of nondeterminism?

10/19/2004TCSS435A Isabelle Bichindaritz7 Minimax Games with two players MIN and MAX are a search problem with: –Initial state –Successor function –Terminal test / state –Utility function (objective / payoff) Win / loss / draw(chess) +1 / -1 / 0(chess) -192 … +192 (backgammon)

10/19/2004TCSS435A Isabelle Bichindaritz8 Minimax

10/19/2004TCSS435A Isabelle Bichindaritz9 Minimax Perfect play for deterministic, perfect-information games Choose move to position with highest minimax value = best achievable payoff against best play Simple example: 2-ply game, a ply being a half-move Game ends after one move each by MAX and MIN (one move deep)

10/19/2004TCSS435A Isabelle Bichindaritz10 Minimax

10/19/2004TCSS435A Isabelle Bichindaritz11 Minimax Algorithm: Decision and Evaluation  what’s this?

10/19/2004TCSS435A Isabelle Bichindaritz12 Properties of Minimax Complete?

10/19/2004TCSS435A Isabelle Bichindaritz13 Properties of Minimax Complete? –… yes, provided following are finite: Number of possible legal moves (generative breadth of tree) “Length of game” (depth of tree) – more specifically? A finite strategy can exist even in an infinite tree! –Perfect vs. imperfect information? Q: What search is perfect minimax analogous to? A: Bottom-up breadth-first

10/19/2004TCSS435A Isabelle Bichindaritz14 Properties of Minimax Complete? –… yes, provided the tree is finite: Number of possible legal moves (generative breadth of tree) “Length of game” (depth of tree) – more specifically? Optimal?

10/19/2004TCSS435A Isabelle Bichindaritz15 Properties of Minimax Complete? –… yes, provided the tree is finite Optimal? –… yes, provided perfect info (evaluation function) and opponent is optimal! –… otherwise, guaranteed if evaluation function is correct Time Complexity?

10/19/2004TCSS435A Isabelle Bichindaritz16 Properties of Minimax Complete? –… yes, provided the tree is finite: Optimal? –… yes, provided perfect info (evaluation function) and opponent is optimal! Time Complexity? –Depth of tree: m –Legal moves at each point: b –O(b m ) – NB, m  100, b  35 for chess! Space Complexity?

10/19/2004TCSS435A Isabelle Bichindaritz17 Properties of Minimax Complete? –… yes, provided the tree is finite: Optimal? –… yes, provided perfect info (evaluation function) and opponent is optimal! Time Complexity? –Depth of tree: m –Legal moves at each point: b –O(b m ) – NB, m  100, b  35 for chess! Space Complexity? O(bm) – why?

10/19/2004TCSS435A Isabelle Bichindaritz18 Resource Limits

10/19/2004TCSS435A Isabelle Bichindaritz19 Static Evaluation Function Example: Chess

10/19/2004TCSS435A Isabelle Bichindaritz20 Do Exact Values Matter?

10/19/2004TCSS435A Isabelle Bichindaritz21 Cutting Off Search

10/19/2004TCSS435A Isabelle Bichindaritz22 Cutting Off Search Issues –Quiescence Play has “settled down” Evaluation function unlikely to exhibit wild swings in value in near future –Horizon effect “Stalling for time” Postpones inevitable win or damaging move by opponent See: Figure 6.9 R&N Solutions? –Quiescence search: expand non-quiescent positions further –No general solution to horizon problem at present

10/19/2004TCSS435A Isabelle Bichindaritz23 Why Prune?

10/19/2004TCSS435A Isabelle Bichindaritz24 Game Tree Search Perfect Play (TBD from Perfect Information) –Common framework: two-player (or multi-player), zero-sum –Deterministic or known probability distribution function, totally observable –Minimax algorithm given ability to search for arbitrary ply Assumptions about –… game? –… opponent? Specifications and Ramifications –Combinatorics: finite depth (m), breadth (b) of search –Resource limits: need for static evaluation function Practical Issues –Effects of depth cutoff –Need for pruning

10/19/2004TCSS435A Isabelle Bichindaritz25  -  Pruning Properties of  -  pruning –Pruning does not affect final result –Good move ordering improves effectiveness of pruning –With “perfect ordering,” time complexity = O(b m/2 ) Depth of tree: m Legal moves at each point: b Effective branching factor becomes b 1/2 Can easily reach depth 8 and play good chess –A simple example of the value of reasoning about which computations are relevant ( a form of metareasoning)

10/19/2004TCSS435A Isabelle Bichindaritz26  -  Pruning  is the value of the best (i.e. highest value) choice we have found so far at any choice point along the path for MAX  is the value of the best (i.e. lowest value) choice we have found so far at any choice point along the path for MIN.

10/19/2004TCSS435A Isabelle Bichindaritz27 Alpha-Beta (  -  ) Pruning: Definitions

10/19/2004TCSS435A Isabelle Bichindaritz28 Alpha-Beta (  -  ) Pruning Example ≥ MAX MIN MAX 128 ≤ ≤ 14 2 ≤52

10/19/2004TCSS435A Isabelle Bichindaritz29 ≥ MAX MIN MAX 128 ≤ ≤ 14 2 ≤52 Alpha-Beta (  -  ) Pruning Example ,  here? What are ,  values here?

10/19/2004TCSS435A Isabelle Bichindaritz30 Alpha-Beta (  -  ) Pruning: Modified Minimax Algorithm

10/19/2004TCSS435A Isabelle Bichindaritz31 Alpha-Beta (  -  ) Pruning Properties Perfect Play (TBD from Perfect Information) –Common framework: two-player (or multi-player), zero-sum –Deterministic or known probability distribution function, totally observable –Minimax algorithm given ability to search to arbitrary ply Assumptions about –… game? –… opponent? Specifications and Ramifications –Combinatorics: finite depth (m), breadth (b) of search –Resource limits: need for static evaluation function Practical Issues –Effects of depth cutoff –Need for pruning