Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.

Slides:



Advertisements
Similar presentations
Adversarial Search Chapter 6 Sections 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
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.
Adversarial Search Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
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.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
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.
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.
1 Adversarial Search Chapter 6 Section 1 – 4 The Master vs Machine: A Video.
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
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.
This time: Outline Game playing The minimax algorithm
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.
How computers play games with you CS161, Spring ‘03 Nathan Sturtevant.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
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.
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.
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.
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.
Adversarial Search CS311 David Kauchak Spring 2013 Some material borrowed from : Sara Owsley Sood and others.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Instructor: Vincent Conitzer
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.
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.
For Wednesday Read chapter 7, sections 1-4 Homework: –Chapter 6, exercise 1.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
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.
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!)
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
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.
Chapter 5 Adversarial Search. 5.1 Games Why Study Game Playing? Games allow us to experiment with easier versions of real-world situations Hostile agents.
Game Playing Why do AI researchers study game playing?
Adversarial Search and Game-Playing
4. Games and adversarial search
PENGANTAR INTELIJENSIA BUATAN (64A614)
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Games & Adversarial Search
Adversarial Search.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
Adversarial Search CS 171/271 (Chapter 6)
Games & Adversarial Search
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College

Why Games? Small number of rules Well-defined knowledge set Easy to evaluate performance Large search spaces (too large for exhaustive search) Fame & Fortune, e.g. ChessChess

Example Games & Best Computer Players (sec. 6.6 w/updates) Chess - Deep Blue (beat Kasparov); Deep Junior (tied Kasparov); Hydra (scheduled to play British champion for 80,000 pounds) Checkers - Chinook (world champion) Go (Goemate, Go4++ rated “weak amateur”) Othello - Iago (world championship level), Logistello (defeated world champion, now retired) Backgammon - TD-Gammon (neural network that learns to play using “reinforcement learning”)

Properties of Games Two-Player Zero-sum –If it’s good for one player, it’s bad for the opponent and vice versa Perfect information –All relevant information is apparent to both players (no hidden cards)

Game as Search Problem –State space search Each potential board or game position is a state Each possible move is an operation Space can be BIG: –large branching factor (chess avg. 35) –deep search for game (chess avg. 50 ply) –Components of any search technique Move generator (successor function) Terminal test (end of game?) Utility function (win, lose or draw?)

Game Tree Root is initial state Next level is all of first player’s moves Next level is all of second player’s moves Example: Tic Tac Toe –Root: 9 blank squares –Level 1: 3 different boards (corner, center and edge X) –Level 2 below center: 2 different boards (corner, edge) –Etc. Utility function: win for X is 1, win for O is -1 –X is Maximizer, O is minimizer

Minimax Strategy Max’s goal: get to 1 Min’s goal: get to -1 Max’s strategy –Choose moves that will lead to a win, even though min is trying to block Minimax value of a node (backed up value): –If N is terminal, use the utility value –If N is a Max move, take max of successors –If N is a Min move, take min of successors

Minimax Values: 2-Ply Example

Minimax Algorithm Depth-first search to bottom of tree As search “unwinds”, compute backed up values Backed-up value of root determines which step to take. Assumes: –Both players are playing this strategy (optimally) –Tree is small enough to search completely

Alpha-Beta Pruning We don’t really have to look at all subtrees! Recognize when a position can never be chosen in minimax no matter what its children are –Max (3, Min(2,x,y) …) is always ≥ 3 –Min (2, Max(3,x,y) …) is always ≤ 2 –We know this without knowing x and y!

Alpha-Beta Pruning Alpha = the value of the best choice we’ve found so far for MAX (highest) Beta = the value of the best choice we’ve found so far for MIN (lowest) When maximizing, cut off values lower than Alpha When minimizing, cut off values greater than Beta

Alpha-Beta Example 53281xx76 23<=1 3

Notes on Alpha-Beta Pruning Effectiveness depends on order of successors (middle vs. last node of 2-ply example) If we can evaluate best successor first, search is O(b d/2 ) instead of O(b d ) This means that in the same amount of time, alpha-beta search can search twice as deep!

Optimizing Minimax Search Use alpha-beta cutoffs –Evaluate most promising moves first Remember prior positions, reuse their backed-up values –Transposition table (like closed list in A*) Avoid generating equivalent states (e.g. 4 different first corner moves in tic tac toe) But, we still can’t search a game like chess to the end!

When you can’t search to the end Replace terminal test (end of game) by cutoff test (don’t search deeper) Replace utility function (win/lose/draw) by heuristic evaluation function that estimates results on the best path below this board –Like A* search, good evaluation functions mean good results (and vice versa) Replace move generator by plausible move generator (don’t consider “dumb” moves)

Good evaluation functions… Order terminal states in the same order as the utility function Don’t take too long (we want to search as deep as possible in limited time) Should be as accurate as possible (estimate chances of winning from that position…) –Human knowledge (e.g. material value) –Known solution (e.g. endgame) –Pre-searched examples (take features, average value of endgame of all games with that feature)

How Deep to Search? Until time runs out (the original application of Iterative Deepening!) Until values don’t seem to change (quiescence) Deep enough to avoid horizon effect (delaying tactic to delay the inevitable beyond the depth of the search) Singular extensions - search best (apparent) paths deeper than others –Tends to limit horizon effect, since these are the moves that will exhibit it