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

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

Game Playing State-of-the-Art

CSE 473: Artificial Intelligence. Outline

CSE 573: Artificial Intelligence

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

CS 188: Artificial Intelligence

Artificial Intelligence

CS 5522: Artificial Intelligence II

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

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

Adversarial Search 1

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

CSE 473: Ar+ficial Intelligence

Game Playing State of the Art

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

Programming Project 1: Pacman (Due )

CS 188: Artificial Intelligence Spring Announcements

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

Artificial Intelligence

Adversarial Search Lecture 7

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

CS 188: Artificial Intelligence. Overview

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

CSE 573: Artificial Intelligence Autumn 2010

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

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

CS 188: Artificial Intelligence

CS 188: Artificial Intelligence

Game Playing State-of-the-Art. CS 188: Artificial Intelligence. Behavior from Computation. Adversarial Games. Deterministic Games.

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

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

Artificial Intelligence

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

CS 188: Artificial Intelligence Spring 2007

CSE 473: Artificial Intelligence Autumn 2011

Announcements. CS 188: Artificial Intelligence Fall Today. Tree-Structured CSPs. Nearly Tree-Structured CSPs. Tree Decompositions*

ARTIFICIAL INTELLIGENCE (CS 370D)

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

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

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

mywbut.com Two agent games : alpha beta pruning

Lecture 5: Game Playing (Adversarial Search)

Adversarial Search and Game Playing

Adversary Search. Ref: Chapter 5

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 (adversarial search problems)

Game playing. Chapter 5, Sections 1 6

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

Game-Playing & Adversarial Search

Foundations of Artificial Intelligence

CS 4700: Foundations of Artificial Intelligence

Games and Adversarial Search

Artificial Intelligence 1: game playing

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

Computer Game Programming Board Games

Game Playing. Philipp Koehn. 29 September 2015

ADVERSARIAL SEARCH. Chapter 5

CS 771 Artificial Intelligence. Adversarial Search

Game Playing: Adversarial Search. Chapter 5

Artificial Intelligence. Topic 5. Game playing

Ar#ficial)Intelligence!!

Game playing. Chapter 5. Chapter 5 1

Game playing. Chapter 6. Chapter 6 1

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

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

School of EECS Washington State University. Artificial Intelligence

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

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

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

CS 380: ARTIFICIAL INTELLIGENCE

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

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

Path Planning as Search

CS 331: Artificial Intelligence Adversarial Search II. Outline

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

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

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

CSC384: Introduction to Artificial Intelligence. Game Tree Search

Game-playing AIs: Games and Adversarial Search I AIMA

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

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

CS325 Artificial Intelligence Ch. 5, Games!

Artificial Intelligence. Minimax and alpha-beta pruning

2 person perfect information

Artificial Intelligence Adversarial Search

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

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

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

Adversarial search (game playing)

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

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

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

CS188 Spring 2010 Section 3: Game Trees

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

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

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

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

Games and Adversarial Search II

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

Transcription:

CSE 473: Artificial Intelligence Fall 2014 Adversarial Search Dan Weld Outline Adversarial Search Minimax search α-β search Evaluation functions Expectimax Reminder: Project 1 due Today Based on slides from Dan Klein, Stuart Russell, Pieter Abbeel, Andrew Moore and Luke Zettlemoyer (best illustrations from ai.berkeley.edu) 1 Types of Games stratego Number of Players? 1, 2,? Deterministic Games Many possible formalizations, one is: States: S (start at s 0 ) Players: P={1...N} (usually take turns) Actions: A (may depend on player / state) Transition Function: S x A à S Terminal Test: S à {t,f} Terminal Utilities: S x Pà R Solution for a player is a policy: S à A Previously: Single-Agent Trees Previously: Value of a State Value of a state: The best achievable outcome (u?lity) from that state Non- Terminal States: 2 0 2 6 4 6 2 0 2 6 4 6 Terminal States: 1

