Outline. Game playing. Types of games. Games vs. search problems. Minimax. Game tree (2-player, deterministic, turns) Games

Similar documents
Game playing. Chapter 6. Chapter 6 1

Games vs. search problems. Game playing Chapter 6. Outline. Game tree (2-player, deterministic, turns) Types of games. Minimax

Game playing. Chapter 6. Chapter 6 1

CS 380: ARTIFICIAL INTELLIGENCE ADVERSARIAL SEARCH. Santiago Ontañón

Games vs. search problems. Adversarial Search. Types of games. Outline

Game playing. Chapter 5. Chapter 5 1

CS 380: ARTIFICIAL INTELLIGENCE

Game playing. Outline

Game Playing. Philipp Koehn. 29 September 2015

ADVERSARIAL SEARCH. Chapter 5

Game Playing: Adversarial Search. Chapter 5

Game Playing. Dr. Richard J. Povinelli. Page 1. rev 1.1, 9/14/2003

Game playing. Chapter 5, Sections 1{5. AIMA Slides cstuart Russell and Peter Norvig, 1998 Chapter 5, Sections 1{5 1

Lecture 5: Game Playing (Adversarial Search)

Game playing. Chapter 5, Sections 1 6

Adversarial search (game playing)

Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 4: Search 3.

Ch.4 AI and Games. Hantao Zhang. The University of Iowa Department of Computer Science. hzhang/c145

Artificial Intelligence. Topic 5. Game playing

Today. Nondeterministic games: backgammon. Algorithm for nondeterministic games. Nondeterministic games in general. See Russell and Norvig, chapter 6

Last update: March 9, Game playing. CMSC 421, Chapter 6. CMSC 421, Chapter 6 1

COMP219: COMP219: Artificial Intelligence Artificial Intelligence Dr. Annabel Latham Lecture 12: Game Playing Overview Games and Search

Today. Types of Game. Games and Search 1/18/2010. COMP210: Artificial Intelligence. Lecture 10. Game playing

Adversarial Search (a.k.a. Game Playing)

COMP219: Artificial Intelligence. Lecture 13: Game Playing

CS 188: Artificial Intelligence

Programming Project 1: Pacman (Due )

CS 188: Artificial Intelligence Spring Game Playing in Practice

Games CSE 473. Kasparov Vs. Deep Junior August 2, 2003 Match ends in a 3 / 3 tie!

Adversarial Search Lecture 7

Game Playing. Why do AI researchers study game playing? 1. It s a good reasoning problem, formal and nontrivial.

Adversarial Search. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 9 Feb 2012

Adversarial Search. Chapter 5. Mausam (Based on slides of Stuart Russell, Andrew Parks, Henry Kautz, Linda Shapiro) 1

6. Games. COMP9414/ 9814/ 3411: Artificial Intelligence. Outline. Mechanical Turk. Origins. origins. motivation. minimax search

Adversarial Search and Game Playing

CS 188: Artificial Intelligence Spring 2007

Adversarial Search. CMPSCI 383 September 29, 2011

CS 188: Artificial Intelligence Spring Announcements

Announcements. Homework 1. Project 1. Due tonight at 11:59pm. Due Friday 2/8 at 4:00pm. Electronic HW1 Written HW1

Intuition Mini-Max 2

Game Playing State-of-the-Art

Adversarial Search. Soleymani. Artificial Intelligence: A Modern Approach, 3 rd Edition, Chapter 5

Adversarial Search. Human-aware Robotics. 2018/01/25 Chapter 5 in R&N 3rd Ø Announcement: Slides for this lecture are here:

CSE 473: Artificial Intelligence. Outline

Local Search. Hill Climbing. Hill Climbing Diagram. Simulated Annealing. Simulated Annealing. Introduction to Artificial Intelligence

CSE 573: Artificial Intelligence Autumn 2010

Game Playing State-of-the-Art CSE 473: Artificial Intelligence Fall Deterministic Games. Zero-Sum Games 10/13/17. Adversarial Search

CS 5522: Artificial Intelligence II

Artificial Intelligence

CS440/ECE448 Lecture 9: Minimax Search. Slides by Svetlana Lazebnik 9/2016 Modified by Mark Hasegawa-Johnson 9/2017

Adversarial Search. Read AIMA Chapter CIS 421/521 - Intro to AI 1

Announcements. CS 188: Artificial Intelligence Spring Game Playing State-of-the-Art. Overview. Game Playing. GamesCrafters

Announcements. CS 188: Artificial Intelligence Fall Local Search. Hill Climbing. Simulated Annealing. Hill Climbing Diagram

CS 188: Artificial Intelligence. Overview

Game-Playing & Adversarial Search

Game Playing State-of-the-Art. CS 188: Artificial Intelligence. Behavior from Computation. Video of Demo Mystery Pacman. Adversarial Search

Game Playing State of the Art

CS 188: Artificial Intelligence

Artificial Intelligence Adversarial Search

Adversarial Search. Chapter 5. Mausam (Based on slides of Stuart Russell, Andrew Parks, Henry Kautz, Linda Shapiro, Diane Cook) 1

Adversarial Search and Game- Playing C H A P T E R 6 C M P T : S P R I N G H A S S A N K H O S R A V I

Games and Adversarial Search

CS 331: Artificial Intelligence Adversarial Search II. Outline

Artificial Intelligence

Outline. Game Playing. Game Problems. Game Problems. Types of games Playing a perfect game. Playing an imperfect game

Artificial Intelligence

CITS3001. Algorithms, Agents and Artificial Intelligence. Semester 2, 2016 Tim French

Artificial Intelligence 1: game playing

School of EECS Washington State University. Artificial Intelligence

Artificial Intelligence. Minimax and alpha-beta pruning

Game-playing AIs: Games and Adversarial Search FINAL SET (w/ pruning study examples) AIMA

CSE 573: Artificial Intelligence

Artificial Intelligence

CS 771 Artificial Intelligence. Adversarial Search

Artificial Intelligence

Game Playing AI Class 8 Ch , 5.4.1, 5.5

Adversarial Search. Rob Platt Northeastern University. Some images and slides are used from: AIMA CS188 UC Berkeley

Adversarial Search Aka Games

Adversarial Search 1

Adversarial Search (Game Playing)

CSE 473: Artificial Intelligence Autumn 2011

CSE 40171: Artificial Intelligence. Adversarial Search: Games and Optimality

CS 4700: Foundations of Artificial Intelligence

CS 440 / ECE 448 Introduction to Artificial Intelligence Spring 2010 Lecture #5

CSE 473: Ar+ficial Intelligence

CSE 40171: Artificial Intelligence. Adversarial Search: Game Trees, Alpha-Beta Pruning; Imperfect Decisions

Foundations of Artificial Intelligence

Ar#ficial)Intelligence!!

Adversarial Search. CS 486/686: Introduction to Artificial Intelligence

Games vs. search problems

Foundations of Artificial Intelligence

CS440/ECE448 Lecture 11: Stochastic Games, Stochastic Search, and Learned Evaluation Functions

Chapter 6. Overview. Why study games? State of the art. Game playing State of the art and resources Framework

Adversarial Search and Game Playing. Russell and Norvig: Chapter 5

ADVERSARIAL SEARCH. Today. Reading. Goals. AIMA Chapter Read , Skim 5.7

Artificial Intelligence Search III

Unit-III Chap-II Adversarial Search. Created by: Ashish Shah 1

2/5/17 ADVERSARIAL SEARCH. Today. Introduce adversarial games Minimax as an optimal strategy Alpha-beta pruning Real-time decision making

ADVERSARIAL SEARCH. Today. Reading. Goals. AIMA Chapter , 5.7,5.8

Foundations of AI. 6. Adversarial Search. Search Strategies for Games, Games with Chance, State of the Art. Wolfram Burgard & Bernhard Nebel

Transcription:

utline Games Game playing Perfect play minimax decisions α β pruning Resource limits and approximate evaluation Chapter 6 Games of chance Games of imperfect information Chapter 6 Chapter 6 Games vs. search problems Types of games Unpredictable opponent solution is a strategy specifying a move for every possible opponent reply deterministic chance Time limits unlikely to find goal, must approximate perfect information chess, checkers, go, othello backgammon monopoly Plan of attack: Computer considers possible lines of play (Babbage, 846) imperfect information battleships, blind tictactoe bridge, poker, scrabble nuclear war Algorithm for perfect play (Zermelo, 9; Von Neumann, 944) Finite horizon, approximate evaluation (Zuse, 94; Wiener, 948; Shannon, 90) First chess program (Turing, 9) Machine learning to improve evaluation accuracy (Samuel, 9 7) Pruning to allow deeper search (McCarthy, 96) Chapter 6 Chapter 6 4 Game tree (-player, deterministic, turns) Minimax MA () Perfect play for deterministic, perfect-information games () Idea: choose move to position with highest minimax value = best achievable payoff against best play MA () E.g., -ply game: MA A A A () A A A A A A A A A TERAL 8 4 6 Utility 0 + Chapter 6 Chapter 6 6

Minimax algorithm function Minimax-Decision(state) returns an action inputs: state, current state in game return the a in Actions(state) maximizing Min-Value(Result(a, state)) Complete?? function Max-Value(state) returns a utility value v for a, s in Successors(state) do v Max(v, Min-Value(s)) function Min-Value(state) returns a utility value v for a, s in Successors(state) do v Min(v, Max-Value(s)) Chapter 6 7 Chapter 6 8 Time complexity?? Time complexity?? (b m ) Space complexity?? Chapter 6 0 Chapter 6 Time complexity?? (b m ) Space complexity?? (bm) (depth-first exploration) For chess, b, m 00 for reasonable games exact solution completely infeasible Butdoweneedtoexploreeverypath? MA 8 Chapter 6 Chapter 6

MA MA 8 8 Chapter 6 Chapter 6 MA MA 8 8 Chapter 6 6 Chapter 6 7 Why is it called α β? MA MA V α is the best value (to max) found so far off the current path If V is worse than α, max will avoid it prune that branch Define β similarly for min The α β algorithm function Alpha-Beta-Decision(state) returns an action return the a in Actions(state) maximizing Min-Value(Result(a, state)) function Max-Value(state, α, β) returns a utility value inputs: state, current state in game α, the value of the best alternative for max along the path to state β, the value of the best alternative for min along the path to state v for a, s in Successors(state) do v Max(v, Min-Value(s, α, β)) if v β then α Max(α, v) function Min-Value(state, α, β) returns a utility value same as Max-Value but with roles of α, β reversed Chapter 6 8 Chapter 6 9

Properties of α β Resource limits Pruning does not affect final result Good move ordering improves effectiveness of pruning With perfect ordering, time complexity = (b m/ ) doubles solvable depth A simple example of the value of reasoning about which computations are relevant (a form of metareasoning) Unfortunately, 0 is still impossible! Standard approach: Use Cutoff-Test instead of Terminal-Test e.g., depth limit (perhaps add quiescence search) Use Eval instead of Utility i.e., evaluation function that estimates desirability of position Suppose we have 00 seconds, explore 0 4 nodes/second 0 6 nodes per move 8/ α β reaches depth 8 pretty good chess program Chapter 6 0 Chapter 6 Evaluation functions Digression: Exact values don t matter MA 0 4 0 0 400 Black to move White to move White slightly better Black winning For chess, typically linear weighted sum of features Eval(s) =w f (s)+w f (s)+.+ w n f n (s) e.g., w =9with f (s) = (number of white queens) (number of black queens), etc. Behaviour is preserved under any monotonic transformation of Eval nly the order matters: payoff in deterministic games acts as an ordinal utility function Chapter 6 Chapter 6 Deterministic games in practice Nondeterministic games: backgammon Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in 994. Used an endgame database defining perfect play for all positions involving 8 or fewer pieces on the board, a total of 44,748,40,47 positions. Chess: Deep Blue defeated human world champion Gary Kasparov in a sixgame match in 997. Deep Blue searches 00 million positions per second, uses very sophisticated evaluation, and undisclosed methods for extending some lines of search up to 40 ply. thello: 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>00, so most programs use pattern knowledge bases to suggest plausible moves. 0 4 6 7 8 9 0 4 0 9 8 7 6 Chapter 6 4 Chapter 6

Nondeterministic games in general In nondeterministic games, chance introduced by dice, card-shuffling Simplified example with coin-flipping: MA CHANCE 0. 0. 0. 0. 4 0 Algorithm for nondeterministic games Expectiminimax gives perfect play Just like Minimax, except we must also handle chance nodes:. if state is a Max node then return the highest ExpectiMinimax-Value of Successors(state) if state is a Min node then return the lowest ExpectiMinimax-Value of Successors(state) if state is a chance node then return average of ExpectiMinimax-Value of Successors(state). 4 7 4 6 0 Chapter 6 6 Chapter 6 7 Nondeterministic games in practice Digression: Exact values D matter Dice rolls increase b: possible rolls with dice Backgammon 0 legal moves (can be 6,000 with - roll) MA depth 4 = 0 ( 0). 0 9 As depth increases, probability of reaching a given node shrinks value of lookahead is diminished DICE...9..9. 40.9.9..9. α β pruning is much less effective 4 0 0 400 TDGammon uses depth- search + very good Eval world-champion level 4 4 0 0 0 0 400 400 Behaviour is preserved only by positive linear transformation of Eval Hence Eval should be proportional to the expected payoff Chapter 6 8 Chapter 6 9 Games of imperfect information E.g., card games, where opponent s initial cards are unknown Typically we can calculate a probability for each possible deal Seems just like having one big dice roll at the beginning of the game Idea: compute the minimax value of each action in each deal, then choose the action with highest expected value over all deals Special case: if an action is optimal for all deals, it s optimal. GIB, current best bridge program, approximates this idea by ) generating 00 deals consistent with bidding information ) picking the action that wins most tricks on average Summary Games are fun to work on! (and dangerous) They illustrate several important points about AI perfection is unattainable must approximate good idea to think about what to think about uncertainty constrains the assignment of values to states optimal decisions depend on information state, not real state Games are to AI as grand prix racing is to automobile design Chapter 6 0 Chapter 6 8