Alpha-beta Search. Two-player games zThe object of a search is to find a path from the starting position to a goal position zIn a puzzle-type problem,

Slides:



Advertisements
Similar presentations
Chapter 6, Sec Adversarial Search.
Advertisements

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.
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
CS 484 – Artificial Intelligence
Search in AI.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Adversarial Search Chapter 6.
MINIMAX SEARCH AND ALPHA- BETA PRUNING: PLAYER 1 VS. PLAYER 2.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
G51IAI Introduction to AI Minmax and Alpha Beta Pruning Garry Kasparov and Deep Blue. © 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
Artificial Intelligence in Game Design
State Space 4 Chapter 4 Adversarial Games. Two Flavors Games of Perfect Information ◦Each player knows everything that can be known ◦Chess, Othello Games.
This time: Outline Game playing The minimax algorithm
1 Game Playing Chapter 6 Additional references for the slides: Luger’s AI book (2005). Robert Wilensky’s CS188 slides:
Game Playing CSC361 AI CSC361: Game Playing.
Min-Max Trees Based on slides by: Rob Powers Ian Gent Yishay Mansour.
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)
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
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: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
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.
Lecture 5 Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
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.
Lecture 6: Game Playing Heshaam Faili University of Tehran Two-player games Minmax search algorithm Alpha-Beta pruning Games with chance.
Game Playing.
AD FOR GAMES Lecture 4. M INIMAX AND A LPHA -B ETA R EDUCTION Borrows from Spring 2006 CS 440 Lecture Slides.
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.
Chapter 12 Adversarial Search. (c) 2000, 2001 SNU CSE Biointelligence Lab2 Two-Agent Games (1) Idealized Setting  The actions of the agents are interleaved.
Game Playing. Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
HEURISTIC SEARCH.
CSCI 4310 Lecture 6: Adversarial Tree Search. Book Winston Chapter 6.
GAME PLAYING 1. There were two reasons that games appeared to be a good domain in which to explore machine intelligence: 1.They provide a structured task.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Adversarial Games. Two Flavors  Perfect Information –everything that can be known is known –Chess, Othello  Imperfect Information –Player’s have each.
Intelligence Artificial Intelligence Ian Gent Games 2: Alpha Beta.
Game Playing Revision Mini-Max search Alpha-Beta pruning General concerns on games.
Game tree search Thanks to Andrew Moore and Faheim Bacchus for slides!
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.
Adversarial Search. Game playing u Multi-agent competitive environment u The most common games are deterministic, turn- taking, two-player, zero-sum game.
Game tree search As ever, slides drawn from Andrew Moore’s Machine Learning Tutorials: as well as from Faheim Bacchus.
Adversarial Search. Regular Tic Tac Toe Play a few games. –What is the expected outcome –What kinds of moves “guarantee” that?
Adversarial Search 2 (Game Playing)
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
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 Chapter Two-Agent Games (1) Idealized Setting – The actions of the agents are interleaved. Example – Grid-Space World – Two.
Game Playing Why do AI researchers study game playing?
PENGANTAR INTELIJENSIA BUATAN (64A614)
Pengantar Kecerdasan Buatan
State Space 4 Chapter 4 Adversarial Games.
Alpha-Beta 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.
Based on slides by: Rob Powers Ian Gent
Alpha-Beta Search.
Minimax strategies, alpha beta pruning
Unit II Game Playing.
Presentation transcript:

Alpha-beta Search

Two-player games zThe object of a search is to find a path from the starting position to a goal position zIn a puzzle-type problem, you (the searcher) get to choose every move zIn a two-player competitive game, you alternate choosing moves with the other player zThe other player doesn't want to reach your goal zYour search technique must be very different

Payoffs zEach game outcome has a payoff, which we can represent as a number zBy convention, we prefer positive numbers  In some games, the outcome is either a simple win ( +1 ) or a simple lose ( -1 )  In some games, you might also tie, or draw ( 0 ) zIn other games, outcomes may be other numbers (say, the amount of money you win at Poker)

Zero-sum games  Most common games are zero-sum: What I win ( $12 ), plus what you win ( -$12 ), equals zero zThere do exist non-zero-sum games zFor simplicity, we consider only zero-sum games zFrom our point of view, positive numbers are good, negative numbers are bad zFrom our opponents point of view, positive numbers are bad, negative numbers are good

A trivial "game" zWouldn't you like to win 50? zDo you think you will? zWhere should you move?

Minimaxing zYour opponent will choose smaller numbers  If you move left, your opponent will choose 3  If you move right, your opponent will choose -8  Your choice is 3 or -8 zPlay will be as shown

Heuristics zIn a large game, you don't really know the payoffs zA heuristic function computes, for a given node, your best guess as to what the payoff will be zThe heuristic function uses whatever knowledge you can build into the program zWe make two key assumptions: yYour opponent uses the same heuristic function yThe more moves ahead you look, the better your heuristic function will work

PBVs zA PBV is a preliminary backed-up value yExplore down to a given level using depth-first search yAs you reach each lowest-level node, evaluate it using your heuristic function yBack up values to the next higher node, according to the following rules: xIf your move, bring up the largest value, possibly replacing a smaller value xIf opponent's move, bring up smallest value, possible replacing a larger value

Using PBVs  Explore left-bottom 8 ; bring it up  Explore 5 ; smaller, so ignore it  Bring 8 up another level  Explore 2 ; bring it up  Explore 9 ; better, so bring up, replacing 2  Don't replace 8

Bringing up values zIf it's your move, and the next child of this node has a larger value than this node, replace this value zIf it's your opponent's move, and the next child of this node has a smaller value than this node, replace this value zAt your move, never reduce a value zAt your opponent's move, never increase a value

Alpha cutoffs  The value at your move is 8 (so far)  If you move right, the value there is 1 (so far) zYour opponent will never increase the value at this node zYou can ignore the black nodes

Beta cutoffs zAn alpha cutoff occurs where yIt is your opponent's turn to move yThe node has a lower PBV than some other node you could choose yYour opponent will never increase the PBV of this node zA beta cutoff occurs where yIt is your turn to move yThe node has a higher PBV than some other node the opponent could choose yYou will never decrease the PBV of this node

Using beta cutoffs zBeta cutoffs are harder to understand, because you have to see things from your opponent's point of view zYour opponent's alpha cutoff is your beta cutoff zWe assume your opponent is rational, and is using a heuristic function similar to yours zEven if this assumption is incorrect, it's still the best we can do

The importance of cutoffs zIf you can search to the end of the game, you know exactly how to play zThe further ahead you can search, the better zIf you can prune (ignore) large parts of the tree, you can search deeper on the other parts zSince the number of nodes at each level grows exponentially, the higher you can prune, the better zYou can save exponential time

Heuristic alpha-beta searching zThe higher in the search tree you can find a cutoff, the better (because of exponential growth) zTo maximize the number of cutoffs you can make: yApply the heuristic function at each node you come to, not just at the lowest level yExplore the "best" moves first y"Best" means best for the player whose move it is at that node

Best game playing strategies zFor any game much more complicated than tic- tac-toe, you have a time limit zSearching takes time; you need to use heuristics to minimize the number of nodes you search zBut complex heuristics take time, reducing the number of nodes you can search zSeek a balance between simple (but fast) heuristics, and slow (but good) heuristics

The End