Game Playing Why do AI researchers study game playing?

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.
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4. Warm Up Let’s play some games!
CSC 8520 Spring Paula Matuszek CS 8520: Artificial Intelligence Solving Problems by Searching Paula Matuszek Spring, 2010 Slides based on Hwee Tou.
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 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.
G51IAI Introduction to AI Minmax and Alpha Beta Pruning Garry Kasparov and Deep Blue. © 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.
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.
Games & Adversarial Search Chapter 6 Section 1 – 4.
Game Playing State-of-the-Art  Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in Used an endgame database defining.
CSC 412: AI Adversarial Search
1 Game Playing Why do AI researchers study game playing? 1.It’s a good reasoning problem, formal and nontrivial. 2.Direct comparison with humans and other.
Games as Game Theory Systems (Ch. 19). Game Theory It is not a theoretical approach to games Game theory is the mathematical study of decision making.
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.
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 6 Section 1 – 4. Search in an Adversarial Environment Iterative deepening and A* useful for single-agent search problems What.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
CSE373: Data Structures & Algorithms Lecture 23: Intro to Artificial Intelligence and Game Theory Based on slides adapted Luke Zettlemoyer, Dan Klein,
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.
Turn-Based Games Héctor Muñoz-Avila sources: Wikipedia.org Russell & Norvig AI Book; Chapter 5 (and slides)
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.
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
Adversarial Search and Game-Playing
Games and adversarial search (Chapter 5)
Game Playing Why do AI researchers study game playing?
EA C461 – Artificial Intelligence Adversarial Search
Announcements Homework 1 Full assignment posted..
PENGANTAR INTELIJENSIA BUATAN (64A614)
Games and adversarial search (Chapter 5)
CS 460 Spring 2011 Lecture 4.
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Pengantar Kecerdasan Buatan
Adversarial Search Chapter 5.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search.
Artificial Intelligence
Game playing.
Games & Adversarial Search
Games & Adversarial Search
Artificial Intelligence
Game Playing Fifth Lecture 2019/4/11.
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
Adversarial Search CS 171/271 (Chapter 6)
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4.
Presentation transcript:

Game Playing Why do AI researchers study game playing? It’s a good reasoning problem, formal and nontrivial. Direct comparison with humans and other computer programs is easy.

What Kinds of Games? Mainly games of strategy with the following characteristics: Sequence of moves to play Rules that specify possible moves Rules that specify a payment for each move Objective is to maximize your payment

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

Move to Highest-Valued Successor Two-Player Game Opponent’s Move Generate New Position yes Game Over? no Generate Successors Evaluate Successors Move to Highest-Valued Successor no yes Game Over?

Game Tree (2-player, Deterministic, Turns) computer’s turn opponent’s leaf nodes are evaluated The computer is Max. The opponent is Min. At the leaf nodes, the utility function is employed. Big value means good, small is bad.

Mini-Max Terminology utility function: the function applied to leaf nodes backed-up value of a max-position: the value of its largest successor of a min-position: the value of its smallest successor minimax procedure: search down several levels; at the bottom level apply the utility function, back-up values all the way up to the root node, and that node selects the move.

Minimax Perfect play for deterministic games Idea: choose move to position with highest minimax value = best achievable payoff against best play E.g., 2-ply game:

Minimax Strategy Why do we take the min value every other level of the tree? These nodes represent the opponent’s choice of move. The computer assumes that the human will choose that move that is of least value to the computer.

Minimax algorithm

Properties of Minimax Complete? Yes (if tree is finite) Optimal? Yes (against an optimal opponent) Time complexity? O(bm) Space complexity? O(bm) (depth-first exploration) For chess, b ≈ 35, m ≈100 for "reasonable" games  exact solution completely infeasible Need to speed it up.

Alpha-Beta Procedure The alpha-beta procedure can speed up a depth-first minimax search. Alpha: a lower bound on the value that a max node may ultimately be assigned Beta: an upper bound on the value that a minimizing node may ultimately be assigned v >  v < 

α-β pruning example

α-β pruning example  = 3 alpha cutoff

α-β pruning example

α-β pruning example

α-β pruning example

Alpha Cutoff > 3  = 3 3 10 8 What happens here? Is there an alpha cutoff?

Beta Cutoff  = 4 < 4 4 > 8 8  cutoff

Alpha-Beta Pruning max min eval 5 2 10 11 1 2 2 8 6 5 12 4 3 25 2

Properties of α-β Pruning does not affect final result. This means that it gets the exact same result as does full minimax. Good move ordering improves effectiveness of pruning With "perfect ordering," time complexity = O(bm/2)  doubles depth of search A simple example of the value of reasoning about which computations are relevant (a form of metareasoning)

The α-β algorithm cutoff

The α-β algorithm cutoff

When do we get alpha cutoffs? 100 ... < 100 < 100

Additional Refinements Waiting for Quiescence: continue the search until no drastic change occurs from one level to the next. Secondary Search: after choosing a move, search a few more levels beneath it to be sure it still looks good. Book Moves: for some parts of the game (especially initial and end moves), keep a catalog of best moves to make.

Eval(s) = w1 f1(s) + w2 f2(s) + … + wn fn(s) Evaluation functions For chess/checkers, typically linear weighted sum of features Eval(s) = w1 f1(s) + w2 f2(s) + … + wn fn(s) e.g., w1 = 9 with f1(s) = (number of white queens) – (number of black queens), etc.

Deterministic Games in Practice Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in 1994. Used a precomputed endgame database defining perfect play for all positions involving 8 or fewer pieces on the board, a total of 444 billion positions. Chess: Deep Blue defeated human world champion Garry Kasparov in a six-game match in 1997. Deep Blue searches 200 million positions per second, uses very sophisticated evaluation, and undisclosed methods for extending some lines of search up to 40 ply. Othello: human champions refuse to compete against computers, who are too good. Go: human champions refuse to compete against computers, who are too bad. In Go, b > 300, so most programs use pattern knowledge bases to suggest plausible moves.

Summary Games are fun to work on! They illustrate several important points about AI. Perfection is unattainable  must approximate. Game playing programs have shown the world what AI can do.

Shallow Search Techniques 1. limited search for a few levels 2. reorder the level-1 sucessors 3. proceed with - minimax search