Heuristic Search Methods Methods that use a heuristic function to provide specific knowledge about the problem: Heuristic Functions Hill climbing Beam.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Informed search algorithms
Artificial Intelligence: Knowledge Representation
Heuristic Search Russell and Norvig: Chapter 4 Slides adapted from:
Chapter 4: Informed Heuristic Search
Informed Search CS 171/271 (Chapter 4)
Heuristic Functions By Peter Lane
Heuristic Searches. Feedback: Tutorial 1 Describing a state. Entire state space vs. incremental development. Elimination of children. Closed and the solution.
Heuristic Search. Best First Search A* Heuristic Search Heuristic search exploits additional knowledge about the problem that helps direct search to.
Notes Dijstra’s Algorithm Corrected syllabus.
Heuristic Search Ref: Chapter 4.
Informed search strategies
Informed search algorithms
An Introduction to Artificial Intelligence
The A* Algorithm Héctor Muñoz-Avila. The Search Problem Starting from a node n find the shortest path to a goal node g ?
Informed Search Strategies
State Space Heuristic Search. Three Algorithms  Backtrack  Depth First  Breadth First All work if we have well-defined:  Goal state  Start state.
HEURISTIC SEARCH Ivan Bratko Faculty of Computer and Information Sc. University of Ljubljana.
Ch 4. Heuristic Search 4.0 Introduction(Heuristic)
Greedy best-first search Use the heuristic function to rank the nodes Search strategy –Expand node with lowest h-value Greedily trying to find the least-cost.
Informed Search Methods Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 4 Spring 2004.
Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in “as the crow.
State Space 3 Chapter 4 Heuristic Search. Three Algorithms Backtrack Depth First Breadth First All work if we have well-defined: Goal state Start state.
Comp 307 Problem Solving and Search Formalize a problem as State Space Search Blind search strategies Heuristic search.
Chapter 4 Search Methodologies.
Heuristic search, page 1 CSI 4106, Winter 2005 Heuristic search Points Definitions Best-first search Hill climbing Problems with hill climbing An example:
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
State Space Search Algorithms CSE 472 Introduction to Artificial Intelligence Autumn 2003.
Informed Search (no corresponding text chapter). Recall: Wanted " An algorithm and associated data structure(s) that can: 1) Solve an arbitrary 8-puzzle.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Informed Search Strategies Tutorial. Heuristics for 8-puzzle These heuristics were obtained by relaxing constraints … (Explain !!!) h1: The number of.
Informed Search Methods How can we make use of other knowledge about the problem to improve searching strategy? Map example: Heuristic: Expand those nodes.
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
Adversarial Search: Game Playing Reading: Chess paper.
3.0 State Space Representation of Problems 3.1 Graphs 3.2 Formulating Search Problems 3.3 The 8-Puzzle as an example 3.4 State Space Representation using.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
For Wednesday Read chapter 6, sections 1-3 Homework: –Chapter 4, exercise 1.
For Wednesday Read chapter 5, sections 1-4 Homework: –Chapter 3, exercise 23. Then do the exercise again, but use greedy heuristic search instead of A*
1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.
Search Techniques CS480/580 Fall Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs:
Artificial Intelligence Search Problem (2). Uninformed and informed searches Since we know what the goal state is like, is it possible get there faster?
CHAPTER 2 SEARCH HEURISTIC. QUESTION ???? What is Artificial Intelligence? The study of systems that act rationally What does rational mean? Given its.
1 CO Games Development 1 Week 8 A* Gareth Bellaby.
Heuristic Functions.
Ch. 4 – Informed Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
For Monday Read chapter 4 exercise 1 No homework.
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
Department of Computer Science
Algorithms for Exploration
HW #1 Due 29/9/2008 Write Java Applet to solve Goats and Cabbage “Missionaries and cannibals” problem with the following search algorithms: Breadth first.
The A* Algorithm Héctor Muñoz-Avila.
Informed search algorithms
(1) Breadth-First Search  S Queue S
Heuristic Search Methods
CS 188: Artificial Intelligence Fall 2006
HW 1: Warmup Missionaries and Cannibals
Progressive Deepening
Heuristic Search Generate and Test Hill Climbing Best First Search
Search.
HW 1: Warmup Missionaries and Cannibals
Search.
Midterm Review.
David Kauchak CS51A – Spring 2019
Informed Search.
Optimised Search Techniques
Presentation transcript:

Heuristic Search Methods Methods that use a heuristic function to provide specific knowledge about the problem: Heuristic Functions Hill climbing Beam search Hill climbing (2) Greedy search

