5/4/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 9, 5/4/2005 University of Washington, Department of Electrical Engineering Spring 2005.

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.
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.
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
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.
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.
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. Game playing Perfect play The minimax algorithm alpha-beta pruning Resource limitations Elements of chance Imperfect information.
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.
CHAPTER 4 PROBABILITY THEORY SEARCH FOR GAMES. Representing Knowledge.
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
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.
Artificial Intelligence AIMA §5: Adversarial Search
Game Playing Why do AI researchers study game playing?
Game Playing Why do AI researchers study game playing?
EA C461 – Artificial Intelligence Adversarial Search
PENGANTAR INTELIJENSIA BUATAN (64A614)
CS 460 Spring 2011 Lecture 4.
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Adversarial Search Chapter 5.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search.
Artificial Intelligence
Game playing.
Games & Adversarial Search
Games & Adversarial Search
Artificial Intelligence
Pruned Search Strategies
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:

5/4/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 9, 5/4/2005 University of Washington, Department of Electrical Engineering Spring 2005 Instructor: Professor Jeff A. Bilmes

5/4/2005EE562 Game Playing & Adversarial Search

5/4/2005EE562 Material Reading: Read chapters 6 Read chapter 7 (for Monday). –expect new homework on Monday (this will be a long one). Today’s lecture covers chapter 6. Announcements: Still working on makeup class times. Send me if you haven’t already for Friday schedules.

5/4/2005EE562 Outline Optimal decisions α-β pruning Imperfect, real-time decisions

5/4/2005EE562 Games vs. search problems "Unpredictable" opponent  solution is a strategy specifying a move for every possible opponent reply Time limits  unlikely to find goal, must approximate History: –Computer considers possible lines of play (Babbage, 1846) –Algorithm for perfect play (Zermelo, 1912; Von Neumann, 1944) –Finite horizon, approximate evaluation (Zuse, 1945; Wiener, 1948; Shannon, 1950) –First Chess Program (Turing, 1951) –Machine learning to improve evaluation accuracy (Samuel, ) –Pruning to allow deeper search (McCarthy, 1956)

5/4/2005EE562 Types of Games

5/4/2005EE562 Game tree (2-player, deterministic, turns)

5/4/2005EE562 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 (ply == move by one player):

5/4/2005EE562 Minimax algorithm

5/4/2005EE562 Properties of minimax Complete? Yes, if tree is finite. Finite strategy can exist even if tree is infinite. Optimal? Yes (against an optimal opponent). –for sub-optimal opponent, better strategies might exist. Time complexity? O(b m ) Space complexity? O(bm) (depth-first exploration) –For chess, b ≈ 35, m ≈100 for "reasonable" games  exact solution completely infeasible. But do we need to explore every path?

5/4/2005EE562 α-β pruning example

5/4/2005EE562 α-β pruning example

5/4/2005EE562 α-β pruning example

5/4/2005EE562 α-β pruning example

5/4/2005EE562 α-β pruning example

5/4/2005EE562 Why is it called α-β? α is the value of the best (i.e., highest- value) choice found so far at any choice point along the path for max If v is worse than α, max will avoid it  prune that branch Define β similarly for min

5/4/2005EE562 The α-β algorithm

5/4/2005EE562 The α-β algorithm

5/4/2005EE562 Properties of α-β Pruning does not affect final result Good move ordering improves effectiveness of pruning With "perfect ordering," time complexity = O(b m/2 )  doubles the solvable tractable depth of search A simple example of the value of reasoning about which computations are relevant (a form of metareasoning) For chess, is still impossible!

5/4/2005EE562 Resource limits Standard approach: cutoff test: use a cutoff-test rather than a terminal-test. e.g., depth limit (perhaps add quiescence search) quiescence == stop when nothing is going to make drastic changes (e.g., taking a queen) evaluation function: use Eval instead of Utility = eval estimates desirability of position (but is a heuristic, since the exact true evaluation requires a full search) Suppose we have 100 secs to move, can explore 10 4 nodes/sec  10 6 nodes per move ¼ 35 8/2   -  reaches depth 8, relatively good chess program

5/4/2005EE562 Evaluation functions For chess, typically linear weighted sum of features Eval(s) = w 1 f 1 (s) + w 2 f 2 (s) + … + w n f n (s) e.g., w 1 = 9 with f 1 (s) = (number of white queens) – (number of black queens), etc.

5/4/2005EE562 Exact values don’t’ matter Behavior is preserved under any monotonic transformation of Eval function. Only the order matters: payoff in deterministic games acts as an ordinal utility function (in game theory)

5/4/2005EE562 Cutting off search MinimaxCutoff is identical to MinimaxValue except 1.Terminal? is replaced by Cutoff? 2.Utility is replaced by Eval Does it work in practice? b m = 10 6, b=35  m=4 4-ply lookahead is a hopeless chess player! –4-ply ≈ human novice –8-ply ≈ typical PC, human master –12-ply ≈ Deep Blue, Kasparov

5/4/2005EE562 Deterministic games in practice Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in 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 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.

5/4/2005EE562 Non-Deterministic games: backgammon

5/4/2005EE562 Non-Deterministic games in general In nondeterministic games, chance is introduced by dice, card-shuffling, or coin flipping. In these cases, we have search nodes for “chance” which can be seen as a random player in the game. In the coin case:

5/4/2005EE562 Algorithm for non-deterministic games Expectedminimax gives perfect play Just like Minimax, except we also handle chance nodes.

5/4/2005EE562 non-deterministic games in practice Dice rolls increase b: 21 possible rolls with 2 dice Backgammon ¼ 20 legal moves (can be 6000 with 1-1 roll). –depth 4 = 20(21*20) 3 ¼ 1.2 £ 10 9 As depth increases, probability of reaching given node shrinks  value of lookahead is diminished  -  pruning much less effective. TDGammon: uses depth-2 search + very good Eval (learned automatically), world champion level

5/4/2005EE562 Exact values DO matter. Behavor is preserved only by positive linear transformation of Eval Hence, Eval should be proportional to expected payoff.

5/4/2005EE562 Summary Games are fun to work on! They illustrate several important points about AI perfection is unattainable  must approximate good idea to think about what to think about