Artificial Intelligence

Slides:



Advertisements
Similar presentations
Chapter 6, Sec Adversarial Search.
Advertisements

Adversarial Search Chapter 6 Sections 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
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.
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4. Warm Up Let’s play some games!
CS 484 – Artificial Intelligence
Adversarial Search Chapter 6 Section 1 – 4.
Adversarial Search Chapter 5.
COMP-4640: Intelligent & Interactive Systems Game Playing A game can be formally defined as a search problem with: -An initial state -a set of operators.
Adversarial Search CSE 473 University of Washington.
Adversarial Search Chapter 6.
Artificial Intelligence for Games Game playing Patrick Olivier
Adversarial Search 對抗搜尋. Outline  Optimal decisions  α-β pruning  Imperfect, real-time decisions.
An Introduction to Artificial Intelligence Lecture VI: Adversarial Search (Games) Ramin Halavati In which we examine problems.
1 Adversarial Search Chapter 6 Section 1 – 4 The Master vs Machine: A Video.
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
EIE426-AICV 1 Game Playing Filename: eie426-game-playing-0809.ppt.
G51IAI Introduction to AI Minmax and Alpha Beta Pruning Garry Kasparov and Deep Blue. © 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.
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.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.6: Adversarial Search Fall 2008 Marco Valtorta.
Adversarial Search: Game Playing Reading: Chess paper.
double AlphaBeta(state, depth, alpha, beta) begin if depth
Games & Adversarial Search Chapter 6 Section 1 – 4.
Game Playing State-of-the-Art  Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in Used an endgame database defining.
CSC 412: AI Adversarial Search
CHAPTER 6 : ADVERSARIAL SEARCH
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
Game Playing.
1 Game Playing Why do AI researchers study game playing? 1.It’s a good reasoning problem, formal and nontrivial. 2.Direct comparison with humans and other.
Games as Game Theory Systems (Ch. 19). Game Theory It is not a theoretical approach to games Game theory is the mathematical study of decision making.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 6 –Adversarial Search Thursday –AIMA, Ch. 6 –More Adversarial Search The “Luke.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
1 Adversarial Search CS 171/271 (Chapter 6) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Adversarial Search Chapter 6 Section 1 – 4. Search in an Adversarial Environment Iterative deepening and A* useful for single-agent search problems What.
CHAPTER 4 PROBABILITY THEORY SEARCH FOR GAMES. Representing Knowledge.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
CSE373: Data Structures & Algorithms Lecture 23: Intro to Artificial Intelligence and Game Theory Based on slides adapted Luke Zettlemoyer, Dan Klein,
Paula Matuszek, CSC 8520, Fall Based in part on aima.eecs.berkeley.edu/slides-ppt 1 CS 8520: Artificial Intelligence Adversarial Search Paula Matuszek.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
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!)
Adversarial Search Chapter 5 Sections 1 – 4. AI & Expert Systems© Dr. Khalid Kaabneh, AAU Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
ADVERSARIAL SEARCH Chapter 6 Section 1 – 4. OUTLINE Optimal decisions α-β pruning Imperfect, real-time decisions.
Understanding AI of 2 Player Games. Motivation Not much experience in AI (first AI project) and no specific interests/passion that I wanted to explore.
Adversarial Search CMPT 463. When: Tuesday, April 5 3:30PM Where: RLC 105 Team based: one, two or three people per team Languages: Python, C++ and Java.
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.
5/4/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 9, 5/4/2005 University of Washington, Department of Electrical Engineering Spring 2005.
Game Playing Why do AI researchers study game playing?
EA C461 – Artificial Intelligence Adversarial Search
PENGANTAR INTELIJENSIA BUATAN (64A614)
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Adversarial Search Chapter 5.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search.
Games & Adversarial Search
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
Adversarial Search CS 171/271 (Chapter 6)
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4.
Presentation transcript:

Artificial Intelligence Game Playing Chapter 6

Outline of this Chapter Introduction Defining a game 2 person games Minimax α-β pruning State of the art Game programs

Introduction Game playing is one of the oldest area in AI. In 1950, the first chess programs were written by C.Shannon & A.Turing. IBM's Deep Blue Supercomputer defeats the chess grandmaster Kasparov in 1997 Last weeks, we looked at: search problems where the situation is not going to change (e.g., if we are searching for a route between two towns, the towns do not move during the search). In game playing. If we make a move in Board Games such as chess then our opponent is going to move next, so we cannot be certain what the board state will be after our opponents moves. Not all games are suitable for AI research. We will restrict ourselves to 2 person perfect information board games.