2 Heuristic Functions  To further improve the quality of the previous methods, we need to include problem-specific knowledge on the problem.  How to do this in such a way that the algorithms remain generally applicable ???  HEURISTIC FUNCTIONS:  f: States --> Numbers  f(T) : expresses the quality of the state T –allow to express problem-specific knowledge, BUT: can be imported in a generic way in the algorithms.

3 Examples (1):  Imagine the problem of finding a route on a road map and that the NET below is the road map: D E G S A B C F DE G S ABC F  Define f(T) = the straight-line distance from T to G The estimate can be wrong!

4 Examples (2): 8-puzzle  f1(T) = the number correctly placed tiles on the board: f1 = 4 Most often, ‘distance to goal’ heuristics are more useful ! f2 =  f2(T) = number or incorrectly placed tiles on board:  gives (rough!) estimate of how far we are from goal

5 Examples (3): Manhattan distance  f3(T) = the sum of ( the horizontal + vertical distance that each tile is away from its final destination):  gives a better estimate of distance from the goal node f3 = =

6 Examples (4): Chess:  F(T) = (Value count of black pieces) - (Value count of white pieces) f = v( ) + v( ) + v( ) + v( ) + v( ) + v( ) - v( ) - v( ) - v( ) - v( )

Hill climbing A basic heuristic search method: depth-first + heuristic

8 Hill climbing_1  Perform depth-first, BUT:  instead of left-to- right selection,  FIRST select the child with the best heuristic value S D A E BF G S A  Example: using the straight-line distance:

9 Hill climbing_1 algorithm: 1. QUEUE <-- path only containing the root; 2. WHILE QUEUE is not empty AND goal is not reached AND goal is not reached DO remove the first path from the QUEUE; DO remove the first path from the QUEUE; create new paths (to all children); create new paths (to all children); reject the new paths with loops; reject the new paths with loops; sort new paths (HEURISTIC) ; sort new paths (HEURISTIC) ; add the new paths to front of QUEUE; add the new paths to front of QUEUE; 3. IF goal reached THEN success; THEN success; ELSE failure; ELSE failure;

Beam search Narrowing the width of the breadth-first search

11 Beam search (1):  Assume a pre- fixed WIDTH (example : 2 )  Perform breadth- first, BUT:  Only keep the WIDTH best new nodes  depending on heuristic  at each new level. S B D A E A D S Depth 2) S A D Depth 1) XignoreXignore

12 Beam search (2): C E BF B D A E S A D XX Depth 3) C E BF B D A E S A D A C G XX X _ _ Depth 4)  Optimi- zation: ignore leafs that are not goal nodes (see C) Xignore_end

13 Beam search algorithm:  See exercises! Properties:  Completeness:  Hill climbing: YES (backtracking), Beam search: NO  Speed/Memory:  Hill climbing:  same as Depth-first (in worst case)  Beam search:  QUEUE always has length WIDTH, so memory usage is constant = WIDTH, time is of the order of WIDTH*m*b or WIDTH*d*b if no solution is found

14 Hill climbing_2  == Beam search with a width of 1.  Inspiring Example: climbing a hill in the fog.  Heuristic function: check the change in altitude in 4 directions: the strongest increase is the direction in which to move next.  Is identical to Hill climbing_1, except for dropping the backtracking.  Produces a number of classical problems:

15 Problems with Hill climbing_2: Foothills:LocalmaximumPlateaus Ridges

16 Comments:  Foothills are local minima: hill climbing_2 can’t detect the difference.  Plateaus don’t allow you to progress in any direction.  Foothills and plateaus require random jumps to be combined with the hill climbing algorithm.  Ridges neither: the directions you have fixed in advance all move downwards for this surface.  Ridges require new rules, more directly targeted to the goal, to be introduced (new directions to move).

17 Local search  Hill climbing_2 is an example of local search.  In local search, we only keep track of 1 path and use it to compute a new path in the next step.  QUEUE is always of the form:  ( p) S A B C D A BC DEF  Another example:  MINIMAL COST search:  If p is the current path:  the next path extends p by adding the node with the smallest cost from the endpoint of p

Greedy search Always expand the heuristically best nodes first.

19 The ‘open’ nodes Greedy search, or Heuristic best-first search:  At each step, select the node with the best (in this case: lowest) heuristic value. S

20 Greedy search algorithm: (HEURISTIC) 1. QUEUE <-- path only containing the root; 2. WHILE QUEUE is not empty AND goal is not reached AND goal is not reached DO remove the first path from the QUEUE; DO remove the first path from the QUEUE; create new paths (to all children); create new paths (to all children); reject the new paths with loops; reject the new paths with loops; add the new paths and sort the entire QUEUE; add the new paths and sort the entire QUEUE; 3. IF goal reached THEN success; THEN success; ELSE failure; ELSE failure;