Intelligence for Games and Puzzles1 Berliner’s 1979 B* Algorithm: Motivations The B* algorithm.

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

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.
Study Group Randomized Algorithms 21 st June 03. Topics Covered Game Tree Evaluation –its expected run time is better than the worst- case complexity.
Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
Game Playing (Tic-Tac-Toe), ANDOR graph By Chinmaya, Hanoosh,Rajkumar.
Game Playing Games require different search procedures. Basically they are based on generate and test philosophy. At one end, generator generates entire.
CS 484 – Artificial Intelligence
Search in AI.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
Artificial Intelligence in Game Design
Mahgul Gulzai Moomal Umer Rabail Hafeez
This time: Outline Game playing The minimax algorithm
Review: Search problem formulation
Using Search in Problem Solving
1 Game Playing Chapter 6 Additional references for the slides: Luger’s AI book (2005). Robert Wilensky’s CS188 slides:
Intelligence for Games and Puzzles1 Minimax to fixed depth Where the game tree is too large.
Game Playing CSC361 AI CSC361: Game Playing.
Min-Max Trees Based on slides by: Rob Powers Ian Gent Yishay Mansour.
1 search CS 331/531 Dr M M Awais A* Examples:. 2 search CS 331/531 Dr M M Awais 8-Puzzle f(N) = g(N) + h(N)
1 DCP 1172 Introduction to Artificial Intelligence Lecture notes for Chap. 6 [AIMA] Chang-Sheng Chen.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
COMP4031Artificial Intelligence for Games and Puzzles1 The Shape of a Game Tree Fragment Standard  -  is an algorithm which performs the same computation.
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.
Artificial Intelligence for Games and Puzzles1 Artificially Narrow Alpha & Beta AlphaBeta cuts off the.
HEURISTIC SEARCH. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Portion of the state space for tic-tac-toe.
Alpha-Beta Search. 2 Two-player games The object of a search is to find a path from the starting position to a goal position In a puzzle-type problem,
Intelligence for Games and Puzzles1 Berliner’s 1979 B* Algorithm: Motivations The B* algorithm.
1 Midterm Review cmsc421 Fall Outline Review the material covered by the midterm Questions?
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.
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.
Minimax.
KU NLP Heuristic Search Heuristic Search and Expert Systems (1) q An interesting approach to implementing heuristics is the use of confidence.
Lecture 6: Game Playing Heshaam Faili University of Tehran Two-player games Minmax search algorithm Alpha-Beta pruning Games with chance.
Game Playing.
1 Computer Group Engineering Department University of Science and Culture S. H. Davarpanah
October 3, 2012Introduction to Artificial Intelligence Lecture 9: Two-Player Games 1 Iterative Deepening A* Algorithm A* has memory demands that increase.
Lecture 5: Backtracking Depth-First Search N-Queens Problem Hamiltonian Circuits.
For Wednesday Read Weiss, chapter 12, section 2 Homework: –Weiss, chapter 10, exercise 36 Program 5 due.
Problem Reduction Search: AND/OR Graphs & Game Trees Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
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.
Game Playing. Introduction One of the earliest areas in artificial intelligence is game playing. Two-person zero-sum game. Games for which the state space.
CSCI 4310 Lecture 6: Adversarial Tree Search. Book Winston Chapter 6.
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.
Adversarial Games. Two Flavors  Perfect Information –everything that can be known is known –Chess, Othello  Imperfect Information –Player’s have each.
Basic Problem Solving Search strategy  Problem can be solved by searching for a solution. An attempt is to transform initial state of a problem into some.
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
George F Luger ARTIFICIAL INTELLIGENCE 5th edition Structures and Strategies for Complex Problem Solving HEURISTIC SEARCH Luger: Artificial Intelligence,
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
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.
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.
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
Iterative Deepening A*
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Pengantar Kecerdasan Buatan
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Based on slides by: Rob Powers Ian Gent
Unit II Game Playing.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Intelligence for Games and Puzzles1 Berliner’s 1979 B* Algorithm: Motivations The B* algorithm is primarily a best-first game tree proof procedure. Effort limits on  et al are artificial, and lead to horizon effects. Depth-First searches tend to investigate huge trees, large parts of which have nothing to do with the solution. Skilled players do not do this. Most game-tree searches do not hope to find a complete path to a solution, but only a best move toward a solution. It is desirable to discontinue searching a branch whose value is already sufficient for the proof being attempted. Grandmasters say things like “In case of time pressure I would play B-N5” If there is only one possible move, no search at all is needed Traditional best-first algorithms still spend considerable effort searching within the best branch before confirming that it is in fact best (with NegaMax, lowest child is best choice)