Definition Playing a game involves searching for the best move. Game can be defined as a type of search problem with the following components: Players: We call them Max and Min. Initial state- how the board is set up Operators- define legal moves that a player can make Terminal state- when the game is over Utility/payoff function- A function which assigns a numeric value for the outcome of a game (e.g. in chess the outcome is win (+1), lose (-1) or draw (0). Note that by convention, we always measure utility relative to Max. Two strategies have been defined: Minimax algorithm (by John von Neumann in 1944) Alpha-Beta algorithm

Two-Person Games Two-player games with perfect information (player knows everything about the possible moves of the adversary), the minimax can determine the best move for a player by enumerating the entire game tree. Player 1 is called Max Maximizes result Player 2 is called Min Minimizes opponent’s result

A Search Tree for Noughts and Crosses Game MAX’s job to use the search tree to determine the best move. Simple game – too complex to show/draw the whole search tree.

Minimax Steps Minimax examines the entire generated game tree, and picks the best path that can be forced. The minimax algorithm consists of 5 steps Generate the whole game tree. 2. Apply the utility function to leaf nodes to get their values. 3. Use the utility of nodes at level n to determine the utility of nodes at level n-1 in the search tree. 4. Continue backing up values towards the root, one layer at a time. 5. Eventually the backed up values reach the top of the tree, at that point Max chooses the move that leads to the highest value. This is called the minimax decision because it maximises the utility under the assumption that Min will play perfectly to minimise it.

Minimax (2-ply game) Perfect play for deterministic games, perfect-information games Terminal nodes show the utility value for MAX computed by the utility function (i.e. by the rules of the game). Other nodes labeled with their minimax values MAX prefers to move to a state of maximum value MIN prefers a state of minimum value The values have been propagated back up through the tree based on whose turn it is to play and whether they are trying to maximise or minimise.

Properties of minimax (d= depth of the tree, b=legal moves) It is Complete (if tree is finite) It is Optimal (against an optimal opponent) Time Complexity: bd Space Complexity: b*d (d= depth of the tree, b=legal moves) Complexity: many games have a huge search space For chess: b = 35 legal moves in any given position, d=100 for "reasonable" games  nodes = 35 100 positions are searched Do we need to explore every path?

The Need for Imperfect Decision Problem: The problem with minimax is that we expand every node down to a certain depth even though, in certain cases we are wasting our timenot practical for games of any size game-playing programs must meet external time-constraints. we cannot calculate the entire game tree in order to find out the terminal values so that we can propagate them back up through the tree.

The Need for Imperfect Decision (cont.) Solution: Instead of going all the way to terminal states & using utility function. Cut off search earlier and apply a heuristic evaluation function to the leaves of the tree. Note In search problems where we are searching for a goal our heuristic value represents an estimate as to how close we are to the goal. In game playing we are estimating the chances of winning from a given position.

α-β pruning A technique that enables the Minimax algorithm to ignore branches that will not contribute further to the outcome of the search. The process of eliminating a branch of the search tree is called pruning the search tree. Alpha-beta pruning uses a depth first search. In doing so it maintains two variables α and β (α is associated with MAX can never decrease and β is associated with MIN can never increase). when applied to standard minimax tree, it returns the same move as minimax would but prunes away branches that cannot possibly influence the final decision.

α-β pruning example

α-β pruning example

α-β pruning example

α-β pruning example

α-β pruning example

State of the Art in Chess Chess has received by far the largest share of attention in game playing. 1957: Herbert Simon predicted that within 10 years computers would beat the human world champion. In 1958, the first computer able to play chess was an IBM 704. 1970: First program to win ACM North American Computer Chess Championship, it uses straightforward alpha-beta search, augmented with book openings and infallible end game algorithms. 1982: Belle, first special-purpose chess hardware, built by Condon & Thompson at Bell Labs , can search few million of position per move.

State of the Art in Chess (Cont.) 1985: HITECH system can search 10 million of position per move , ranked among the top 800 human players around the world. 1993: Deep Thought 2, ranked top 100 human players, can search 500 million of position per move, reaching a depth of 11. 1997: Deep Blue defeated human world champion Garry Kasparov in a six-game match in 1997. Deep Blue searches 200 million positions per second, uses very sophisticated evaluation, and undisclosed methods for extending some lines of search up to 40 ply.

State of the Art in Checkers 1952: Arthur Samuel developed a checkers program that learn its own evaluation function through self play. 1992: Chinook (J. Schaeffer) wins the U.S. Open. At the world championship, Alpha-beta search were used, but Marion Tinsley beat Chinook. 1994:Chinook ended 40-year-reign of human world champion Marion Tinsley. Used a precomputed endgame database defining perfect play for all positions involving 8 or fewer pieces on the board, a total of 444 billion positions.-- Chinook become the world champion.

State of the Art in Go Go is the most popular board game in Asia. Aim By placing the stones on the board, each player tries to win the game by surrounding unoccupied territory as well as enemy stones. Surround more than your opponent and you win! The branching factor approaches 360, infeasible for regular search methods. Go seems like an area likely to benefit from intensive research using sophisticated reasoning methods. Most programs use pattern knowledge bases to suggest plausible moves.

Summary Games are fun to work on They illustrate several important points about AI perfection is unattainable  must approximate with perfect information, the minimax can determine the best move for a player by enumerating the entire game tree. The α-β algorithm does the same calculation as minimax, but is more efficient – prunes away irrelevant branches of the search tree

End of Chapter 6