1 Game Playing. 2 Outline Perfect Play Resource Limits Alpha-Beta pruning Games of Chance.

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.
For Friday Finish chapter 5 Program 1, Milestone 1 due.
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!
For Monday Read chapter 7, sections 1-4 Homework: –Chapter 4, exercise 1 –Chapter 5, exercise 9.
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.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
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.
Game Playing 최호연 이춘우. Overview Intro: Games as search problems Perfect decisions in 2-person games Imperfect decisions Alpha-beta pruning.
G51IAI Introduction to AI Minmax and Alpha Beta Pruning Garry Kasparov and Deep Blue. © 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.
This time: Outline Game playing The minimax algorithm
Lecture 02 – Part C Game Playing: Adversarial Search
CS 561, Sessions Administrativia Assignment 1 due tuesday 9/24/2002 BEFORE midnight Midterm exam 10/10/2002.
CS 561, Sessions Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first.
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.
CS 460, Sessions Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first.
Game Tree Search based on Russ Greiner and Jean-Claude Latombe’s notes.
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.
Adversarial Search Chapter 5 Adapted from Tom Lenaerts’ lecture notes.
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 CPS 170 Ron Parr. Why Study Games? Many human activities can be modeled as games –Negotiations –Bidding –TCP/IP –Military confrontations –Pursuit/Evasion.
Chapter 6 Adversarial Search. Adversarial Search Problem Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test.
Adversarial Search CS311 David Kauchak Spring 2013 Some material borrowed from : Sara Owsley Sood and others.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
For Wednesday Read Weiss, chapter 12, section 2 Homework: –Weiss, chapter 10, exercise 36 Program 5 due.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 6 –Adversarial Search Thursday –AIMA, Ch. 6 –More Adversarial Search The “Luke.
For Friday Finish reading chapter 7 Homework: –Chapter 6, exercises 1 (all) and 3 (a-c only)
For Wednesday Read chapter 7, sections 1-4 Homework: –Chapter 6, exercise 1.
Adversarial Search Chapter 6 Section 1 – 4. Search in an Adversarial Environment Iterative deepening and A* useful for single-agent search problems What.
For Friday Finish chapter 6 Program 1, Milestone 1 due.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Paula Matuszek, CSC 8520, Fall Based in part on aima.eecs.berkeley.edu/slides-ppt 1 CS 8520: Artificial Intelligence Adversarial Search Paula Matuszek.
For Monday Read chapter 7, sections 1-4 Homework: –Chapter 4, exercise 1 –Chapter 5, exercise 9.
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 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
Game Playing Why do AI researchers study game playing?
Adversarial Search Chapter 5.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search.
Games & Adversarial Search
Games & Adversarial Search
Game Playing Fifth Lecture 2019/4/11.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4.
Presentation transcript:

1 Game Playing

2 Outline Perfect Play Resource Limits Alpha-Beta pruning Games of Chance

3 Games vs Search problems Unpredictable opponent –use contingency plan Time limits –only approximate solution Approaches –algorithm for perfect play –finite horizon, approximation –pruning to reduce costs

4 Types of Games

5 Tic-Tac-Toe Example

6 Structure of a Game Initial State –starting configuration and whose move Operators –legal moves Terminal Test –Checks if game is over Utility Function –Evaluates who has won and by how much

7 Minimax

8 Minimax Algorithm function MINIMAX-DECISION(game) returns an operator for each op in OPERATORS[game] do VALUE[op] <- MINIMAX-VALUE(APPLY(op, game), game) end return the op with the highest VALUE[op] function MINIMAX-VALUE(state,game) returns a utility value if op TERMINAL-TEST[game](state) then return UTILITY[game](state) else if MAX is to move in state then return the highest MINIMAX-VALUE of SUCCESSORS(state) else return the lowest MINIMAX-VALUE of SUCCESSORS(state)

9 Properties of MiniMax Complete ? –Yes (if tree finite) Optimal ? –Yes, against optimal opponent Time Complexity ? –O(b m ) Space Complexity ? –O(bm) (depth first exploration)

10 Resource Limits Time complexity means given time limits –limited choice of solution Approach –cutoff test (depth limit) –evaluation function (estimate of desirability of position)

11 Evaluation Functions Normally weighted linear sum of features –Eval(s) = w 1 f 1 (s) + w 2 f 2 (s) w n f n (s)

12 Cutting off search MinimaxCutoff identical to MinimaxValue except –TERMINAL? Replaced by CUTOFF? –UTILITY replaced by EVAL In practice if b m = 10 6, b = 35 => m = 4 4-ply - human novice 8-ply - typical PC or human master 12-ply - Deep Blue, grand master

13 Alpha-Beta pruning Example MAX MIN A1A1 A2A2 A3A3 3 3 A 11 A 13 A X <=2 A 21 A 23 A 22 2XX A 31 A 33 A <=14 XX 5X <=5 2 X<=2 5

14 Properties of Alpha-Beta pruning doesn’t effect final result Ordering improves efficiency of pruning “perfect ordering”, time complexity O(b m/2 ) –doubles depth of search In practice, time complexity O(b 3m/4 )

15 Alpha-Beta Algorithm function MAX-VALUE(state, game, alpha, beta) returns the minimax value of a state inputs: state, current state in game game, game description alpha, the best score for MAX along the path to state beta, the best score for MIN along the path to state if CUT-OFF(state) then return EVAL(state) for each s in SUCCESSORS(state) do alpha <- MAX(alpha, MIN-VALUE(s, game, alpha, beta)) if alpha >= beta then return beta end return alpha

16 Alpha-Beta cont. function MIN-VALUE(state, game, alpha, beta) returns the minimax value of a state if CUT-OFF(state) then return EVAL(state) for each s in SUCCESSORS(state) do beta <- MIN(beta, MAX-VALUE(s, game, alpha, beta)) if alpha >= beta then return alpha end return beta

17 Deterministic Games Checkers:- –Chinook, 1994 Chess –Deep Blue, 1997 Othello –computers too good Go –computers too bad

18 Non-deterministic Games Chance adds difficulty –dice roll, deal of cards, flip of coin ExpectiMax, like MiniMax –with additional chance nodes

19 Backgammon

20 ExpectiMiniMax expectimax(C) = sum i (p(d i ) max s (utility(s))) –C: chance node, d i : dice roll –p(d i ): probability of roll occurring –max s (utility(s)): max utility possible after dice roll Time Complexity –O(b m n m ) makes problems even harder to solve