Announcements. Homework 1 solutions posted. Test in 2 weeks (27 th ) -Covers up to and including HW2 (informed search)

Similar documents
More on games (Ch )

ARTIFICIAL INTELLIGENCE (CS 370D)

mywbut.com Two agent games : alpha beta pruning

2 person perfect information

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

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

game tree complete all possible moves

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

Playing Games. Henry Z. Lo. June 23, We consider writing AI to play games with the following properties:

Adversarial Search 1

Adversary Search. Ref: Chapter 5

CMPUT 396 Tic-Tac-Toe Game

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

Algorithms for Data Structures: Search for Games. Phillip Smith 27/11/13

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

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

Artificial Intelligence Lecture 3

Games (adversarial search problems)

More on games (Ch )

Game Playing Part 1 Minimax Search

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

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

Adversarial Search: Game Playing. Reading: Chapter

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:

Artificial Intelligence. Minimax and alpha-beta pruning

CS510 \ Lecture Ariel Stolerman

CS188 Spring 2010 Section 3: Game Trees

COMP9414: Artificial Intelligence Adversarial Search

CSE 473: Artificial Intelligence Fall Outline. Types of Games. Deterministic Games. Previously: Single-Agent Trees. Previously: Value of a State

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

Game Engineering CS F-24 Board / Strategy Games

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

Solving Problems by Searching: Adversarial Search

Game-Playing & Adversarial Search

Artificial Intelligence 1: game playing

Adversarial Search. Robert Platt Northeastern University. Some images and slides are used from: 1. CS188 UC Berkeley 2. RN, AIMA

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

Programming Project 1: Pacman (Due )

CS 4700: Artificial Intelligence

Game Playing AI. Dr. Baldassano Yu s Elite Education

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

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

Computer Game Programming Board Games

CS188 Spring 2014 Section 3: Games

Artificial Intelligence. 4. Game Playing. Prof. Bojana Dalbelo Bašić Assoc. Prof. Jan Šnajder

Data Structures and Algorithms

CSC 380 Final Presentation. Connect 4 David Alligood, Scott Swiger, Jo Van Voorhis

CS188 Spring 2010 Section 3: Game Trees

Adversarial Search (Game Playing)

CSE 332: Data Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning. Playing Games. X s Turn. O s Turn. X s Turn.

Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning

Artificial Intelligence

CS 331: Artificial Intelligence Adversarial Search II. Outline

Artificial Intelligence Adversarial Search

Game-playing AIs: Games and Adversarial Search I AIMA

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

Ar#ficial)Intelligence!!

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

Game Playing State-of-the-Art

V. Adamchik Data Structures. Game Trees. Lecture 1. Apr. 05, Plan: 1. Introduction. 2. Game of NIM. 3. Minimax

INF September 25, The deadline is postponed to Tuesday, October 3

! HW5 now available! ! May do in groups of two.! Review in recitation! No fancy data structures except trie!! Due Monday 11:59 pm

CS 188: Artificial Intelligence Spring Announcements

CS 5522: Artificial Intelligence II

Adversarial Search and Game Playing

Artificial Intelligence

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

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

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

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

CSE 473: Artificial Intelligence. Outline

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

Math 152: Applicable Mathematics and Computing

Artificial Intelligence

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

More Adversarial Search

Path Planning as Search

Game Tree Search. CSC384: Introduction to Artificial Intelligence. Generalizing Search Problem. General Games. What makes something a game?

Rules of the game. chess checkers tic-tac-toe...

Project 1. Out of 20 points. Only 30% of final grade 5-6 projects in total. Extra day: 10%

2359 (i.e. 11:59:00 pm) on 4/16/18 via Blackboard

CSC384: Introduction to Artificial Intelligence. Game Tree Search

CS 188: Artificial Intelligence

Multiple Agents. Why can t we all just get along? (Rodney King)

Artificial Intelligence Search III

Foundations of Artificial Intelligence

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

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

CS 188: Artificial Intelligence Spring 2007

Adversarial Search Aka Games

CS 188: Artificial Intelligence

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

1 Introduction. 1.1 Game play. CSC 261 Lab 4: Adversarial Search Fall Assigned: Tuesday 24 September 2013

Game Tree Search. Generalizing Search Problems. Two-person Zero-Sum Games. Generalizing Search Problems. CSC384: Intro to Artificial Intelligence

Foundations of Artificial Intelligence

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

Adversarial Search Lecture 7

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

Transcription:

Minimax (Ch. 5-5.3)

Announcements Homework 1 solutions posted Test in 2 weeks (27 th ) -Covers up to and including HW2 (informed search)

Single-agent So far we have look at how a single agent can search the environment based on its actions Now we will extend this to cases where you are not the only one changing the state (i.e. multi-agent) The first thing we have to do is figure out how to represent these types of problems

