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,

Slides:



Advertisements
Similar presentations
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,
Advertisements

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.
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.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
CS 484 – Artificial Intelligence
Search in AI.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Adversarial Search Chapter 6.
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.
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.
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.
CSC 412: AI Adversarial Search
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.
Lecture 6: Game Playing Heshaam Faili University of Tehran Two-player games Minmax search algorithm Alpha-Beta pruning Games with chance.
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.
October 3, 2012Introduction to Artificial Intelligence Lecture 9: Two-Player Games 1 Iterative Deepening A* Algorithm A* has memory demands that increase.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
Chapter 12 Adversarial Search. (c) 2000, 2001 SNU CSE Biointelligence Lab2 Two-Agent Games (1) Idealized Setting  The actions of the agents are interleaved.
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,
Game Playing. Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers.
Minimax with Alpha Beta Pruning The minimax algorithm is a way of finding an optimal move in a two player game. Alpha-beta pruning is a way of finding.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
For Wednesday Read chapter 7, sections 1-4 Homework: –Chapter 6, exercise 1.
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.
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.
Graph Search II GAM 376 Robin Burke. Outline Homework #3 Graph search review DFS, BFS A* search Iterative beam search IA* search Search in turn-based.
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:
1 Chapter 6 Game Playing. 2 Chapter 6 Contents l Game Trees l Assumptions l Static evaluation functions l Searching game trees l Minimax l Bounded lookahead.
Adversarial Search and 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.
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Alpha-Beta Search.
Alpha-Beta Search.
Based on slides by: Rob Powers Ian Gent
Alpha-Beta Search.
Unit II Game Playing.
Presentation transcript:

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, you (the searcher) get to choose every move In a two-player competitive game, you alternate moves with the other player The other player doesn’t want to reach your goal Your search technique must be very different

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

4 Zero-sum games Most common games are zero-sum: What I win ( $12 ), plus what you win ( -$12 ), equals zero Not all games are zero-sum games For simplicity, we consider only zero-sum games From our point of view, positive numbers are good, negative numbers are bad From our opponents point of view, positive numbers are bad, negative numbers are good

5 A trivial “game” Wouldn’t you like to win 50? Do you think you will? Where should you move? Opponent’s move Your move

6 Minimaxing Opponent’s move Your move Your opponent will choose smaller numbers If you move left, your opponent will choose 3 If you move right, your opponent will choose -8 Therefore, your choices are really 3 or -8 You should move left, and play will be as shown 3-8 3

7 Heuristics In a large game, you don’t really know the payoffs A heuristic function computes, for a given node, your best guess as to what the payoff will be The heuristic function uses whatever knowledge you can build into the program We make two key assumptions: –Your opponent uses the same heuristic function as you do –The more moves ahead you look, the better your heuristic function will work

8 PBVs A PBV is a preliminary backed-up value –Explore down to a given level using depth-first search –As you reach each lowest-level node, evaluate it using your heuristic function –Back up values to the next higher node, according to the following rules: If it’s your move, bring up the largest value, possibly replacing a smaller value If it’s your opponent’s move, bring up the smallest value, possible replacing a larger value

9 Using PBVs (animated) Your move Opponents move Do a DFS; find an 8 and bring it up 8 8 Explore 5; smaller than 8, so ignore it 5 8 Backtrack; bring 8 up another level 2 2 Explore 2; bring it up 9 Explore 9; better than 2, so bring it up, replacing is not better than 8 (for your opponent), so ignore it Explore –3, bring it up Etc.

10 Bringing up values If it’s your move, and the next child of this node has a larger value than this node, replace this value If it’s your opponent’s move, and the next child of this node has a smaller value than this node, replace this value At your move, never reduce a value At your opponent’s move, never increase a value

11 Alpha cutoffs The value at your move is 8 (so far) If you move right, the value there is 1 (so far) Your opponent will never increase the value at this node; it will always be less than 8 You can ignore the remaining nodes Your move Opponents move alpha cutoff

12 Alpha cutoffs, in more detail You have an alpha cutoff when: –You are examining a node at which it is your opponent’s move, and –You have a PBV for the node’s parent, and –You have brought up a PBV that is less than the PBV of the node’s parent, and –The node has other children (which we can now “prune”) Your move Opponents move alpha cutoff node being examined parent (has PBV of 8)

13 Beta cutoffs An alpha cutoff occurs where –It is your opponent’s turn to move –You have computed a PBV for this node’s parent –The node’s parent has a higher PBV than this node –This node has other children you haven’t yet considered A beta cutoff occurs where –It is your turn to move –You have computed a PBV for this node’s parent –The node’s parent has a lower PBV than this node –This node has other children you haven’t yet considered

14 Using beta cutoffs Beta cutoffs are harder to understand, because you have to see things from your opponent’s point of view Your opponent’s alpha cutoff is your beta cutoff We assume your opponent is rational, and is using a heuristic function similar to yours Even if this assumption is incorrect, it’s still the best we can do

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

16 Heuristic alpha-beta searching The higher in the search tree you can find a cutoff, the better (because of exponential growth) To maximize the number of cutoffs you can make: –Apply the heuristic function at each node you come to, not just at the lowest level –Explore the “best” moves first –“Best” means best for the player whose move it is at that node

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

18 The End