Computers playing games. One-player games Puzzle: Place 8 queens on a chess board so that no two queens attack each other (i.e. on the same row, same.

Slides:



Advertisements
Similar presentations
Seminar on Game Playing in AI. 1/21/2014University College of Engineering2 Definition…. Game Game playing is a search problem defined by: 1. Initial state.
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.
Games & Adversarial Search
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
CS 484 – Artificial Intelligence
Adversarial Search CSE 473 University of Washington.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
Chess AI’s, How do they work? Math Club 10/03/2011.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
November 10, 2009Introduction to Cognitive Science Lecture 17: Game-Playing Algorithms 1 Decision Trees Many classes of problems can be formalized as search.
Game-Playing Read Chapter 6 Adversarial Search. Game Types Two-person games vs multi-person –chess vs monopoly Perfect Information vs Imperfect –checkers.
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: 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”
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. Introduction Why is game playing so interesting from an AI point of view? –Game Playing is harder then common searching The search space.
Adversarial Search CS30 David Kauchak Spring 2015 Some material borrowed from : Sara Owsley Sood and others.
Game Playing.
Prepared by : Walaa Maqdasawi Razan Jararah Supervised by: Dr. Aladdin Masri.
Mark Dunlop, Computer and Information Sciences, Strathclyde University 1 Algorithms & Complexity 5 Games Mark D Dunlop.
Game-playing AIs Part 1 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part I (this set of slides)  Motivation  Game Trees  Evaluation.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
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.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
CompSci Backtracking, Search, Heuristics l Many problems require an approach similar to solving a maze ä Certain mazes can be solved using the.
CPS Backtracking, Search, Heuristics l Many problems require an approach similar to solving a maze ä Certain mazes can be solved using the “right-hand”
Adversarial Search. Regular Tic Tac Toe Play a few games. –What is the expected outcome –What kinds of moves “guarantee” that?
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!)
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 Types of games Deterministic vs. chance
Adversarial Search and Game-Playing
Adversarial Environments/ Game Playing
Backtracking, Search, Heuristics
Instructor: Vincent Conitzer
Last time: search strategies
Intro to Computer Science II
PENGANTAR INTELIJENSIA BUATAN (64A614)
CS Fall 2016 (Shavlik©), Lecture 11, Week 6
Pengantar Kecerdasan Buatan
Optimizing Minmax Alpha-Beta Pruning Real Time Decisions
Adversarial Search.
David Kauchak CS52 – Spring 2016
Game Playing in AI by: Gaurav Phapale 05 IT 6010
Games & Adversarial Search
Game playing.
Chapter 6 : Game Search 게임 탐색 (Adversarial Search)
Instructor: Vincent Conitzer
Minimax strategies, alpha beta pruning
Game Playing Fifth Lecture 2019/4/11.
Game Playing: Adversarial Search
CSE (c) S. Tanimoto, 2007 Search 2: AlphaBeta Pruning
Game Playing Chapter 5.
Games & Adversarial Search
Backtracking, Search, Heuristics
Minimax strategies, alpha beta pruning
CS51A David Kauchak Spring 2019
CS51A David Kauchak Spring 2019
Backtracking, Search, Heuristics
Games & Adversarial Search
Unit II Game Playing.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Computers playing games

One-player games Puzzle: Place 8 queens on a chess board so that no two queens attack each other (i.e. on the same row, same column, or same diagonal) for i 1  1 to 8 // row of 1st queen for i 2  1 to 8 // row of 2nd queen... for i 8  1 to 8 // row of 8th queen if (isValid(i 1,i 2,...,i 8 )) print i 1,i 2,...,i 8 If we had a n x n board, what would be the running time?

Bactracking algorithm Idea: place queens from first row to last, but stop as soon as an invalid board is reached and backtrack to the last valid board Very similar to depth-first search Algorithm placeQueens(partialBoard[8][8], row) Input: A board with queens placed on rows 0...row-1 Output: Prints all valid configurations that can be reached from this board if (column=8) print partialBoard; else for i = 0 to 8-1 do partialBoard[row][i] = QUEEN; if (isValid(partialBoard)) then placeQueens(partialBoard, row+1) partialBoard[row][i] = EMPTY; // reset board to original position

Backtracking algorithms Only 2057 partial boards are considered Compare to 8 8 = for the original algorithm

Two-player games Computers now beat humans in –backgammon (since 1980) –checkers (since 1994) (U. of Alberta) –chess (since 1997) (Prof. Monty Newborn) –bridge (since 2000 (?)) Human still beat computers in: –Go –Rugby Human-computers are tied in: –3x3 Tic-tac-toe –Rock-paper-scissor (but see

Game trees X's turn O's turn X's turn...

Winning and Losing Positions A winning position for X is a position such that if X plays optimally, X wins even if O plays optimally A losing position for X is a position such that if O plays optimally, X loses even if X play optimally. Recursive definition: On X's move, a position P is winning for X if –P is an immediate win (Leaf of game tree), OR –There exists a move that leads to a winning position for X a position P is losing for X if –P is an immediate loss (Leaf of game tree), OR – ? a position P is a tie if –P is an immediate tie (Leaf of game tree), OR –?

Example

Evaluation functions Game trees are too big to be searched exhaustively! –Chess has positions possible after 40 moves Idea: Look at most K moves ahead. –Tree has height K. Leaves are not final positions –Estimate the potential of the leaves Good position for white: large positive score Good position for black: large negative score Undecided position: score near zero For chess: –1 point per pawn, 3 points for knights and bishops,... Select the move that leads toward the most promising leaf. Start again next turn.

Minimax principle

Algorithm white(board, depth) Input: The current board and the depth of the game tree to explore Output: The value of the current position if (depth=0) then return eval(board) else return max { black(b', depth-1): b' is one move away from board} Algorithm black(board, depth) if (depth=0) return eval(board) else return min { white(', depth-1): b' is one move away from board}