Intelligence for Games and Puzzles2 Dual evaluations: Optimistic and Pessimistic The B* Algorithm uses two evaluations for every node: An optimistic one, hopefully valid as an upper bound on the true value A pessimistic one, hopefully valid as a lower bound on the true value But maybe only one evaluation function is needed, an optimistic one, because what is optimistic for one player can be treated as pessimistic for the other, &vv. At leaf nodes, null moves will allow evaluation from the other point of view When computing values for interior nodes, from player A’s point of view: A’s Optimistic arises from the best-for-A of the children B-Pess values A’s Pessimistic arises from the best-for-A of the children B-Opt values

Intelligence for Games and Puzzles3 A’s Optimism from B’s Pessimism (Note, Berliner’s paper does not present the B* algorithm in NegaMax style, rather it speaks of players MAX and MIN, with all evaluations interpreted as bigger-numbers-better-for-MAX. I adapt it to NegaMax.) A’s Upper Bound comes from the best-for-A of B’s Lower Bounds, And Vice Versa. +30,+15+19,+10+22,+8 -8, ,+3+39,+10+42,+8 -3,-39 A nodes B nodes -15,-30

Intelligence for Games and Puzzles4 A’s Optimism from B’s Pessimism (Note, Berliner’s paper does not present the B* algorithm in NegaMax style, rather it speaks of players MAX and MIN, with all evaluations interpreted as bigger-numbers-better-for-MAX. I adapt it to NegaMax.) A’s Upper Bound comes from the best-for-A of B’s Lower Bounds, And Vice Versa. +ve good for A A nodes Opt >= Pess +ve good for B B nodes Opt >= Pess +30,+15+19,+10+22,+8 -8, ,+3+39,+10+42,+8 -3, ,-30

Intelligence for Games and Puzzles5 A’s Optimism from B’s Pessimism (Note, Berliner’s paper does not present the B* algorithm in NegaMax style, rather it speaks of players MAX and MIN, with all evaluations interpreted as bigger-numbers-better-for-MAX. I adapt it to NegaMax.) A’s Upper Bound comes from the best-for-A of B’s Lower Bounds, And Vice Versa. +ve good for A A nodes Opt >= Pess +ve good for B B nodes Opt >= Pess +39,+8 +30,+15+19,+10+22,+8 -8, ,+3+39,+10+42,+8 -3, ,-30

Intelligence for Games and Puzzles6 Dual values rather than single values Evaluations are used to choose moves. What is to be proven about a chosen move? With single valued evaluations, Minimaxing algorithms (including alphabeta etc) seek to prove that no other move at the root gives a better value than the chosen move. With dual evaluations, The B* algorithm seeks to prove that no other move at the root has a better optimistic value than the pessimistic value of the chosen move. This is used as its terminating condition.

Intelligence for Games and Puzzles7 B*’s two proof strategies When at the root of the game tree for choosing a move, The Prove_Best Strategy hopes to improve (from A’s point of view) the pessimistic bound of the most optimistic child node so that it is not worse than the optimistic bound of any of its siblings. The Disprove_Rest Strategy hopes to disimprove (from A’s point of view) the upper bounds of the competing siblings so that they are not better than the pessimistic bound of the most optimistic. To change any bound of a node requires further search in its subtree. -18, ,-3-22, -24 root -18,-26+17,-3-22,-24 root +26,+18+24,+22+3,-17

