HEURISTIC SEARCH. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Portion of the state space for tic-tac-toe.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

1 CS 385 Fall 2006 Chapter 4 Heuristic Search. 2 Heuristics eurisko ("I discover" in Greek) "the study of the methods and rules of discovery and invention."
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.
Artificial Intelligence Chapter 9 Heuristic Search Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
Using Heuristics in Games At that time two opposing concepts of the game called forth commentary and discussion. The foremost players distinguished two.
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.
Artificial Intelligence
Search in AI.
Adversarial Search: Game Playing Reading: Chapter next time.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
MINIMAX SEARCH AND ALPHA- BETA PRUNING: PLAYER 1 VS. PLAYER 2.
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.
HEURISTIC SEARCH ARTIFICIAL INTELLIGENCE 5th edition George F Luger
Mahgul Gulzai Moomal Umer Rabail Hafeez
All rights reservedL. Manevitz Lecture 31 Artificial Intelligence A/O* and Minimax L. Manevitz.
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:
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 Heuristic Search 4 4.0Introduction 4.1An Algorithm for Heuristic Search 4.2Admissibility, Monotonicity, and Informedness 4.3Using Heuristics in Games.
Problem Solving and Search in AI Heuristic Search
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
1 Heuristic Search 4 4.0Introduction 4.1An Algorithm for Heuristic Search 4.2Admissibility, Monotonicity, and Informedness 4.3Using Heuristics in Games.
Monotonicity Admissible Search: “That finds the shortest path to the Goal” Monotonicity: local admissibility is called MONOTONICITY This property ensures.
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.
1 Heuristic Search 4 4.0Introduction 4.1An Algorithm for Heuristic Search 4.2Admissibility, Monotonicity, and Informedness 4.3Using Heuristics in Games.
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”
Heuristic Search Heuristic - a “rule of thumb” used to help guide search often, something learned experientially and recalled when needed Heuristic Function.
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.
Notes adapted from lecture notes for CMSC 421 by B.J. Dorr
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.
Game Playing.
Search CSE When you can’t use A* Hill-climbing Simulated Annealing Other strategies 2 person- games.
October 3, 2012Introduction to Artificial Intelligence Lecture 9: Two-Player Games 1 Iterative Deepening A* Algorithm A* has memory demands that increase.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
Chapter 12 Adversarial Search. (c) 2000, 2001 SNU CSE Biointelligence Lab2 Two-Agent Games (1) Idealized Setting  The actions of the agents are interleaved.
Structures and Strategies For Space State Search
George F Luger ARTIFICIAL INTELLIGENCE 5th edition Structures and Strategies for Complex Problem Solving HEURISTIC SEARCH Luger: Artificial Intelligence,
George F Luger ARTIFICIAL INTELLIGENCE 6th edition Structures and Strategies for Complex Problem Solving HEURISTIC SEARCH Luger: 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.
Search exploring the consequences of possible actions.
HEURISTIC SEARCH.
CS 415 – A.I. Slide Set 6. Chapter 4 – Heuristic Search Heuristic – the study of the methods and rules of discovery and invention State Space Heuristics.
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.
Knowledge Search CPTR 314.
George F Luger ARTIFICIAL INTELLIGENCE 5th edition Structures and Strategies for Complex Problem Solving HEURISTIC SEARCH Luger: Artificial Intelligence,
HEURISTIC SEARCH 4 4.0Introduction 4.1An Algorithm for Heuristic Search 4.2Admissibility, Monotonicity, and Informedness 4.3Using Heuristics in Games 4.4Complexity.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
CMSC 421: Intro to Artificial Intelligence October 6, 2003 Lecture 7: Games Professor: Bonnie J. Dorr TA: Nate Waisbrot.
1 HEURISTIC SEARCH ( INFORMED SEARCH). 2  From Greek heuriskein, “to find”.  Of or relating to a usually speculative formulation serving as a guide.
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.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Adversarial Search Chapter Two-Agent Games (1) Idealized Setting – The actions of the agents are interleaved. Example – Grid-Space World – Two.
Adversarial Search and Game-Playing
AI Classnotes #5, John Shieh, 2012
Iterative Deepening A*
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Heuristic Search A heuristic is a rule for choosing a branch in a state space search that will most likely lead to a problem solution Heuristics are used.
Chapter 6 : Game Search 게임 탐색 (Adversarial Search)
NIM - a two person game n objects are in one pile
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Based on slides by: Rob Powers Ian Gent
Adversarial Search and Game Playing Examples
Unit II Game Playing.
Presentation transcript:

HEURISTIC SEARCH

Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Portion of the state space for tic-tac-toe.

Heuristically reduced state space for tic-tac-toe. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

First three levels of the tic-tac-toe state space reduced by symmetry Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

The “most wins” heuristic applied to the first children in tic-tac-toe. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Is it possible to completely cover with non- overlapping dominos an 8x8 grid having two diagonally opposite corners removed?

Issues: 1) Representation (organization) 2) Algorithm (process)

The local maximum problem for hill-climbing with 3-level look ahead Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

priority queue not necessary if states are added to open in sorted order not necessary if using a monotone heuristic

Heuristic search of a hypothetical state space. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 (assume P3 is the goal state and lower scores are preferred)

