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

Similar documents
CS 331: Artificial Intelligence Adversarial Search II. Outline

Adversary Search. Ref: Chapter 5

Programming Project 1: Pacman (Due )

Adversarial Search: Game Playing. Reading: Chapter

School of EECS Washington State University. Artificial Intelligence

Ar#ficial)Intelligence!!

Foundations of Artificial Intelligence

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

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

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

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

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

Adversarial Search and Game Playing

CS 5522: Artificial Intelligence II

Foundations of Artificial Intelligence

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

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

Adversarial Search Aka Games

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

Games and Adversarial Search

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

Artificial Intelligence Adversarial Search

Game Playing. Philipp Koehn. 29 September 2015

Adversarial Search (Game Playing)

Artificial Intelligence. Topic 5. Game playing

Adversarial Search 1

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

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

Artificial Intelligence

CS 4700: Foundations of Artificial Intelligence

ARTIFICIAL INTELLIGENCE (CS 370D)

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

Artificial Intelligence

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

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

CS 188: Artificial Intelligence

More Adversarial Search

Adversarial Search Lecture 7

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

COMP219: Artificial Intelligence. Lecture 13: Game Playing

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

Artificial Intelligence. Minimax and alpha-beta pruning

CSE 473: Artificial Intelligence. Outline

CS 771 Artificial Intelligence. Adversarial Search

Game playing. Chapter 5, Sections 1 6

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

CS 188: Artificial Intelligence

Game Playing State-of-the-Art

Lecture 5: Game Playing (Adversarial Search)

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

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

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

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

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

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

Game playing. Chapter 5. Chapter 5 1

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

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

Path Planning as Search

Game Playing: Adversarial Search. Chapter 5

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

Intuition Mini-Max 2

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

Solving Problems by Searching: Adversarial Search

Games (adversarial search problems)

Adversarial search (game playing)

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

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

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

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

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

Artificial Intelligence 1: game playing

ADVERSARIAL SEARCH. Chapter 5

CS 380: ARTIFICIAL INTELLIGENCE

Game playing. Chapter 6. Chapter 6 1

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

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

Adversarial Search. CMPSCI 383 September 29, 2011

Artificial Intelligence

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

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

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

Artificial Intelligence Search III

mywbut.com Two agent games : alpha beta pruning

2 person perfect information

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

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

Game-playing AIs: Games and Adversarial Search I AIMA

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

Game-Playing & Adversarial Search

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

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

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

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

Game Playing AI Class 8 Ch , 5.4.1, 5.5

CSE 573: Artificial Intelligence

Game playing. Chapter 6. Chapter 6 1

Foundations of Artificial Intelligence

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

CS 188: Artificial Intelligence Spring Announcements

Transcription:

CPS 57: Artificial Intelligence Two-player, zero-sum, perfect-information Games Instructor: Vincent Conitzer

Game playing Rich tradition of creating game-playing programs in AI Many similarities to search Most of the games studied have two players, are zero-sum: what one player wins, the other loses have perfect information: the entire state of the game is known to both players at all times E.g., tic-tac-toe, checkers, chess, Go, backgammon, Will focus on these for now Recently more interest in other games Esp. games without perfect information; e.g., poker Need probability theory, game theory for such games

Sum to 2 game moves, then player 2, finally player again Move = or wins if and only if all moves together sum to 2 Player 2 Player 2 - - - - - s utility is in the leaves; player 2 s utility is the negative of this

Backward induction (aka. minimax) From leaves upward, analyze best decision for player at node, give node a value Once we know values, easy to find optimal action (choose best value) Player 2 Player 2 - - - - - - -

Modified game From leaves upward, analyze best decision for player at node, give node a value 6 Player 2 Player 2 - - 4 6 7 6 - -2-3 4-5 6 7-8

A recursive implementation Value(state) If state is terminal, return its value If (player(state) = player ) v := -infinity For each action v := max(v, Value(successor(state, action))) Return v Else v := infinity For each action v := min(v, Value(successor(state, action))) Return v Space? Time?

Do we need to see all the leaves? Do we need to see the value of the question mark here? Player 2 Player 2 - -2? 4

Do we need to see all the leaves? Do we need to see the values of the question marks here? Player 2 Player 2 - -2?? -5 6 7-8

Alpha-beta pruning Pruning = cutting off parts of the search tree (because you realize you don t need to look at them) When we considered A* we also pruned large parts of the search tree Maintain alpha = value of the best option for player along the path so far Beta = value of the best option for player 2 along the path so far