Adversarial Game Trees Minimax Values States Under Agent s Control: States Under Opponent s Control: - - 5-10 + - 20 - - 1-5 - 10 +4-20 + Terminal States: Adversarial Search (Minimax) Minimax Implementation Deterministic, zero-sum games: Tic-tac-toe, chess, checkers One player maximizes result The other minimizes result Minimax search: A state-space search tree Players alternate turns Compute each node s minimax value: the best achievable utility against a rational (optimal) adversary Minimax values: computed recursively 5 max 2 5 2 5 6 Terminal values: part of the game min def max- value(state): ini?alize v = - for each successor of state: v = max(v, min- value(successor)) def min- value(state): ini?alize v = + for each successor of state: v = min(v, max- value(successor)) Do We Need to Evaluate Every Node? α-β Pruning Example 3 3 2? Progress of search 2

General configuration α-β Pruning α is MAX s best choice on path to root If n becomes worse than α, MAX will avoid it, so can stop considering n s other children Define β similarly for MIN Player Opponent Player Opponent α n Alpha-Beta Implementation α: MAX s best option on path to root β: MIN s best option on path to root def max- val(state, α, β): ini?alize v = - for each c in children(state): v = max(v, min- val(c, α, β)) if v β α = max(α, v) def min- val(state, α, β): ini?alize v = + for each c in children(state): v = min(v, max- val(child, α, β)) if v α β = min(β, v) Slide adapted from Dan Klein & Pieter Abbeel - ai.berkeley.edu At max node: Prune if v β; Update α Alpha-Beta Pruning Example β=+ 3 2 1 β=3 β=3 β=3 β=2 β=14 β=5 3 12 2 14 5 1 β=3 α= β=3 3 At min node: Prune if v α; Update β β=1 α is MAX s best alternative here or above β is MIN s best alternative here or above Alpha-Beta Pruning Properties This pruning has no effect on final result at the root Values of intermediate nodes might be wrong! but, they are bounds Good child ordering improves effectiveness of pruning With perfect ordering : Time complexity drops to O(b m/2 ) Doubles solvable depth! Full search of, e.g. chess, is still hopeless Alpha-Beta Quiz Alpha-Beta Quiz 2 3

Resource Limits Problem: In realistic games, cannot search to leaves! Solution: Depth-limited search Instead, search only to a limited depth in the tree Replace terminal utilities with an evaluation function for non-terminal positions Example: Suppose we have 100 seconds, can explore 10K nodes / sec So can check 1M nodes per move α-β reaches about depth decent chess program Guarantee of optimal play is gone More plies makes a BIG difference Use iterative deepening for an anytime algorithm 4-2 4-1 - 2 4 9???? max min Evaluation functions are always imperfect Depth Matters The deeper in the tree the evaluation function is buried, the less the quality of the evaluation function matters An important example of the tradeoff between complexity of features and complexity of computation [Demo: depth limited (L6D4, L6D5)] Iterative Deepening Heuristic Evaluation Function Iterative deepening uses DFS as a subroutine: 1. Do a DFS which only searches for paths of length 1 or less. (DFS gives up on any path of length 2) 2. If 1 failed, do a DFS which only searches paths of length 2 or less. 3. If 2 failed, do a DFS which only searches paths of length 3 or less..and so on. Why do we want to do this for multiplayer games? b Function which scores non-terminals Ideal function: returns the utility of the position In practice: typically weighted linear sum of features: e.g. f 1 (s) = (num white queens num black queens), etc. Evaluation for Pacman Which algorithm? α-β, depth 4, simple eval fun QuickTime and a GIF decompressor are needed to see this picture. What features would be good for Pacman? 4

Which algorithm? Why Pacman Starves α-β, depth 4, better eval fun QuickTime and a GIF decompressor are needed to see this picture. He knows his score will go up by eating the dot now He knows his score will go up just as much by eating the dot later on There are no point-scoring opportunities after eating the dot Therefore, waiting seems just as good as eating 5