Game tree search Thanks to Andrew Moore and Faheim Bacchus for slides!

Slides:



Advertisements
Similar presentations
Chapter 6, Sec Adversarial Search.
Advertisements

Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
Alpha-Beta Search. 2 Two-player games The object of a search is to find a path from the starting position to a goal position In a puzzle-type problem,
Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
This lecture topic: Game-Playing & Adversarial Search
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Games & Adversarial Search
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
Adversarial Search Chapter 6 Section 1 – 4.
Adversarial Search: Game Playing Reading: Chapter next time.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
This time: Outline Game playing The minimax algorithm
Game Playing CSC361 AI CSC361: Game Playing.
1 search CS 331/531 Dr M M Awais A* Examples:. 2 search CS 331/531 Dr M M Awais 8-Puzzle f(N) = g(N) + h(N)
How computers play games with you CS161, Spring ‘03 Nathan Sturtevant.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Game Tree Search based on Russ Greiner and Jean-Claude Latombe’s notes.
Adversarial Search: Game Playing Reading: Chess paper.
Games & Adversarial Search Chapter 6 Section 1 – 4.
Alpha-Beta Search. 2 Two-player games The object of a search is to find a path from the starting position to a goal position In a puzzle-type problem,
Game Playing State-of-the-Art  Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in Used an endgame database defining.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
CISC 235: Topic 6 Game Trees.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Game Playing.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Game-playing AIs Part 1 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part I (this set of slides)  Motivation  Game Trees  Evaluation.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
Game Playing. Introduction One of the earliest areas in artificial intelligence is game playing. Two-person zero-sum game. Games for which the state space.
Quiz 4 : Minimax Minimax is a paranoid algorithm. True
CSCI 4310 Lecture 6: Adversarial Tree Search. Book Winston Chapter 6.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Today’s Topics Playing Deterministic (no Dice, etc) Games –Mini-max –  -  pruning –ML and games? 1997: Computer Chess Player (IBM’s Deep Blue) Beat Human.
 Game Tree Search  Chapter 6.1, 6.2, 6.3, 6.6 cover some of the material we cover here. Section 6.6 has an interesting overview of State- of-the-Art.
CSE373: Data Structures & Algorithms Lecture 23: Intro to Artificial Intelligence and Game Theory Based on slides adapted Luke Zettlemoyer, Dan Klein,
Game tree search Chapter 6 (6.1 to 6.3 and 6.6) cover games. 6.6 covers state of the art game players in particular. 6.5 covers games that involve uncertainty.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Game tree search As ever, slides drawn from Andrew Moore’s Machine Learning Tutorials: as well as from Faheim Bacchus.
1 CSC 384 Lecture Slides (c) , C. Boutilier and P. Poupart CSC384: Lecture 11  Last time Costs, Heuristics, LCFS, BeFS, A*, IDS  Today game.
Adversarial Search 2 (Game Playing)
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Chapter 5 Adversarial Search. 5.1 Games Why Study Game Playing? Games allow us to experiment with easier versions of real-world situations Hostile agents.
1 Fahiem Bacchus, University of Toronto CSC384: Intro to Artificial Intelligence Game Tree Search I ● Readings ■ Chapter 6.1, 6.2, 6.3, 6.6 ● Announcements:
Adversarial Search and Game-Playing
Announcements Homework 1 Full assignment posted..
Game Tree Search Chapter 5.1, 5.2, 5.3, 5.6 cover some of the material we cover here. Section 5.6 has an interesting overview of State-of-the-Art game.
PENGANTAR INTELIJENSIA BUATAN (64A614)
CS Fall 2016 (Shavlik©), Lecture 11, Week 6
Pengantar Kecerdasan Buatan
Games & Adversarial Search
Alpha-Beta Search.
Games & Adversarial Search
Games & Adversarial Search
NIM - a two person game n objects are in one pile
Alpha-Beta Search.
Alpha-Beta Search.
Minimax strategies, alpha beta pruning
Alpha-Beta Search.
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
Alpha-Beta Search.
Minimax strategies, alpha beta pruning
Games & Adversarial Search
Unit II Game Playing.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Game tree search Thanks to Andrew Moore and Faheim Bacchus for slides!

Game tree search In this lecture we will cover some basics of two player zero sum discrete finite deterministic games of perfect information

More on the meaning of “Zero-Sum” We will focus on “Zero Sum” games. “Zero-sum” games are fully competitive if one player wins, the other player loses more specifically, the amount of money I win (lose) at poker is the amount of money you lose (win) More general games can be cooperative some outcomes are preferred by both of us, or at least our values aren’t diametrically opposed

