Adversarial Search: Game Playing. Reading: Chapter

Similar documents
Artificial Intelligence. Minimax and alpha-beta pruning

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

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

Artificial Intelligence Adversarial Search

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

Adversarial Search (Game Playing)

Game-Playing & Adversarial Search

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

CS 771 Artificial Intelligence. Adversarial Search

CPS 570: Artificial Intelligence Two-player, zero-sum, perfect-information Games

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

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

Adversarial Search Aka Games

Set 4: Game-Playing. ICS 271 Fall 2017 Kalev Kask

Programming Project 1: Pacman (Due )

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

Adversarial Search and Game Playing

CS 188: Artificial Intelligence

Game Playing AI Class 8 Ch , 5.4.1, 5.5

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

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

ARTIFICIAL INTELLIGENCE (CS 370D)

Adversarial Search. CMPSCI 383 September 29, 2011

Game Playing State-of-the-Art

Adversarial Search 1

Foundations of AI. 5. Board Games. Search Strategies for Games, Games with Chance, State of the Art. Wolfram Burgard and Luc De Raedt SA-1

Adversary Search. Ref: Chapter 5

CS 5522: Artificial Intelligence II

CS 4700: Foundations of Artificial Intelligence

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

Computer Science and Software Engineering University of Wisconsin - Platteville. 4. Game Play. CS 3030 Lecture Notes Yan Shi UW-Platteville

Foundations of Artificial Intelligence

Artificial Intelligence

Adversarial Search Lecture 7

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

Artificial Intelligence 1: game playing

Ar#ficial)Intelligence!!

Game Playing AI. Dr. Baldassano Yu s Elite Education

2 person perfect information

CS 331: Artificial Intelligence Adversarial Search II. Outline

Game-playing: DeepBlue and AlphaGo

Game Playing. Philipp Koehn. 29 September 2015

Adversarial search (game playing)

Game-Playing & Adversarial Search Alpha-Beta Pruning, etc.

Foundations of Artificial Intelligence

CS 188: Artificial Intelligence Spring Announcements

Foundations of AI. 6. Board Games. Search Strategies for Games, Games with Chance, State of the Art

Artificial Intelligence. Topic 5. Game playing

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

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

Contents. Foundations of Artificial Intelligence. Problems. Why Board Games?

Game-playing AIs: Games and Adversarial Search I AIMA

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

Games (adversarial search problems)

Game playing. Chapter 5. Chapter 5 1

CS 2710 Foundations of AI. Lecture 9. Adversarial search. CS 2710 Foundations of AI. Game search

Game Playing State of the Art

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

CS 188: Artificial Intelligence

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

Game playing. Outline

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

CS 1571 Introduction to AI Lecture 12. Adversarial search. CS 1571 Intro to AI. Announcements

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

Artificial Intelligence

CS 188: Artificial Intelligence Spring Game Playing in Practice

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

CPS331 Lecture: Search in Games last revised 2/16/10

Game Playing: Adversarial Search. Chapter 5

COMP219: Artificial Intelligence. Lecture 13: Game Playing

CS 188: Artificial Intelligence Spring 2007

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

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

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

CS885 Reinforcement Learning Lecture 13c: June 13, Adversarial Search [RusNor] Sec

Games and Adversarial Search

Lecture 5: Game Playing (Adversarial Search)

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

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

CSE 573: Artificial Intelligence Autumn 2010

Module 3. Problem Solving using Search- (Two agent) Version 2 CSE IIT, Kharagpur

Game Engineering CS F-24 Board / Strategy Games

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

CS 188: Artificial Intelligence. Overview

Artificial Intelligence

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

Solving Problems by Searching: Adversarial Search

game tree complete all possible moves

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

Lecture 33: How can computation Win games against you? Chess: Mechanical Turk

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

Pengju

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

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

School of EECS Washington State University. Artificial Intelligence

Game playing. Chapter 5, Sections 1 6

Games and Adversarial Search II

Game playing. Chapter 6. Chapter 6 1

Lecture 14. Questions? Friday, February 10 CS 430 Artificial Intelligence - Lecture 14 1

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

Transcription:

Adversarial Search: Game Playing Reading: Chapter 6.5-6.8 1

Games and AI Easy to represent, abstract, precise rules One of the first tasks undertaken by AI (since 1950) Better than humans in Othello and checkers, defeated human champions in chess and backgammon, competitive in many other games Major exception: Go 2

Difficulty Games are interesting because they are too hard to solve Chess has a branching factor of 35,35 100 nodes, approx 10 154 Need to make some decision even when the optimal decision is infeasible Drives bounded rationality research 3

