Tutorial 5 Adversary Search

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.
CMSC 471 Spring 2014 Class #9 Tue 2/25/14 Game Playing Professor Marie desJardins,
Game Playing CS 63 Chapter 6
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.
Games & Adversarial Search
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
CS 484 – Artificial Intelligence
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.
1 Adversarial Search Chapter 6 Section 1 – 4 The Master vs Machine: A Video.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
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:
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.
Game Tree Search based on Russ Greiner and Jean-Claude Latombe’s notes.
Adversarial Search: Game Playing Reading: Chess paper.
Games & Adversarial Search Chapter 6 Section 1 – 4.
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.
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
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.
AD FOR GAMES Lecture 4. M INIMAX AND A LPHA -B ETA R EDUCTION Borrows from Spring 2006 CS 440 Lecture Slides.
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.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Notes on Game Playing by Yun Peng of theYun Peng University of Maryland Baltimore County.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
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 Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Adversarial Search 2 (Game Playing)
Adversarial Search and Game Playing Russell and Norvig: Chapter 6 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
Adversarial Search In this lecture, we introduce a new search scenario: game playing 1.two players, 2.zero-sum game, (win-lose, lose-win, draw) 3.perfect.
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.
Game Playing Why do AI researchers study game playing?
Adversarial Search and Game-Playing
Iterative Deepening A*
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.
Pengantar Kecerdasan Buatan
Game Playing.
Adversarial Search Chapter 5.
Game Playing in AI by: Gaurav Phapale 05 IT 6010
Games & Adversarial Search
Games & Adversarial Search
CMSC 471 Fall 2011 Class #8-9 Tue 9/27/11 – Thu 9/29/11 Game Playing
Game playing.
Chapter 6 : Game Search 게임 탐색 (Adversarial Search)
Games & Adversarial Search
Games & Adversarial Search
Game Playing: Adversarial Search
NIM - a two person game n objects are in one pile
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Mini-Max search Alpha-Beta pruning General concerns on games
Game Playing: Adversarial Search
Artificial Intelligence
Game Playing Chapter 5.
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
Adversarial Search CS 171/271 (Chapter 6)
Adversarial Search Game Theory.
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4.
Presentation transcript:

Tutorial 5 Adversary Search CS 236501 Introduction to AI Tutorial 5 Adversary Search

Intro. to AI – Tutorial 5 – By Nela Gurevich Agenda Introduction: Why games? Assumptions Minimax algorithm General idea Minimax with limited depth Alpha-Beta search Pruning Search routine Example Enhancements to the algorithm 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich Why Games? Games are fun Easy to measure results Simple moves Big search spaces Examples: Chess: Deep Junior Checkers: Chinook, Nemesis Othello: Bill Backgammon: TDGammon 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich Assumptions Two-players game Perfect information The knowledge available to each player is the same Zero Sum The move good for a player is bad for his adversary 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich Game Trees MIN MAX Win Win Loss Win Loss Draw Draw 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich The Minimax Algorithm e(v) if v is a terminal node MM(v) = max{MM(succ)} v is a max node min{MM(succ)} v is a min node Where succ = successors(v) and 1 if v is a WIN node e(v) = 0 if v is a DRAW node -1 if v is a LOSS node A problem: big branching factor, deep trees 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Minimax search to limited depth Search the game tree to some search frontier d. Compute a static evaluation function f to assess the strength values of nodes at that frontier. Use the minimax rule to compute approximations of the strength values of the shallower nodes. f(v) if d=0 or v is terminal MM(v,d) = max{MM(succ, d-1)} v is a max node min{MM(succ, d-1)} v is a min node 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich αβ Search Shallow pruning Deep pruning MM 10≤ 10 MM 10≤ 10 MM ≤ 5 5 MM ≤ 5 The node will not contribute to the max value of the father The node will not contribute to the max value of the ancestor 5 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich αβ Procedure α : highest max among ancestors of a node β : lowest min among ancestors of a node First call: αβ(v, d, min/max, -∞, ∞) // The αβ procedure αβ(v, d, node-type, α, β) { If v is terminal, or d = 0 return f(v) 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich αβ Procedure: MAX node if node-type = MAX { curr-max ← -infinity loop for vi є Succ(v) board-val ← αβ(vi, d-1, min, α, β) curr-max ← max(board-val, curr-max) α ← max(curr-max, α) if (curr-max ≥ β) // Bigger than lowest min end loop } return curr-max 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich αβ Procedure: MIN node if node-type = MIN { curr-min ← infinity loop for vi є Succ(v) board-val ← αβ(vi, d-1, max, α, β) curr-min ← min(board-val, curr-min) β ← min(curr-min, β) if (curr-min ≤ α) // Smaller than highest max end loop } return curr-min } // end of αβ 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich Game Tree Example MIN MAX 12 14 21 13 15 10 11 9 20 22 3 1 4 2 5 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich Stage 1 α = -∞ β = ∞ 13 15 14 10 11 9 ? 20 22 3 1 4 2 5 α = -∞ β = ∞ α = -∞ β = ∞ α = -∞ β = ∞ 12 14 21 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich Stage 1 13 15 14 10 11 9 ? 20 22 3 1 4 2 5 α = 10 β = ∞ 10 α = -∞ β = 10 α = 10 β = ∞ 10 12 14 21 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Stage 2 – Shallow Pruning 10 11 9 α = -∞ β = 10 10 α = 10 β = ∞ 10 α = -∞ β = 10 9 α = 10 β = 9 α = -∞ β = 10 12 14 15 13 14 5 2 4 1 3 22 20 21 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Game Tree example contd. 12 14 21 13 15 10 11 9 20 22 3 1 4 2 5 α = 10 β = ∞ 10 10 α = -∞ β = 10 14 α = 14 β = 10 14 α = -∞ β = 10 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Game Tree example contd. 12 14 21 13 15 10 11 9 20 22 3 1 4 2 5 α = 10 β = ∞ α = 10 β = ∞ α = 10 β = ∞ α = 10 β = ∞ 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Game Tree example contd. 12 14 21 13 15 10 11 9 20 22 3 1 4 2 5 α = 10 β = ∞ 5 α = 10 β = 5 α = 10 β = ∞ 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Game Tree example contd. 12 14 21 13 15 10 11 9 20 22 3 1 4 2 5 10 5 α = 10 β = 5 5 α = 10 β = ∞ 4 α = 10 β = 4 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich αβ Features Correctness: Minimax(v, d) = αβ(v, d, -∞, ∞) Pruning: The values of the tree leaves and the search ordering determine the amount of pruning For any given tree and any search ordering, there exists a sequence of values for the leaves, such that αβ prunes no leaf. For any given tree there exists such ordering that αβ prunes the maximal possible number of leaves. For randomly ordered trees αβ expands Θ(b(3/4d)) leaves Pruning decreases the effective branching factor, and thus allows us to search game tree for greater depth 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich Iterative αβ Perform αβ search to increasing depth beginning from some initial depth. Useful when the time is bounded – when the time is over, the value computed during the previous iteration can be returned The values computed during the previous iterations may be used to perform a heuristic ordering on the nodes of the tree to increase the pruning rate 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich

Intro. to AI – Tutorial 5 – By Nela Gurevich The End 27-Nov-18 Intro. to AI – Tutorial 5 – By Nela Gurevich