Intelligence for Games and Puzzles8 B* PseudoCode { initialise; repeat { expand CurrentNode if necessary; assign BestNode, AltNode, MaxOpt, MaxPess; while CurrentNode.BoundsAreWrong() { CurrentNode.UpdateBounds(); if CurrentNode=TopNode then {if Altnode.Opt >= BestNode.Pess then Return BestNode else Break } /* from While */ else CurrentNode:=CurrentNode.Parent} if CurrentNode=Topnode then Strategy:=Decide() if Strategy=‘ProveBest’ then CurrentNode:=BestNode else CurrentNode:=AltNode}

Intelligence for Games and Puzzles9 B* PseudoCode { initialise; repeat { expand CurrentNode if necessary; assign BestNode, AltNode, MaxOpt, MaxPess; while CurrentNode.BoundsAreWrong() { CurrentNode.UpdateBounds(); if CurrentNode=TopNode then {if Altnode.Opt >= BestNode.Pess then Return BestNode else Break } /* from While */ else CurrentNode:=CurrentNode.Parent} if CurrentNode=Topnode then Strategy=Decide() if Strategy=‘ProveBest’ then CurrentNode:=BestNode else CurrentNode:=AltNode}

Intelligence for Games and Puzzles10 B* PseudoCode CurrentNode := TopNode TopNode.Opt := -  TopNode.Pess := +  { initialise; repeat { expand CurrentNode if necessary; assign BestNode, AltNode, MaxOpt, MaxPess; while CurrentNode.BoundsAreWrong() { CurrentNode.UpdateBounds(); if CurrentNode=TopNode then {if Altnode.Opt >= BestNode.Pess then Return BestNode else Break } /* from While */ else CurrentNode:=CurrentNode.Parent} if CurrentNode=Topnode then Strategy=Decide() if Strategy=‘ProveBest’ then CurrentNode:=BestNode else CurrentNode:=AltNode}

Intelligence for Games and Puzzles11 B* PseudoCode BestNode := child of CurNode with best Opt AltNode := child of CurNode with 2nd best Opt MaxOpt := BestNode.Opt MaxPess := best Pess of children { initialise; repeat { expand CurrentNode if necessary; assign BestNode, AltNode, MaxOpt, MaxPess; while CurrentNode.BoundsAreWrong() { CurrentNode.UpdateBounds(); if CurrentNode=TopNode then {if Altnode.Opt >= BestNode.Pess then Return BestNode else Break } /* from While */ else CurrentNode:=CurrentNode.Parent} if CurrentNode=Topnode then Strategy=Decide() if Strategy=‘ProveBest’ then CurrentNode:=BestNode else CurrentNode:=AltNode}

Intelligence for Games and Puzzles12 B* PseudoCode MaxOpt worse than CurrentNode.Pess or MaxPess better than CurrentNode.Opt { initialise; repeat { expand CurrentNode if necessary; assign BestNode, AltNode, MaxOpt, MaxPess; while CurrentNode.BoundsAreWrong() { CurrentNode.UpdateBounds(); if CurrentNode=TopNode then {if Altnode.Opt >= BestNode.Pess then Return BestNode else Break } /* from While */ else CurrentNode:=CurrentNode.Parent} if CurrentNode=Topnode then Strategy=Decide() if Strategy=‘ProveBest’ then CurrentNode:=BestNode else CurrentNode:=AltNode}

Intelligence for Games and Puzzles13 B* PseudoCode (NegaMax assumed here) { initialise; repeat { expand CurrentNode if necessary; assign BestNode, AltNode, MaxOpt, MaxPess; while CurrentNode.BoundsAreWrong() { CurrentNode.UpdateBounds(); if CurrentNode=TopNode then {if Altnode.Opt >= BestNode.Pess then Return BestNode else Break } /* from While */ else CurrentNode:=CurrentNode.Parent} if CurrentNode=Topnode then Strategy=Decide() if Strategy=‘ProveBest’ then CurrentNode:=BestNode else CurrentNode:=AltNode}

Intelligence for Games and Puzzles14 B* PseudoCode (Thereby hangs a tale …) { initialise; repeat { expand CurrentNode if necessary; assign BestNode, AltNode, MaxOpt, MaxPess; while CurrentNode.BoundsAreWrong() { CurrentNode.UpdateBounds(); if CurrentNode=TopNode then {if Altnode.Opt >= BestNode.Pess then Return BestNode else Break } /* from While */ else CurrentNode:=CurrentNode.Parent} if CurrentNode=Topnode then Strategy=Decide() if Strategy=‘ProveBest’ then CurrentNode:=BestNode else CurrentNode:=AltNode}

Intelligence for Games and Puzzles15 B* Observations B* outperforms conventional best-first algorithm. Like conventional best-first algorithm, it requires bookkeeping - nodes in the tree are generated but not destroyed. The determination of when to pursue the DisproveRest strategy can be made on various criteria, from which different variants of the algorithm will follow. The more complex this determination,in terms of number of parameters considered, the greater the reduction of search space achievable The larger the search tree, the more pronounced the effect of a good algorithm The DisproveRest strategy means that B* is not strictly speaking a best-first algorithm; sometimes it explores avenues believing them to be not best Terminating search without determining an exact value is reminiscent of a still earlier idea, that AlphaBeta search might terminate whenever Alpha and Beta get to be close enough to each other. Hans Berliner: The B* Tree Search Algorithm: A Best-First Proof Procedure Artificial Intelligence 12 (1979) pp 23-40