A trace of the execution of best_first_search for previous figure. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Heuristic search of a hypothetical state space with open and closed states highlighted. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Eight Puzzle…

Compare: best-first with depth factor: 26 moves to solution (7725 in CLOSED; 7498 left in OPEN) best-first without depth factor: 48 moves to solution (272 in CLOSED; 332 in OPEN) 30 shuffle moves Consider this screen shot of a brute-force breath- first search in process for the 15- puzzle where the optimal solution is known (by another method) to be located at depth 26. How long will it take to find the solution?

The start state, first moves, and goal state for an example-8 puzzle. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, or Goal

Three heuristics applied to states in the 8-puzzle. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

The heuristic f applied to states in the 8-puzzle. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 (but should use a better heuristic…)

State space generated in heuristic search of the 8-puzzle graph. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Notice that Luger is using the “Tiles out of place” heuristic.

State space generated in heuristic search of the 8-puzzle graph. The successive stages of open and closed that generate this graph are: Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Open and closed as they appear after the 3rd iteration of heuristic search Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Heuristic search with inclusion of a depth factor (heuristic here is # of tiles out of place) Nilsson

i.e., as long as h(n) is not overestimated (i.e., because that could prevent search of the optimal path) Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

(i.e., locally admissible) Note: If the graph search algorithm for best-first search is used with a monotonic heuristic, a new path cannot be shorter than one already found.

Note: the best h(n) can be is the actual cost of the optimal path from node n to the goal. If h 1 (n) < h 2 (n), then h 1 (n) is actually underestimating the cost more than h 2 (n) and is, therefore, less informed. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Comparison of state space searched using heuristic search with space searched by breadth-first search. The proportion of the graph searched heuristically is shaded. The optimal search selection is in bold. Heuristic used is f(n) = g(n) + h(n) where h(n) is tiles out of place. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Number of nodes generated as a function of branching factor, B, for various lengths, L, of solution paths. The relating equation is T = (B L+1 – 1)/(B – 1), adapted from Nilsson (1980) *. * Note: equation in text is incorrect but the one shown here is correct for root node at depth 0 Branching Factor = B Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Informal plot of cost of searching and cost of computing heuristic evaluation against informedness of heuristic, adapted from Nilsson (1980). Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 (i.e., cost to run the heuristic) (i.e., cost to traverse the search graph)

Two-“Person” Games

State space for a variant of Nim. Each state partitions the seven matches into one or more piles of different sizes. First player who cannot make a legal move, wins. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Exhaustive minimax for the game of Nim. Bold lines indicate forced win for MIN. Each node is marked with its derived value (0 or 1) under minimax. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Note: Figure is slightly different from text...

Getting ready to apply minimax to a hypothetical state space. Leaf states show heuristic values. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Applying minimax to a hypothetical state space. Leaf states show heuristic values; internal states show backed-up values. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Heuristic measuring conflict applied to states of tic-tac-toe. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Two-ply minimax applied to the opening move of tic-tac-toe, from Nilsson (1971). Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Two ply minimax, and one of two possible MAX second moves, from Nilsson (1971). Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Two-ply minimax applied to X’s move near the end of the game, from Nilsson (1971). Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Let’s reconsider the application of minimax to the hypothetical state space shown a few slides back... Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Alpha-Beta Pruning

Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Alpha-beta pruning applied to the previous minimax state space search. States without numbers are not evaluated. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Alpha-Beta Search As successors of a node are given backed-up values, the bounds on the backed-up values can change but: –Alpha values of MAX nodes can never decrease –Beta values of MIN nodes can never increase Rules for discontinuing search: –Discontinue search below any MIN node having a beta value ≤ to alpha value of any of its MAX node ancestors. Final backed-up value of this MIN node can be set to its beta value. –Discontinue search below any MAX node having an alpha value ≥ the beta value of any of its MIN node ancestors. Final backed-up value of this MAX node can be set to its alpha value. Rules for computing alpha and beta values: –The alpha value of a MAX node is set equal to the current largest final backed-up value of its successors. –The beta value of a MIN node is set equal to the current smallest final backed-up value of its successors.

Mini-Max

Mini-Max with Alpha-Beta Cutoffs

Nodeα-β values A (max)α = - , β =  B (min)α = - , β =  E (max)α = - , β =  L E (max)α = 2, β =  M E (max)α = 10, β =  B (min)α = - , β = 10 F (max)α = - , β = 10 N F (max)α = 8, β = 10 O F (max)α = 8, β = 10 B (min)α = - , β = 8 A (max)α = 8, β =  C (min)α = 8, β =  G (max)α = 8, β =  P G (max)α = 8, β =  Q G (max)α = 8, β =  C (min)α = 8, β = 8 Search terminated below C because C <= A A (max)α = 8, β =  D (min)α = 8, β =  J (max)α = 8, β =  V J (max)α = 8, β =  W J (max)α = 8, β =  D (min)α = 8, β = 5 Search terminated below D because D <= A Processing sequence for α-β assignment and visiting leaf nodes:

Another Example of Mini-Max with Alpha-Beta Cutoffs

There is no need to search below a MAX node whose  value is greater than the parent node’s  value (because the MIN node above wouldn’t accept anything > than its  value), nor to search below a MIN node (e.g., node C) whose  value is less than the parent’s  value (because the MAX node above wouldn’t accept anything < than its  value).

Processing Sequence for Previous Search