Pruning on beta Beta at node v is - We know the value of node v is going to be at least 4, so the - route will be preferred No need to explore this node further Player 2 Player 2 node v - -2? 4

Pruning on alpha Alpha at node w is 6 We know the value of node w is going to be at most -, so the 6 route will be preferred No need to explore this node further Player 2 Player 2 node w - -2?? -5 6 7-8

Modifying recursive implementation to do alpha-beta pruning Value(state, alpha, beta) If state is terminal, return its value If (player(state) = player ) Else v := -infinity For each action v := max(v, Value(successor(state, action), alpha, beta)) If v >= beta, return v alpha := max(alpha, v) Return v v := infinity For each action v := min(v, Value(successor(state, action), alpha, beta)) If v <= alpha, return v beta := min(beta, v) Return v

Benefits of alpha-beta pruning Without pruning, need to examine O(b m ) nodes With pruning, depends on which nodes we consider first If we choose a random successor, need to examine O(b 3m/4 ) nodes If we manage to choose the best successor first, need to examine O(b m/2 ) nodes Practical heuristics for choosing next successor to consider get quite close to this Can effectively look twice as deep! Difference between reasonable and expert play

Repeated states As in search, multiple sequences of moves may lead to the same state Again, can keep track of previously seen states (usually called a transposition table in this context) May not want to keep track of all previously seen states

Using evaluation functions Most games are too big to solve even with alphabeta pruning Solution: Only look ahead to limited depth (nonterminal nodes) Evaluate nodes at depth cutoff by a heuristic (aka. evaluation function) E.g., chess: Material value: queen worth 9 points, rook 5, bishop 3, knight 3, pawn Heuristic: difference between players material values

Chess example White to move Ki p B R Depth cutoff: 3 ply Ply = move by one player Rd8+ White Black Kb7 p p p R White Rxf8 Re8 K 2 -

Chess (bad) example White to move Ki B R p Depth cutoff: 3 ply Ply = move by one player Rd8+ White Black Kb7 p p p R White Rxf8 Re8 K 2 Depth cutoff obscures fact that white R will be captured -

Addressing this problem Try to evaluate whether nodes are quiescent Quiescent = evaluation function will not change rapidly in near future Only apply evaluation function to quiescent nodes If there is an obvious move at a state, apply it before applying evaluation function

Playing against suboptimal players Minimax is optimal against other minimax players What about against players that play in some other way?

Many-player, general-sum games of perfect information Basic backward induction still works No longer called minimax What if other players do not play this way? Player 2 Player 2 (,2,3) Player 3 Player 3 Player 3 Player 3 (,2,3) (3,4,2) vector of numbers gives each player s utility

Games with random moves by Nature E.g., games with dice (Nature chooses dice roll) Backward induction still works Evaluation functions now need to be cardinally right (not just ordinally) For two-player zero-sum games with random moves, can we generalize alpha-beta? How? Nature (2,3.5) Nature 5% 5% 4% 6% (,3) (3,4) Player 2 Player 2 Player 2 Player 2 (,3) (3,2) (3,4) (,2)

Games with imperfect information Players cannot necessarily see the whole current state of the game Card games Ridiculously simple poker game: receives King (winning) or Jack (losing), can raise or check, Player 2 can call or fold Dashed lines indicate indistinguishable states gets King gets Jack player 2 player Backward induction does not work, need random strategies for optimality! (more later in course) raise check nature raise player check call fold call fold call fold call fold 2-2 - player 2

Intuition for need of random strategies Suppose my strategy is raise on King, check on Jack What will you do? What is your expected utility? What if my strategy is always raise? What if my strategy is always raise when given King, % of the time raise when given Jack? gets King gets Jack player 2 player raise check nature raise player check call fold call fold call fold call fold 2-2 - player 2

The state of the art for some games Chess: 997: IBM Deep Blue defeats Kasparov there is still debate about whether computers are really better Checkers: Go: Computer world champion since 994 there was still debate about whether computers are really better until 27: checkers solved optimally by computer Branching factor really high, seemed out of reach for a while AlphaGo now appears superior to humans Poker: AI now defeating top human players in 2-player ( heads-up ) games 3+ player case much less well-understood

Is this of any value to society? Some of the techniques developed for games have found applications in other domains Especially adversarial settings Real-world strategic situations are usually not two-player, perfect-information, zero-sum, But game theory does not need any of those Example application: security scheduling at airports