A DVERSARIAL S EARCH & G AME P LAYING. 2 3 T EXAS H OLD ‘E M P OKER 2 cards per player, face down 5 community cards dealt incrementally Winner has best.

Slides:



Advertisements
Similar presentations
Game playing.
Advertisements

Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
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.
Game playing. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
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.
CMSC 671 Fall 2001 Class #8 – Thursday, September 27.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
CS 484 – Artificial Intelligence
Adversarial Search Chapter 6 Section 1 – 4.
University College Cork (Ireland) Department of Civil and Environmental Engineering Course: Engineering Artificial Intelligence Dr. Radu Marinescu Lecture.
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: Game Playing Reading: Chapter next time.
Adversarial Search CSE 473 University of Washington.
Adversarial Search Chapter 6.
Artificial Intelligence for Games Game playing Patrick Olivier
An Introduction to Artificial Intelligence Lecture VI: Adversarial Search (Games) Ramin Halavati In which we examine problems.
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.
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
Game Playing CSC361 AI CSC361: Game Playing.
Games and adversarial search
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Ch.6: Adversarial Search Fall 2008 Marco Valtorta.
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
How computers play games with you CS161, Spring ‘03 Nathan Sturtevant.
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”
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
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
Game Playing: Adversarial Search Dr. Yousef Al-Ohali Computer Science Depart. CCIS – King Saud University Saudi Arabia
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.
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.
Game Playing. Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers.
Adversarial Search; Heuristics in Games Foundations of Artificial Intelligence.
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.
Games 1 Alpha-Beta Example [-∞, +∞] Range of possible values Do DF-search until first leaf.
Adversarial Search Chapter 6 Section 1 – 4. Search in an Adversarial Environment Iterative deepening and A* useful for single-agent search problems What.
CSE373: Data Structures & Algorithms Lecture 23: Intro to Artificial Intelligence and Game Theory Based on slides adapted Luke Zettlemoyer, Dan Klein,
Artificial Intelligence
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Adversarial Search Adversarial Search (game playing search) We have experience in search where we assume that we are the only intelligent being and we.
Game Playing Chapter 6 Some material adopted from notes by Charles R. Dyer, University of Wisconsin-Madison.
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Offer an opportunity to study problems involving {hostile,
Adversarial Search and Game Playing Russell and Norvig: Chapter 6 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
Adversarial Search and Game Playing Russell and Norvig: Chapter 5 Russell and Norvig: Chapter 6 CS121 – Winter 2003.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Adversarial Search and Game Playing. Topics Game playing Game trees Minimax Alpha-beta pruning Examples.
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.
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.
4. Games and adversarial search
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
PENGANTAR INTELIJENSIA BUATAN (64A614)
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Game Playing: Adversarial Search
Adversarial Search and Game Playing
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
Adversarial Search CS 171/271 (Chapter 6)
Presentation transcript:

A DVERSARIAL S EARCH & G AME P LAYING

2

3 T EXAS H OLD ‘E M P OKER 2 cards per player, face down 5 community cards dealt incrementally Winner has best 5- card poker hand 4 betting rounds: 0 cards dealt 3 cards dealt 4 th card 5 th card Uncertainty about future cards dealt Uncertainty about other players’ cards

T HE R EAL W ORLD AND ITS R EPRESENTATION 4 Real world Agent’s conceptualization (  representation language) 8-puzzle 3x3 matrix filled with 1, 2,.., 8, and ‘empty’

T HE R EAL W ORLD AND ITS R EPRESENTATION 5 Real world Agent’s conceptualization (  representation language) Robot navigating among moving obstacles Geometric models and equations of motion

T HE R EAL W ORLD AND ITS R EPRESENTATION 6 Real world Agent’s conceptualization (  representation language) Actual cards Emotions Subconscious cues Seen cards Chip counts History of past bets

7

W HO PROVIDES THE REPRESENTATION LANGUAGE ? The agent’s designer As of today, no practical techniques exist allowing an agent to autonomously abstract features of the real world into useful concepts and develop its own representation language using these concepts The issues discussed in the following slides arise whether the representation language is provided by the agent’s designer or developed over time by the agent 8

F IRST S OURCE OF U NCERTAINTY : I MPERFECT P REDICTIONS There are many more states of the real world than can be expressed in the representation language So, any state represented in the language may correspond to many different states of the real world, which the agent can’t represent distinguishably The language may lead to incorrect predictions about future states 9 A BC A BC A BC On(A,B)  On(B,Table)  On(C,Table)  Clear(A)  Clear(C)

N ONDETERMINISTIC S EARCH IN G AME P LAYING In game playing, an adversary can choose outcomes of the agent’s moves Instead of a single path, the agent must construct plans for all possible outcomes MAX’s play MAX must decide what to play for BOTH these outcomes MIN’s play

G AME P LAYING Games like Chess or Go are compact settings that mimic the uncertainty of interacting with the natural world For centuries humans have used them to exert their intelligence Recently, there has been great success in building game programs that challenge human supremacy

S PECIFIC S ETTING T WO - PLAYER, TURN - TAKING, DETERMINISTIC, FULLY OBSERVABLE, ZERO - SUM, TIME - CONSTRAINED GAME State space Initial state Successor function: it tells which actions can be executed in each state and gives the successor state for each action MAX’s and MIN’s actions alternate, with MAX playing first in the initial state Terminal test: it tells if a state is terminal and, if yes, if it’s a win or a loss for MAX, or a draw All states are fully observable

N ONDETERMINISM Uncertainty is caused by the actions of another agent (MIN), who competes with our agent (MAX) MIN wants MAX to lose (and vice versa) No plan exists that guarantees MAX’s success regardless of which actions MIN executes (the same is true for MIN) At each turn, the choice of which action to perform must be made within a specified time limit

G AME T REE MAX’s play  MIN’s play  Terminal state (win for MAX)  Here, symmetries have been used to reduce the branching factor MIN nodes MAX nodes

G AME T REE MAX’s play  MIN’s play  Terminal state (win for MAX)  In general, the branching factor and the depth of terminal states are large Chess: Number of states: ~10 40 Branching factor: ~35 Number of total moves in a game: ~100

C HOOSING AN A CTION : B ASIC I DEA 1. Using the current state as the initial state, build the game tree uniformly to the leaf nodes 2. Evaluate whether leaf nodes are wins (+1), losses (-1), or draws (0) 3. Back up the results from the leaves to the root and pick the best action assuming the worst from MIN  Minimax algorithm

M INIMAX B ACKUP MIN’s turn MAX’s turn +1 0 MAX’s turn 0

M INIMAX B ACKUP MIN’s turn MAX’s turn +1 0 MAX’s turn

M INIMAX B ACKUP MIN’s turn MAX’s turn +1 0 MAX’s turn

M INIMAX B ACKUP MIN’s turn MAX’s turn +1 0 MAX’s turn

M INIMAX A LGORITHM Expand the game tree from the current state (where it is MAX’s turn to play) Evaluate whether every leaf of the tree is a win (+1), lose (-1), or draw (0) Back-up the values from the leaves to the root of the tree as follows: A MAX node gets the maximum of the evaluation of its successors A MIN node gets the minimum of the evaluation of its successors Select the move toward a MIN node that has the largest backed-up value

R EAL -T IME DECISIONS The state space is enormous: only a tiny fraction of this space can be explored within the time limit (3min for chess) 1. Using the current state as the initial state, build the game tree uniformly to the maximal depth h (called horizon) feasible within the time limit 2. Evaluate the states of the leaf nodes 3. Back up the results from the leaves to the root and pick the best action assuming the worst from MIN

E VALUATION F UNCTION Function e: state s  number e(s) e(s) is a heuristic that estimates how favorable s is for MAX e(s) > 0 means that s is favorable to MAX (the larger the better) e(s) < 0 means that s is favorable to MIN e(s) = 0 means that s is neutral

E XAMPLE : T IC - TAC -T OE e(s) =number of rows, columns, and diagonals open for MAX  number of rows, columns, and diagonals open for MIN 8  8 = 06  4 = 2 3  3 = 0

C ONSTRUCTION OF AN E VALUATION F UNCTION Usually a weighted sum of “features”: Features may include Number of pieces of each type Number of possible moves Number of squares controlled

B ACKING UP V ALUES 6-5=1 5-6=-15-5=0 6-5=15-5=14-5=-1 5-6=-1 6-4=25-4=1 6-6=04-6= Tic-Tac-Toe tree at horizon = 2 Best move

C ONTINUATION

W HY USING BACKED - UP VALUES ? At each non-leaf node N, the backed-up value is the value of the best state that MAX can reach at depth h if MIN plays well (by the same criterion as MAX applies to itself) If e is to be trusted in the first place, then the backed-up value is a better estimate of how favorable STATE(N) is than e(STATE(N))

M INIMAX A LGORITHM Expand the game tree uniformly from the current state (where it is MAX’s turn to play) to depth h Compute the evaluation function at every leaf of the tree Back-up the values from the leaves to the root of the tree as follows: A MAX node gets the maximum of the evaluation of its successors A MIN node gets the minimum of the evaluation of its successors Select the move toward a MIN node that has the largest backed-up value

M INIMAX A LGORITHM Expand the game tree uniformly from the current state (where it is MAX’s turn to play) to depth h Compute the evaluation function at every leaf of the tree Back-up the values from the leaves to the root of the tree as follows: A MAX node gets the maximum of the evaluation of its successors A MIN node gets the minimum of the evaluation of its successors Select the move toward a MIN node that has the largest backed-up value Horizon: Needed to return a decision within allowed time

G AME P LAYING ( FOR MAX) Repeat until a terminal state is reached 1. Select move using Minimax 2. Execute move 3. Observe MIN’s move Note that at each cycle the large game tree built to horizon h is used to select only one move All is repeated again at the next cycle (a sub-tree of depth h-2 can be re-used)

P ROPERTIES OF M INIMAX Complete? Optimal? Time complexity? Space complexity?

P ROPERTIES OF M INIMAX Complete? Yes, if tree is finite Optimal? Yes, against optimal opponent. Otherwise…? Time complexity? O(b h ) Space complexity? O(bh) For chess, b=35: hbhbh x x x10 23 Good Master

C AN WE DO BETTER ? Yes ! Much better ! 3  Pruning  -1  3 3 This part of the tree can’t have any effect on the value that will be backed up to the root

S TATE - OF - THE -A RT

C HECKERS : T INSLEY VS. C HINOOK Name: Marion Tinsley Profession:Teach mathematics Hobby: Checkers Record: Over 42 years loses only 3 games of checkers World champion for over 40 years Mr. Tinsley suffered his 4th and 5th losses against Chinook

C HINOOK First computer to become official world champion of Checkers!

C HESS : K ASPAROV VS. D EEP B LUE Kasparov 5’10” 176 lbs 34 years 50 billion neurons 2 pos/sec Extensive Electrical/chemical Enormous Height Weight Age Computers Speed Knowledge Power Source Ego Deep Blue 6’ 5” 2,400 lbs 4 years 32 RISC processors VLSI chess engines 200,000,000 pos/sec Primitive Electrical None Jonathan Schaeffer 1997: Deep Blue wins by 3 wins, 1 loss, and 2 draws

C HESS : K ASPAROV VS. D EEP J UNIOR August 2, 2003: Match ends in a 3/3 tie! Deep Junior 8 CPU, 8 GB RAM, Win ,000,000 pos/sec Available at $100

O THELLO : M URAKAMI VS. L OGISTELLO Takeshi Murakami World Othello Champion 1997: The Logistello software crushed Murakami by 6 games to 0

S ECRETS Many game programs are based on alpha-beta pruning + iterative deepening + extended/singular search + transposition tables + huge databases +... For instance, Chinook searched all checkers configurations with 8 pieces or less and created an endgame database of 444 billion board configurations The methods are general, but their implementation is dramatically improved by many specifically tuned-up enhancements (e.g., the evaluation functions) like an F1 racing car

G O : G OEMATE VS. ?? Name: Chen Zhixing Profession: Retired Computer skills: self-taught programmer Author of Goemate, winner of 1994 Computer Go Competition Gave Goemate a 9 stone handicap and still easily beat the program, thereby winning $15,000 Jonathan Schaeffer

G O : G OEMATE VS. ?? Name: Chen Zhixing Profession: Retired Computer skills: self-taught programmer Author of Goemate (arguably the strongest Go programs) Gave Goemate a 9 stone handicap and still easily beat the program, thereby winning $15,000 Jonathan Schaeffer Go has too high a branching factor for existing search techniques

R ECENT D EVELOPMENTS Modern Go programs perform at high amateur level Can beat pros, given a moderate handicap Not actually a pattern recognition solution, as once previously thought: better search techniques

P ERSPECTIVE ON G AMES : C ON AND P RO Chess is the Drosophila of artificial intelligence. However, computer chess has developed much as genetics might have if the geneticists had concentrated their efforts starting in 1910 on breeding racing Drosophila. We would have some science, but mainly we would have very fast fruit flies. John McCarthy Saying Deep Blue doesn’t really think about chess is like saying an airplane doesn't really fly because it doesn't flap its wings. Drew McDermott

O THER T YPES OF G AMES Multi-player games, with alliances or not Games with randomness in successor function (e.g., rolling a dice)  Expectminimax algorithm Games with partially observable states (e.g., card games)  Search over belief states

N EXT C LASS Alpha-beta pruning Games of chance Partial observability R&N

P ROJECT P ROPOSAL (O PTIONAL ) Mandatory : instructor’s advance approval Project title, team members ~1 page description Specific topic (problem you are trying to solve, topic of survey, etc) Why did you choose this topic? Methods (researched in advance, sources of references) Expected results to me by 9/20