Scissors cut paper, paper covers rock, rock smashes scissors Represented as a matrix: Player I chooses a row, Player II chooses a column Payoff to each player in each cell (P I / P II) 1: win, 0: tie, -1: loss is this game “zero-sum”? RPS 0/00/0 0/00/0 0/00/0 -1/1 1/-1 R P S Player II Player I Is Rock Paper Scissors “Zero-Sum”?

Dilemma: Two prisoners are in separate cells and there is not enough evidence to convict them If one confesses, while the other doesn’t: the confessor goes free the other sentenced to 4 years If both confess both are sentenced to 3 years If neither confess: both are sentenced to 1 year on minor charge Is this game “zero sum”? DoDon’t 3/33/3 1/11/1 0/40/4 4/04/0 Do Don’t Is The Prisoner’s Dilemma “Zero-Sum”? Prisoner II: confess? Prisoner I: confess?

Is The Coffee-Bot Dilemma “Zero-Sum”? Two robots: Green (Craig’s), Red (Fahiem’s) one cup of coffee and tea left both Craig and Faheim prefer coffee (value 10) but, tea is acceptable (value 8) Both robot’s go for coffee they collide and get no payoff Both go for tea: collide and get no payoff One goes for coffee, other for tea: coffee robot gets 10 tea robot gets 8 CoffeeTea 0/00/0 8/10 0/00/0 10/0 Coffee Tea

With a search space defined for II-Nim, we can define a Game Tree. A game tree looks like a search tree Layers reflect alternating moves between A and B Player A doesn’t decide where to go alone after Player A moves to a state, B decides which of the state’s children to move to. Thus, A must have a strategy: A must know what to do for each possible move of B. “What to do” will depend on how B plays.

Question: what happens if there are loops in the tree? How would looping influence your determination of the minimax value for a node?

Imagine you have a game with N states, that each state has b successors, and the length of the game is usually D moves. Minimax will expand O(b D ) states, which is both BEST and WORSE case scenario. This is different than regular DFS! But, what if N is less than b D ? In chess, for example, b D = , but N = Managing games with fewer states than game tree nodes. Note: info on this slide WON’T be on exams!

Managing games with fewer states than game tree nodes. Make a huge array of size N. Give each element in the array one of the following values: ?: We don’t know who wins from this state W: We know white wins from this position B: We know black wins from this position. Mark all terminal states with their values (‘W’ or ‘B’). Suppose we have 4 pieces left at the end of a chess game. With enough computing power, we can compute, for all such game states, if the position is a win for White, Black or a Draw. Note: info on this slide WON’T be on exams!

Managing games with fewer states than game tree nodes. Look through all states that remain marked with a ‘?’. For states where W is about to move: If all successors are marked ‘B’, mark the current state ‘B’. If any successors is marked ‘W’, mark the current state ‘W’. Otherwise leave the state unchanged. For states where B is about to move: If all successors are marked ‘W’, mark the current state ‘W’. If any successors is marked ‘B’, mark the current state ‘B’. Otherwise leave the state unchanged. Repeat! Until there are none of the elements in the array change their value. Any state remaining at ‘?’ is a state from which no one can force a win. Note: to turn this algorithm into a strategy, you also need to record pointers from given states to their best successors. This is a DYNAMIC PROGRAMMING technique. Note: info on this slide WON’T be on exams!

Question: what happens if there are loops in the tree?

A s1s2 s β = 8 24 α = 2, then 4, then.... s4 s5 B Example 1: We are currently expanding possible moves for player A, from left to right. Which of the node expansions above could we prune, and why?

A s1s2 s β = 8 24 α = 9 s4 s5 B Once we discover a node with value ‘9’, there is no need to expand the nodes to the right!

B s1s2 s α = 7 93 β = 9, then 3, then.... s4 s5 A 42 8 Example 2: We are currently expanding possible moves for player B, from left to right. Which of the node expansions above could we prune, and why?

B s1s2 s α = 7 93 β = 3 s4 s5 A 42 8 Once we discover a node with value ‘3’, there is no need to expand the nodes to the right!

Rational Opponents This all assumes that your opponent is rational e.g., will choose moves that minimize your score Storing your strategy is a potential issue: you must store “decisions” for each node you can reach by playing optimally if your opponent has unique rational choices, this is a single branch through game tree if there are “ties”, opponent could choose any one of the “tied” moves: must store strategy for each subtree What if your opponent doesn’t play rationally? will it affect quality of outcome? will your stored strategies work?

Heuristic evaluation functions in games Some issues in heuristic search How far should we search in our game tree to determine the value of a node, if we only have a fixed amount of time? What if we stop our search at a level in the search tree where subsequent moves dramatically change our evaluation?

Heuristic evaluation functions in games Think of a few games and suggest some heuristics for estimating the “goodness” of a position chess? checkers? your favorite video game? “find the last parking spot”?

Question: is there an alpha beta version you can use to search this tree?