CMSC 421: Intro to Artificial Intelligence October 6, 2003 Lecture 7: Games Professor: Bonnie J. Dorr TA: Nate Waisbrot.

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 Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
This lecture topic: Game-Playing & Adversarial Search
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.
For Monday Read chapter 7, sections 1-4 Homework: –Chapter 4, exercise 1 –Chapter 5, exercise 9.
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
CMSC 671 Fall 2001 Class #8 – Thursday, September 27.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
CS 484 – Artificial Intelligence
University College Cork (Ireland) Department of Civil and Environmental Engineering Course: Engineering Artificial Intelligence Dr. Radu Marinescu Lecture.
1 Game Playing. 2 Outline Perfect Play Resource Limits Alpha-Beta pruning Games of Chance.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Adversarial Search CSE 473 University of Washington.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
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:
Game Playing CSC361 AI CSC361: Game Playing.
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)
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Adversarial Search: Game Playing Reading: Chess paper.
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
CHAPTER 6 : ADVERSARIAL SEARCH
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.
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.
Lecture 6: Game Playing Heshaam Faili University of Tehran Two-player games Minmax search algorithm Alpha-Beta pruning Games with chance.
AD FOR GAMES Lecture 4. M INIMAX AND A LPHA -B ETA R EDUCTION Borrows from Spring 2006 CS 440 Lecture Slides.
Games CPS 170 Ron Parr. Why Study Games? Many human activities can be modeled as games –Negotiations –Bidding –TCP/IP –Military confrontations –Pursuit/Evasion.
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.
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.
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.
For Wednesday Read chapter 7, sections 1-4 Homework: –Chapter 6, exercise 1.
Game Playing. Introduction One of the earliest areas in artificial intelligence is game playing. Two-person zero-sum game. Games for which the state space.
Quiz 4 : Minimax Minimax is a paranoid algorithm. True
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,
Game tree search Chapter 6 (6.1 to 6.3 and 6.6) cover games. 6.6 covers state of the art game players in particular. 6.5 covers games that involve uncertainty.
For Monday Read chapter 7, sections 1-4 Homework: –Chapter 4, exercise 1 –Chapter 5, exercise 9.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Game-playing AIs Part 2 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part II  The Minimax Rule  Alpha-Beta Pruning  Game-playing.
Game Playing: Adversarial Search chapter 5. Game Playing: Adversarial Search  Introduction  So far, in problem solving, single agent search  The machine.
Adversarial Search and Game Playing Russell and Norvig: Chapter 6 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
CHAPTER 5 CMPT 310 Introduction to Artificial Intelligence Simon Fraser University Oliver Schulte Sequential Games and Adversarial Search.
Chapter 5: Adversarial Search & Game Playing
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
4. Games and adversarial search
Games and Adversarial Search
PENGANTAR INTELIJENSIA BUATAN (64A614)
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Games & Adversarial Search
Game playing.
Chapter 6 : Game Search 게임 탐색 (Adversarial Search)
Game Playing: Adversarial Search
Artificial Intelligence
Game Playing Chapter 5.
Adversarial Search CMPT 420 / CMPG 720.
Presentation transcript:

CMSC 421: Intro to Artificial Intelligence October 6, 2003 Lecture 7: Games Professor: Bonnie J. Dorr TA: Nate Waisbrot

Reading Finish Chapter 6; start Chapter 7.

Games  Games are a form of multiagent environment  Why study games? –Fun; historically entertaining –Interesting subject of study because they are hard –Easy to represent and agents restricted to small number of actions

Relation of Games to Search  Search – no adversary –Solution is (heuristic) method for finding goal –Heuristics and CSP techniques can find optimal solution –Evaluation function: estimate of cost from start to goal through given node –Examples: path planning, scheduling activities  Games – adversary –Solution is strategy –Time limits force an approximate solution –Evaluation function: evaluate “goodness” of game position –Examples: chess, checkers, Othello, backgammon

Types of Games

Game Playing  Two players: MAX and MIN  MAX moves first and they take turns until the game is over  A move is planned and executed as follows: –consider all legal moves –evalute resulting position for each one –pick best position and move there –opponent moves –repeat

Partial Game Tree for Tic-Tac-Toe Utility values: f(n)=+1 if position is a win for X; f(n)=-1 if position is a win for O; f(n)=0 if position is a draw UTILITY

Minimax Algorithm function MINIMAX-DECISION(state) returns an action inputs: state, current state in game v← MAX-VALUE(state) return the action in SUCCESSORS(state) with value v function MIN-VALUE(state) returns a utility value if TERMINAL-TEST(state) then return UTILITY(state) v←∞ for a,s in SUCCESSORS(state) do v← MIN(v,MAX-VALUE(s)) return v function MAX-VALUE(state) returns a utility value if TERMINAL-TEST(state) then return UTILITY(state) v←−∞ for a,s in SUCCESSORS(state) do v← MAX(v,MIN-VALUE(s)) return v

Two-Ply Game Tree

Properties of Minimax  CriterionMinimax Complete?Yes TimeO(b m ) SpaceO(bm) Optimal?Yes 

How do we deal with resource limits?  Evaluation function: return an estimate of the expected utility of the game from a given position  Alpha-beta pruning: return appropriate minimax decision without exploring entire tree

Heuristic Evaluation Function: Tic Tac Toe 6-5=1 6-3=3 8-5=38-6=28-5=3 6-6=0 6-5=1 6-4=26-2=4 f(n) = [# of 3-lengths open for MAX] – [# of 3-lengths open for MIN]

Heuristic Evaluation Functions Eval(s) = w 1 f 1 (s) + w 2 f 2 (s) + … + w n f n (s)

What is Alpha-Beta Cutoff? MAX MIN MAX ≥ X 3 ≤ 2 [3,+∞] [−∞,2]

Alpha-beta Pruning Replace TERMINAL-TEST and UTILITY in Minimax: if TERMINAL-TEST(state) then return UTILITY(state) if CUTOFF-TEST(state) then return EVAL(state)

Minimax with Alpha-Beta Pruning  Set alpha-beta values for all game-tree nodes to [-∞, +∞]  For each move, run DFS to generate game tree (DFS) to a given depth  Back-up evaluation estimates whenever possible: –For MAX node n set alpha(n) to be max value found so far –For MIN node n set beta(n) to be min value found so far  Prune branches that do not change final decision: –Alpha cutoff: stop searching below MIN node if its beta value is less than or equal to the alpha value of its ancestor –Beta cutoff: stop searching below MAX node if its alpha value is greater than or equal to the beta value of its ancestor

Alpha-Beta Example [−∞, −∞] [−∞,+∞]

Alpha-Beta Example (continued) [−∞,3] [3,+∞]

Alpha-Beta Example (continued) [−∞,3] [3,+∞]

Alpha-Beta Example (continued) [3,+∞] [3,3]

Alpha-Beta Example (continued) [−∞,2] [3,+∞] [3,3]

Alpha-Beta Example (continued) [−∞,2] [3,14] [3,3][−∞,14],

Alpha-Beta Example (continued) [−∞,2] [3,5] [3,3][−∞,5],

Alpha-Beta Example (continued) [2,2] [−∞,2] [3,3]

Alpha-Beta Example (continued) [2,2] [−∞,2] [3,3]

Final Comments about Alpha- Beta Pruning  Pruning does not affect final results  Good move ordering improves effectiveness of pruning  With “perfect ordering,” time complexity is O(b m/2 )  Definition of optimal play for MAX assumes MIN plays optimally: maximizes worst-case outcome for MAX.  But if MIN does not play optimally, MAX will do even better. [Can be proved.]