February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 1 The Alpha-Beta Procedure Can we estimate the efficiency benefit.

Slides:



Advertisements
Similar presentations
Heuristic Search techniques
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.
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
CMSC 671 Fall 2001 Class #8 – Thursday, September 27.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
Game Playing (Tic-Tac-Toe), ANDOR graph By Chinmaya, Hanoosh,Rajkumar.
CS 484 – Artificial Intelligence
University College Cork (Ireland) Department of Civil and Environmental Engineering Course: Engineering Artificial Intelligence Dr. Radu Marinescu Lecture.
Adversarial Search: Game Playing Reading: Chapter next time.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
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.
Two-player games overview Computer programs which play 2-player games – –game-playing as search – –with the complication of an opponent General principles.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
Artificial Intelligence in Game Design
All rights reservedL. Manevitz Lecture 31 Artificial Intelligence A/O* and Minimax L. Manevitz.
This time: Outline Game playing The minimax algorithm
November 10, 2009Introduction to Cognitive Science Lecture 17: Game-Playing Algorithms 1 Decision Trees Many classes of problems can be formalized as search.
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)
Find a Path s A D B E C F G Heuristically Informed Methods  Which node do I expand next?  What information can I use to guide this.
MAE 552 – Heuristic Optimization Lecture 28 April 5, 2002 Topic:Chess Programs Utilizing Tree Searches.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Adversarial Search: Game Playing Reading: Chess paper.
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
ICS-270a:Notes 5: 1 Notes 5: Game-Playing ICS 270a Winter 2003.
Ocober 10, 2012Introduction to Artificial Intelligence Lecture 9: Machine Evolution 1 The Alpha-Beta Procedure Example: max.
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.
Minimax.
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.
Instructor: Vincent Conitzer
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.
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.
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.
Game Playing Revision Mini-Max search Alpha-Beta pruning General concerns on games.
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 (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.
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.
Adversarial Search 2 (Game Playing)
Adversarial Search and Game Playing Russell and Norvig: Chapter 6 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
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.
Search: Games & Adversarial Search Artificial Intelligence CMSC January 28, 2003.
Adversarial Search Chapter Two-Agent Games (1) Idealized Setting – The actions of the agents are interleaved. Example – Grid-Space World – Two.
Adversarial Search and Game-Playing
Iterative Deepening A*
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Game Playing in AI by: Gaurav Phapale 05 IT 6010
Artificial Intelligence Chapter 12 Adversarial Search
Chapter 6 : Game Search 게임 탐색 (Adversarial Search)
Kevin Mason Michael Suggs
NIM - a two person game n objects are in one pile
The Alpha-Beta Procedure
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Haskell Tips You can turn any function that takes two inputs into an infix operator: mod 7 3 is the same as 7 `mod` 3 takeWhile returns all initial.
Games & Adversarial Search
Unit II Game Playing.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 1 The Alpha-Beta Procedure Can we estimate the efficiency benefit of the alpha- beta method? Suppose that there is a game that always allows a player to choose among b different moves, and we want to look d moves ahead. Then our search tree has b d leaves. Therefore, if we do not use alpha-beta pruning, we would have to apply the static evaluation function N d = b d times.

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 2 The Alpha-Beta Procedure Of course, the efficiency gain by the alpha-beta method always depends on the rules and the current configuration of the game. However, if we assume that somehow new children of a node are explored in a particular order - those nodes p are explored first that will yield maximum values e(p) at depth d for MAX and minimum values for MIN - the number of nodes to be evaluated is:

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 3 The Alpha-Beta Procedure Therefore, the actual number N d can range from about 2b d/2 (best case) to b d (worst case). This means that in the best case the alpha-beta technique enables us to look ahead almost twice as far as without it in the same amount of time. In order to get close to the best case, we can compute e(p) immediately for every new node that we expand and use this value as an estimate for the Minimax value that the node will receive after expanding its successors until depth d. We can then use these estimates to expand the most likely candidates first (greatest e(p) for MAX, smallest for MIN).

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 4 The Alpha-Beta Procedure Of course, this pre-sorting of nodes requires us to compute the static evaluation function e(p) not only for the leaves of our search tree, but also for all of its inner nodes that we create. However, in most cases, pre-sorting will substantially increase the algorithm’s efficiency. The better our function e(p) captures the actual standing of the game in configuration p, the greater will be the efficiency gain achieved by the pre-sorting method.

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 5 The Alpha-Beta Procedure Even if you do not want to apply e(p) to inner nodes, you should at least do a simple check whether in configuration p one of the players has already won or no more moves are possible. If one of the players has won, this simplified version of e(p) returns the value  or -  if in configuration p the player MAX or MIN, respectively, has won. It returns 0 (draw) if no more moves are possible. This way, no unnecessary - and likely misleading - analysis of impossible future configurations can occur.

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 6 Timing Issues It is very difficult to predict for a given game situation how many operations a depth d look-ahead will require. Since we want the computer to respond within a certain amount of time, it is a good idea to apply the idea of iterative deepening. First, the computer finds the best move according to a one-move look-ahead search. Then, the computer determines the best move for a two-move look-ahead, and remembers it as the new best move. This is continued until the time runs out. Then the currently remembered best move is executed.

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 7 How to Find Static Evaluation Functions Often, a static evaluation function e(p) first computes an appropriate feature vector f(p) that contains information about features of the current game configuration that are important for its evaluation. There is also a weight vector w(p) that indicates the weight (= importance) of each feature for the assessment of the current situation. Then e(p) is simply computed as the dot product of f(p) and w(p). Both the identification of the most relevant features and the correct estimation of their relative importance are crucial for the strength of a game-playing program.

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 8 How to Find Static Evaluation Functions Once we have found suitable features, the weights can be adapted algorithmically. This can be achieved, for example, with an artificial neural network. So the biggest problem consists in extracting the most informative features from a game configuration. Let us look at an example: Chinese Checkers.

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 9 Chinese Checkers Move all your pieces into your opponent’s home area.Move all your pieces into your opponent’s home area. In each move, a piece can either move to a neighboring position or jump over any number of pieces.In each move, a piece can either move to a neighboring position or jump over any number of pieces.

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 10 Chinese Checkers Sample moves for RED (bottom) player:

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 11 Chinese Checkers Idea for important feature: assign positional valuesassign positional values sum values for all pieces of each playersum values for all pieces of each player feature “progress” is difference of sum between playersfeature “progress” is difference of sum between players

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 12 Chinese Checkers Another important feature: For successful play, no piece should be “left behind”For successful play, no piece should be “left behind” Therefore add another feature “coherence”: Difference between the players in terms of the smallest positional value for any of their pieces.Therefore add another feature “coherence”: Difference between the players in terms of the smallest positional value for any of their pieces. Weights used in sample program: 1 for progress1 for progress 2 for coherence2 for coherence

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 13Isola Your biggest programming assignment in this course will be the development of a program playing the game Isola. In order to win the tournament and receive an incredibly valuable prize, you will have to write a static evaluation function that assesses a game configuration accurately and assesses a game configuration accurately and can be computed efficiently. can be computed efficiently.

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 14Isola Rules of Isola: Each of the two players has one piece.Each of the two players has one piece. The board has 7  7 positions which initially contain squares, except for the initial positions of the pieces.The board has 7  7 positions which initially contain squares, except for the initial positions of the pieces. A move consists of two subsequent actions:A move consists of two subsequent actions: –moving one’s piece to a neighboring (horizontally, vertically, or diagonally) field that contains a square but not the opponent’s piece, –removing any square with no piece on it. If a player cannot move any more, he/she loses the game.If a player cannot move any more, he/she loses the game.

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 15Isola Initial Configuration: O X

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 16Isola If in this situation O is to move, then X is the winner: XO If X is to move, he/she can just move left and remove the square between X and O, and also wins the game.

February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 17Isola You can start thinking about an appropriate evaluation function for this game. You may even consider revising the Minimax and alpha-beta search algorithm to reduce the enormous branching factor in the search tree for Isola. We will further discuss the game and the Java interface for the tournament next week.