CS 484 – 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.
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.
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!
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
CMSC 671 Fall 2001 Class #8 – Thursday, September 27.
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.
1 Game Playing. 2 Outline Perfect Play Resource Limits Alpha-Beta pruning Games of Chance.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Adversarial Search CSE 473 University of Washington.
Hoe schaakt een computer? Arnold Meijster. Why study games? Fun Historically major subject in AI Interesting subject of study because they are hard Games.
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.
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.
This time: Outline Game playing The minimax algorithm
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.
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.
PSU CS 370 – Introduction to Artificial Intelligence Game MinMax Alpha-Beta.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Lecture 5 Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
Game Playing.
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.
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.
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.
Instructor: Vincent Conitzer
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.
GAME PLAYING 1. There were two reasons that games appeared to be a good domain in which to explore machine intelligence: 1.They provide a structured task.
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 Adversarial Search (game playing search) We have experience in search where we assume that we are the only intelligent being and we.
Adversarial Search Chapter 6 Section 1 – 4. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time.
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.
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
EA C461 – Artificial Intelligence Adversarial Search
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Pengantar Kecerdasan Buatan
Games & Adversarial Search
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
Adversarial Search Chapter 6 Section 1 – 4.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

CS 484 – Artificial Intelligence Announcements Lab 1 is due today, September 20 Homework 3 due Tuesday, September 25 Current Event Volunteer? CS 484 – Artificial Intelligence

Game Playing Lecture 7

CS 484 – Artificial Intelligence Kinds of Games Deterministic Turn-taking 2-player Zero-sum Perfect information a move always has the same result zero-sum – one player wins and the other must loose (or tie) perfect information – all information available to players (unlike cards) games are interesting because they are too hard to solve chess: branching factor 35 and there will be about 50 moves (need to make some decisions) inefficiency is plenalized CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Game as Search Problem Initial State: board position and player to move Successor Function: returns a list of legal (move, state) pairs Terminal Test: determines when the game is over Utility function: Gives a numeric value for the terminal state chess utility = +1, 0, -1 backgammon utility = -192 to +192 CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Game Trees Game trees are used to represent two-player games. Alternate moves in the game are represented by alternate levels in the tree (plies). Nodes in the tree represent positions. Edges between nodes represent moves. Leaf nodes represent won, lost or drawn positions. CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Game Trees This is an example of a partial game tree for the game tic-tac-toe. Even for this simple game, the game tree is very large. CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Assumptions In talking about game playing systems, we make a number of assumptions: The opponent is rational – will play to win. The game is zero-sum – if one player wins, the other loses. Usually, the two players have complete knowledge of the game. For games such as poker, this is clearly not true. deterministic, turn-taking, two-player, zero-sum games or perfect information CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Minimax Minimax is a method used to evaluate game trees. A static evaluator is applied to leaf nodes, and values are passed back up the tree to determine the best score the computer can obtain against a rational opponent. CS 484 – Artificial Intelligence

Minimax – Animated Example 3 6 The computer can obtain 6 by choosing the right hand edge from the first node. Max 5 1 3 6 2 7 6 Min 5 3 1 3 7 Max 6 5 CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Minimax Function MINIMAX-VALUE(n) = UTILITY(n) if n is a terminal state maxs  Successors(n) MINIMAX-VALUE(s) if n is a MAX node mins  Successors(n) MINIMAX-VALUE(s) if n is a MIN node minimax performs complete depth-first search of tree O(b^m) where max depth of tree = m and b legal moves at each point for real games this time cost is totally impractical CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Searching Game Trees Exhaustively searching a game tree is not usually a good idea. Even for a game as simple as tic-tac-toe there are over 350,000 nodes in the complete game tree. An additional problem is that the computer only gets to choose every other path through the tree – the opponent chooses the others. CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Alpha-beta Pruning A method that can often cut off a half the game tree. Based on the idea that if a move is clearly bad, there is no need to follow the consequences of it. alpha – highest value we have found so far beta – lowest value we have found so far CS 484 – Artificial Intelligence

Alpha-beta Pruning – Example. max In this tree, having examined the nodes with values 7 and 1 there is no need to examine the final node. 3 min optimal time – O(b^(m/2)) instead of O(b^m) branching factor goes from b to sqrt(b) order of nodes matters random order: O(b^(3m/4)) chess: order (capture first, then threats, then forward moves, then backward moves) gets within factor of 2 of best case adding dynamic ordering – try moves that were best last time brings close to theoretical limit CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Bounded Lookahead For trees with high depth or very high branching factor, minimax cannot be applied to the entire tree. In such cases, bounded lookahead is applied: search is cut off at specified depth static evaluator applied. Horizon effect Must be applied carefully: In some positions a static evaluator will not take into account significant changes that are about to happen. CS 484 – Artificial Intelligence

Static Evaluation Functions A static evaluator assigns a score to a position: High positive = computer is winning Zero = even game High negative = opponent is winning It is most important that a static evaluator will give a better score to a better position – the actual values are not so important. Since game trees are too large to be fully searched, it is important to have a function to statically evaluate a given position in the game. CS 484 – Artificial Intelligence

Creating Evaluation Function How likely are you to win from a given position? Usually weighted linear functions Different scores are given to different position and added together in a weighted fashion Possible chess function score = 9q + 5r + 3b + 3n + p q = # of queens, r = # of rooks, b = # of bishops, n = # of knights, and p = # of pawns CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Checkers In 1959, Arthur Samuel creates a computer program that could play checkers to a high level using minimax and alpha-beta pruning. Chinook, developed in Canada defeated the world champion: Uses alpha-beta pruning. Has a database of millions of end games. Also has a database of openings. Uses heuristics and knowledge about the game. CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Chess In 1997, Deep Blue defeated world champion, Garry Kasparov. This has not yet been repeated. Current systems use parallel search, alpha-beta pruning, databases of openings and heuristics. The deeper in a search tree the computer can search, the better it plays. CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Go Go is a complex game played on a 19x19 board. Average branching factor in search tree around 360 (compared to 38 for chess). The best computer programs cannot compete yet with the best human players. Methods use pattern matching or selective search to explore the most appropriate parts of the search tree. CS 484 – Artificial Intelligence

CS 484 – Artificial Intelligence Games of Chance The methods described so far do not work well with games of chance such as poker or backgammon. Expectiminimax is a variant of minimax designed to deal with chance. Nodes have expected values based on probabilities. CS 484 – Artificial Intelligence