Announcements 1.Reading and Homework for this week 2.Late policy on homework: 10% per day, unless you ask for extension beforehand 3.Presentation schedule.

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.
CMSC 471 Spring 2014 Class #9 Tue 2/25/14 Game Playing Professor Marie desJardins,
Game Playing CS 63 Chapter 6
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 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.
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.
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.
This time: Outline Game playing The minimax algorithm
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.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Adversarial Search: Game Playing Reading: Chess paper.
double AlphaBeta(state, depth, alpha, beta) begin if depth
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”
ICS-270a:Notes 5: 1 Notes 5: Game-Playing ICS 270a Winter 2003.
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
Lecture 6: Game Playing Heshaam Faili University of Tehran Two-player games Minmax search algorithm Alpha-Beta pruning Games with chance.
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.
October 3, 2012Introduction to Artificial Intelligence Lecture 9: Two-Player Games 1 Iterative Deepening A* Algorithm A* has memory demands that increase.
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.
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.
Artificial Intelligence
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Adversarial Search and Game Playing Russell and Norvig: Chapter 6 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
February 25, 2016Introduction to Artificial Intelligence Lecture 10: Two-Player Games II 1 The Alpha-Beta Procedure Can we estimate the efficiency benefit.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Luca Weibel Honors Track: Competitive Programming & Problem Solving Partisan game theory.
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.
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
Games and adversarial search (Chapter 5)
EA C461 – Artificial Intelligence Adversarial Search
4. Games and adversarial search
Iterative Deepening A*
Games and adversarial search (Chapter 5)
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Adversarial Search Chapter 5.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search.
Games & Adversarial Search
Games & Adversarial Search
Adversarial Search CS 171/271 (Chapter 6)
Games & Adversarial Search
Adversarial Search Chapter 6 Section 1 – 4.
Unit II Game Playing.
Presentation transcript:

Announcements 1.Reading and Homework for this week 2.Late policy on homework: 10% per day, unless you ask for extension beforehand 3.Presentation schedule – reminder for upcoming presentations

Game Playing: Adversarial Search

Game tree From M. T. Jones, Artificial Intelligence: A Systems Approach Current board: Xs move

How many nodes? Game tree From M. T. Jones, Artificial Intelligence: A Systems Approach Current board: Xs move

Evaluation Function From M. T. Jones, Artificial Intelligence: A Systems Approach Evaluation function f(n) measures goodness of board configuration n. Assumed to be better estimate as search is deepened (i.e., at lower levels of game tree). Evaluation function here: Number of possible wins (rows, columns, diagonals) not blocked by opponent, minus number of possible wins for opponent not blocked by current player. Current board: Os move

Minimax search: Expand the game tree by m ply (levels in game tree) in a limited depth-first search. Then apply evaluation function at lowest level, and propagate results back up the tree. Minimax search From M. T. Jones, Artificial Intelligence: A Systems Approach Current board: Xs move

Minimax search From M. T. Jones, Artificial Intelligence: A Systems Approach Calculate f(n) Current board: Xs move

Minimax search From M. T. Jones, Artificial Intelligence: A Systems Approach Calculate f(n) Propagate min value of children to parent Current board: Xs move

Minimax search From M. T. Jones, Artificial Intelligence: A Systems Approach Calculate f(n) Propagate min value of children to parent Propagate max value of children to parent Current board: Xs move

Minimax search From M. T. Jones, Artificial Intelligence: A Systems Approach Calculate f(n) Propagate min value of children to parent Propagate max value of children to parent Propagate min value of children to parent Current board: Xs move

Minimax search From M. T. Jones, Artificial Intelligence: A Systems Approach Calculate f(n) Propagate min value of children to parent Propagate max value of children to parent Propagate min value of children to parent Propagate max value of children to parent Current board: Xs move

Minimax algorithm: Example From M. T. Jones, Artificial Intelligence: A Systems Approach Current board Xs move

Exercise What is value at the root?

Alpha-Beta Pruning Problem with minimax: too expensive! Need to prune tree. Solution: alpha-beta pruning algorithm Basic idea: identify non-beneficial moves, and prune branches rooted in those moves

Alpha-Beta Pruning Example From M. T. Jones, Artificial Intelligence: A Systems Approach