Multi-agent (competitive) Most games only have a utility (or value) associated with the end of the game (leaf node) So instead of having a goal state (with possibly infinite actions), we will assume: (1) All actions eventually lead to terminal state (i.e. a leaf in the tree) (2) We know the value (utility) only at leaves

Multi-agent (competitive) For now we will focus on zero-sum two-player games, which means a loss for one person is a gain for another Betting is a good example of this: If I win I get $5 (from you), if you win you get $1 (from me). My gain corresponds to your loss Zero-sum does not technically need to add to zero, just that the sum of scores is constant

Multi-agent (competitive) Zero sum games mean rather than representing outcomes as: [Me=5, You =-5] We can represent it with a single number: [Me=5], as we know: Me+You = 0 (or some c) This lets us write a single outcome which Me wants to maximize and You wants to minimize

Minimax Thus the root (our agent) will start with a maximizing node, the the opponent will get minimizing noes, then back to max... repeat... This alternation of maximums and minimums is called minimax I will use to denote nodes that try to maximize and for minimizing nodes

Minimax Let's say you are treating a friend to lunch. You choose either: Shuang Cheng or Afro Deli The friend always orders the most inexpensive item, you want to treat your friend to best food Which restaurant should you go to? Menus: Shuang Cheng: Fried Rice=$10.25, Lo Mein=$8.55 Afro Deli: Cheeseburger=$6.25, Wrap=$8.74

Minimax Shuang Cheng Afro Deli Lo Mein Fried rice Cheeseburger Wrap 8.55 10.25 6.25 8.55

Minimax You could phrase this problem as a set of maximum and minimums as: max( min(8.55, 10.25), min(6.25, 8.55) )... which corresponds to: max( Shuang Cheng choice, Afro Deli choice) If our goal is to spend the most money on our friend, we should go to Shuang Cheng

Minimax One way to solve this is from the leaves up: L F R 2 L R L R 1 3 0 4

Minimax max( min(1,3), 2, min(0, 4) ) = 2, should pick Order: action F 1 st. R (can swap 2 2 nd. B B and R) L F R 3 rd. P 1 2 0 L R L R 1 3 0 4

Minimax L F R 2 L 3 F 1 R 2 L 4 F 8 2 R L F R Solve this minimax problem: 10 20 4 14 L F 5 R

Minimax This representation works, but even in small games you can get a very large search tree For example, tic-tac-toe has about 9! actions to search (or about 300,000 nodes) Larger problems (like chess or go) are not feasible for this approach (more on this next class)

Minimax Pruning in real life: Snip branch Pruning in CSCI trees: Snip branch

Alpha-beta pruning However, we can get the same answer with searching less by using efficient pruning It is possible to prune a minimax search that will never accidentally prune the optimal solution A popular technique for doing this is called alpha-beta pruning (see next slide)

Alpha-beta pruning Consider if we were finding the following: max(5, min(3, 19)) There is a short circuit evaluation for this, namely the value of 19 does not matter min(3, x) < 3 for all x Thus max(5, min(3,x)) = 5 for any x Alpha-beta pruning would not search x above

Alpha-beta pruning If when checking a min-node, we ever find a value less than the parent's best value, we can stop searching this branch 2 L 2 Parent's best so far = 2 R Child's worst = 0 STOP L R 0 4

Alpha-beta pruning In the previous slide, best is the alpha in the alpha-beta pruning (Similarly the worst in a min-node is beta ) Alpha-beta pruning algorithm: Do minimax as normal, except: min node: if parent's best value greater than current node, stop & tell parent current value max node: if parent's worst value less than current node, stop search and return current

Alpha-beta pruning Let's solve this with alpha-beta pruning L F R 2 L R L R 1 3 0 4

Alpha-beta pruning max( min(1,3), 2, min(0,??) ) = 2, should pick Order: action F 1 st. Red 2 nd. Blue 3 rd. Purp 2 L F R Do not consider 1 2 0 L R L R 1 3 0 4

Alpha-beta pruning range for node \ranton I think the book is confusing about alpha-beta, especially Figure 5.5 alpha (sort of) beta (sort of)

αβ pruning L F R 2 L 3 F 1 R 2 L 4 F 8 2 R L F R Solve this problem with alpha-beta pruning: 10 20 4 14 L F 5 R

Alpha-beta pruning In general, alpha-beta pruning allows you to search to a depth 2d for the minimax search cost of depth d So if minimax needs to find: O(b m ) Then, alpha-beta searches: O(b m/2 ) This is exponentially better, but the worst case is the same as minimax

Alpha-beta pruning Ideally you would want to put your best (largest for max, smallest for min) actions first This way you can prune more of the tree as a min node stops more often for larger best Obviously you do not know the best move, (otherwise why are you searching?) but some effort into guessing goes a long way (i.e. exponentially less states)

Side note: In alpha-beta pruning, the heuristic for guess which move is best can be complex, as you can greatly effect pruning While for A* search, the heuristic had to be very fast to be useful (otherwise computing the heuristic would take longer than the original search)