1 Computer Group Engineering Department University of Science and Culture S. H. Davarpanah

Slides:



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

Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
For Friday Finish chapter 5 Program 1, Milestone 1 due.
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Games & Adversarial Search
For Monday Read chapter 7, sections 1-4 Homework: –Chapter 4, exercise 1 –Chapter 5, exercise 9.
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.
1 CSC 550: Introduction to Artificial Intelligence Fall 2008 search in game playing  zero-sum games  game trees, minimax principle  alpha-beta pruning.
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.
1 Game Playing. 2 Outline Perfect Play Resource Limits Alpha-Beta pruning Games of Chance.
Adversarial Search: Game Playing Reading: Chapter next time.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Adversarial Search CSE 473 University of Washington.
MINIMAX SEARCH AND ALPHA- BETA PRUNING: PLAYER 1 VS. PLAYER 2.
Adversarial Search 對抗搜尋. Outline  Optimal decisions  α-β pruning  Imperfect, real-time decisions.
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Adversarial Search Board games. Games 2 player zero-sum games Utility values at end of game – equal and opposite Games that are easy to represent Chess.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
This time: Outline Game playing The minimax algorithm
Lecture 02 – Part C Game Playing: Adversarial Search
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.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Game Tree Search based on Russ Greiner and Jean-Claude Latombe’s notes.
Adversarial Search and Game Playing Examples. Game Tree MAX’s play  MIN’s play  Terminal state (win for MAX)  Here, symmetries have been used to reduce.
Adversarial Search: Game Playing Reading: Chess paper.
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
CHAPTER 6 : 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.
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 6 Adversarial Search. Adversarial Search Problem Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test.
Adversarial Search CS311 David Kauchak Spring 2013 Some material borrowed from : Sara Owsley Sood and others.
Games Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew Moore,
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.
For Wednesday Read chapter 7, sections 1-4 Homework: –Chapter 6, exercise 1.
Quiz 4 : Minimax Minimax is a paranoid algorithm. True
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
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-playing AIs Part 2 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part II  The Minimax Rule  Alpha-Beta Pruning  Game-playing.
Game Playing: Adversarial Search chapter 5. Game Playing: Adversarial Search  Introduction  So far, in problem solving, single agent search  The machine.
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!)
Adversarial Search In this lecture, we introduce a new search scenario: game playing 1.two players, 2.zero-sum game, (win-lose, lose-win, draw) 3.perfect.
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.
Adversarial Search and Game-Playing
Instructor: Vincent Conitzer
PENGANTAR INTELIJENSIA BUATAN (64A614)
Instructor: Vincent Conitzer
Minimax strategies, alpha beta pruning
Instructor: Vincent Conitzer
Based on slides by: Rob Powers Ian Gent
Minimax strategies, alpha beta pruning
Presentation transcript:

1 Computer Group Engineering Department University of Science and Culture S. H. Davarpanah

Game playing Rich tradition of creating game-playing programs in AI Many similarities to search Most of the games studied – have two players, – are zero-sum: what one player wins, the other loses – have perfect information: the entire state of the game is known to both players at all times E.g., tic-tac-toe, checkers, chess, Go, backgammon, … Will focus on these for now Recently more interest in other games – Esp. games without perfect information; e.g., poker Need probability theory, game theory for such games

“Sum to 2” game Player 1 moves, then player 2, finally player 1 again Move = 0 or 1 Player 1 wins if and only if all moves together sum to 2 Player 1 Player 2 Player 1 Player Player 1’s utility is in the leaves; player 2’s utility is the negative of this

Modified game From leaves upward, analyze best decision for player at node, give node a value Player 1 Player 2 Player 1 Player

A recursive implementation Value(state) If state is terminal, return its value If (player(state) = player 1) – v := -infinity – For each action v := max(v, Value(successor(state, action))) – Return v Else – v := infinity – For each action v := min(v, Value(successor(state, action))) – Return v Space? Time?

Search in Games Consider tic-tac-toe as a search problem. States, neighbors, goal? X O X O X O

7 An exemplary game: Tic-tac-toe Adversarial (game) tree search

8 Why do we consider: - only 3 nodes on the second level (instead of 9)? - only 2 nodes on the third level (instead of 8)?

9 The minimax procedure

10 Example

11 Solution: Example

Alpha-beta pruning Pruning = cutting off parts of the search tree (because you realize you don’t need to look at them) – When we considered A* we also pruned large parts of the search tree Maintain alpha = value of the best option for player 1 along the path so far Beta = value of the best option for player 2 along the path so far

13 Alpha represents a lower bound for the achievement of the Max player at a given node A BC D E Max Min Max f(B) = 15 f(D) = 10 f(C)  10  = 15  Alpha-beta pruning: Alpha cutoff This branch guarantees that Max will achieve at least 15 Max will not need to investigate branches with values lower than 15 because it will not move there.  

14 Beta represents an upper bound for the achievement of the Max player at a given node. A B F G Max Min Max f(F) = 15 H I Min ≥ f(H) =  = 15  f(G) Beta cutoff This branch guarantees that Max will achieve at most 15 Max will not need to investigate branches with values greater than 15 because Min will not move there.  

15 Consider the following game tree: a) Use the mini-max procedure and show what moves should be chosen by the two players. b) Use the alpha-beta pruning procedure and show what nodes would not need to be examined. c) Consider the mirror image of the above tree and apply again the alpha-beta pruning procedure. What do you notice? Exercise

16 a) Use the mini-max procedure and show what moves should be chosen by the two players. Exercise: Solution

17 b) Use the alpha-beta pruning procedure and show what nodes would not need to be examined. Exercise: Solution      

18 c) Consider the mirror image of the above tree and apply again the alpha-beta pruning procedure. What do you notice? Exercise: Solution 

Benefits of alpha-beta pruning Without pruning, need to examine O(b m ) nodes With pruning, depends on which nodes we consider first If we choose a random successor, need to examine O(b 3m/4 ) nodes If we manage to choose the best successor first, need to examine O(b m/2 ) nodes – Practical heuristics for choosing next successor to consider get quite close to this Can effectively look twice as deep! – Difference between reasonable and expert play

Many-player, general-sum games of perfect information Basic backward induction still works – No longer called minimax Player 1 Player 2 Player (1,2,3) (3,4,2) (1,2,3) vector of numbers gives each player’s utility What if other players do not play this way?

Games with random moves by “Nature” E.g., games with dice (Nature chooses dice roll) Backward induction still works… – Evaluation functions now need to be cardinally right (not just ordinally) – For two-player zero-sum games with random moves, can we generalize alpha- beta? How? Player 1 Nature Player 2 50% % % 50% (1,3) (3,2) (1,3) (3,4)(1,2) (3,4) (2,3.5)