alpha = value of the best possible move you can make, that you have computed so far beta = value of the best possible move your opponent can make, that you have computed so far If at any time, alpha >= beta, then your opponent's best move can force a worse position than your best move so far, and so there is no need to further evaluate this move

Alpha-Beta Pruning Applet

Algorithm: Minimax with Alpha-Beta Pruning function alphabeta(node, depth, α, β, Player) if depth = 0 or node is a terminal node return the heuristic value of node if Player = MaxPlayer for each child of node α := max(α, alphabeta(child, depth-1, α, β, not(Player) )) if β α break ; Prune return α else for each child of node β := min(β, alphabeta(child, depth-1, α, β, not(Player) )) if β α break ; Prune return β end ; Initial call alphabeta(origin, depth, -infinity, +infinity, MaxPlayer)

Alpha-beta pruning exercise (a) What is value at the root, using minimax alone? (b) What nodes could have been pruned from the search using alpha-beta pruning? Show values of alpha and beta max min max min

Alpha-beta pruning exercise (a) What is value at the root, using minimax alone? (b) What nodes could have been pruned from the search using alpha-beta pruning? max min max min Remember: alpha: best move for us seen so far beta: best move for opponent seen so far If alpha >= beta, prune

Note: Alpha Beta pruning effectiveness is highly depending on the move ordering ! How can we improve this ordering?

Minimax / Alpha-Beta Assumptions:

Minimax / Alpha-Beta Assumptions: Opponent is rational Both players have perfect information at each evaluation

Evaluation functions Checkers and chess: Weighted linear sum of features f(s): Eval(s) = w 1 f 1 (s) + w 2 f 2 (s) + … + w n f n (s) 24

n Arthur Samuels checkers program, written in the 1950s. n In 1962, running on an IBM 7094, the machine defeated R. W. Nealy, a future Connecticut state checkers champion. n One of the first machine learning programs, introducing a number of different learning techniques. Samuels Checker Player ( (

n Rote Learning u When a minimax value is computed for a position, that position is stored along with its value. u If the same position is encountered again, the value can simply be returned. u Due to memory constraints, all the generated board positions cannot be stored, and Samuel used a set of criteria for determining which positions to actually store. Samuels Checker Player ( (

n Learning the evaluation function u Comparing the static evaluation of a node with the backed-up minimax value from a lookahead search. F If the heuristic evaluation function were perfect, the static value of a node would be equal to the backed- up value based on a lookahead search applying the same evaluation on the frontier nodes. F If theres a difference between the values, the evaluation the heuristic function should be modified. Samuels Checker Player ( (

n Selecting terms library u Samuels program could select which terms to actually use, from a library of possible terms. u In addition to material, these terms attempted to measure following board features : F center control F advancement of the pieces F mobility u The program computes the correlation between the values of these different features and the overall evaluation score. If the correlation of a particular feature dropped below a certain level, the feature was replaced by another. Samuels Checker Player

Deep Blue First Created in 1997 Algorithm: –i–iterative-deepening alpha-beta search, transposition table, databases including openings of grandmaster games (700,000), and endgames (all with 5 pieces or more pieces remaining) Hardware: –3–30 IBM RS/6000 processors They do: high level decision making –4–480 custom chess processors all running in parallel They do : –d–deep searches into the trees – move generation and ordering, –p–position evaluation (over 8000 evaluation points) Average performance: –1–126 million nodes/sec., 30 billion position/move generated, search depth: 14

On May 11, 1997, the machine won a six-game match by two wins to one with three draws against world champion Garry Kasparov.[1] Kasparov accused IBM of cheating and demanded a rematch, but IBM refused and dismantled Deep Blue.[2] Kasparov had beaten a previous version of Deep Blue in After the loss, Kasparov said that he sometimes saw deep intelligence and creativity in the machine's moves, suggesting that during the second game, human chess players had intervened on behalf of the machine, which would be a violation of the rules. IBM denied that it cheated, saying the only human intervention occurred between games. From Deep Blue (chess computer)

On 14 December 2006, Topalov directly accused Kramnik of using computer assistance [from the Fritz chess computer] in their World Championship match. On 14 February 2007, Topalov's manager released pictures, purporting to show cables in the ceiling of a toilet used by Kramnik during the World Championship match in Elista. A decade later: Topalov vs. Kramnik