4

Deep Blue Kasparov vs. Deep Blue, May 1997 6 game full-regulation chess match (sponsored by ACM) Kasparov lost the match (2.5 to 3.5) Historic achievement for computer chess: first time a computer is the best chessplayer on the planet 5

The decisive game of the match was Game 2, which left a scare in my memory we saw something that went well beyond our wildest expectations of how well a computer would be able to foresee the long-term positional consequences of its decisions. The machine refused to move to a position that had a decisive short-term advantage showing a very human sense of danger. I think this moment could mark a revolution in computer science that could earn IBM and the Deep Blue team a Nobel Prize. Even today, weeks later, no other chess-playing program in the world has been able to evaluate correctly the consequences of Deep Blue s position. (Kasparov, 1997) 6

Some other thoughts 7

Types of Games 2 player vs. multiplayer Chess vs. Risk Zero-sum vs. general-sum Chess vs. an auction Perfect information vs. incomplete information Chess vs. bridge Deterministic vs. stochastic Chess vs. backgammon 8

9

10

Search Formulation Two players: Max and Min. Max moves first States: board configurations Operators: legal moves Initial State: start configuration Terminal State: final configuration Goal test: (for max) a terminal state with high utility Utility function: numeric values for final states. E.g., win, loss, draw with values 1, -1, 0 11

Minimax Algorithm Find the optimal strategy for Max: Depth-first search of the game tree Note: an optimal leaf node could appear at any depth of the tree Minimax principle: compute the utility of being in a state assuming both players play optimally from there until the end of the game Propogate minimax values up the tree once terminal nodes are discovered Eventually, read of the optimal strategy for Max 12

Represents Max s turn Represents Min s turn 13

Size of Game Search Trees DFS, time complexity O(b d ) Chess B~35(average branching factor) D~100(depth of game tree for typical game) B d ~35 100 ~10 154 nodes Tic-Tac-Toe ~5 legal moves, total of 9 moves 5 9 =1,953,125 9!=362,880 (Computer goes first) 8!=40,320 (Computer goes second) Go, branching factor starts at 361 (19X19 board); backgammon, branching factor around 20X20 (because of chance nodes) 14

Which values are necessary? 15

α-β values Computing alpha-beta values α value is a lower-bound on the actual value of a MAX node, maximum across seen children β value is an upper-bound on actual value of a MIN node, minimum across seen children Propagation: Update α,β values by propagating upwards values of terminal nodes Update α,β values down to allow pruning 16

17

18

19

20

21

α-β pruning Below a MIN node whose β value is lower than or equal to the α value of its ancestor A MAX ancestor will never choose that MIN node, because there is another choice with a higher value Below a MAX node whose α value is greater than or equal to the β value of its answer A MIN ancestor will never choose that MAX node because there is another choice with a lower value 22

Effectiveness of α-β pruning (Knuth&Moore 75) [best-case] if successors are ordered bestfirst α-β must only examine O(b d/2 ) nodes instead of O(b d ) Effective branching factor is sqrt(b) and not b; can look twice as far ahead. [avg-case] if successors are examined in random order then nodes will be O(b 3d/4 ) for moderate b For chess, a fairly simple ordering function (e.g., captures, then threats, then forward moves) gets close to theoretical limit [worst case] in worst-case, α-β gives no improvement over exhaustive search 23

What if α-β search is not fast enough? Notice that we re allowing smart ordering heuristics, but otherwise α-β still has to search all the way to terminal states for at least a portion of the search space. What else can we do?? 24

Heuristics: evaluation functions Bound the depth of search, and use an evaluation function to estimate value of current board configurations E.g., Othello: #white pieces - #black pieces E.g., Chess: Value of all white pieces Value of all black pices Typical values from infinity (lost) to +infinity (won) or [- 1,+1] turn non-terminal nodes into terminal leaves And, α-β pruning continues to apply 25

Evaluation Functions An ideal evaluation function would rank terminal states in the same way as the true utility function; but must be fast Typical to define features, & make the function a linear weighted sum of the features 26

Chess F 1 =number of white pieces F 2 =number of black pieces F 3 =F 1 /F 2 F 4 =number of white bishops F 5 =estimate of threat to white king 27

Weighted Linear Function Eval(s)=w 1 F 1 (s)+w 2 F 2 (s)+ +w n F n (s) Given features and weights Assumes independence Can use expert knowledge to construct an evaluation function Can also use self-play and machine learning 28

29

30