1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Heuristic Search Russell and Norvig: Chapter 4 Slides adapted from:
Informed search algorithms
Review: Search problem formulation
Heuristic Search. Best First Search A* Heuristic Search Heuristic search exploits additional knowledge about the problem that helps direct search to.
Informed Search Algorithms
Informed search algorithms
An Introduction to Artificial Intelligence
Problem Solving: Informed Search Algorithms Edmondo Trentin, DIISM.
Solving Problem by Searching
Optimality of A*(standard proof) Suppose suboptimal goal G 2 in the queue. Let n be an unexpanded node on a shortest path to optimal goal G. f(G 2 ) =
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
Artificial Intelligence
CS 460 Spring 2011 Lecture 3 Heuristic Search / Local Search.
CSC344: AI for Games Lecture 4: Informed search
Russell and Norvig: Chapter 4 CSMSC 421 – Fall 2005
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Rutgers CS440, Fall 2003 Heuristic search Reading: AIMA 2 nd ed., Ch
Informed Search Idea: be smart about what paths to try.
Informed search algorithms
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
Informed search algorithms
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics Memory Bounded A* Search.
Informed search algorithms
2013/10/17 Informed search A* algorithm. Outline 2 Informed = use problem-specific knowledge Which search strategies? Best-first search and its variants.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
CHAPTER 4: INFORMED SEARCH & EXPLORATION Prepared by: Ece UYKUR.
1 Shanghai Jiao Tong University Informed Search and Exploration.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
ISC 4322/6300 – GAM 4322 Artificial Intelligence Lecture 3 Informed Search and Exploration Instructor: Alireza Tavakkoli September 10, 2009 University.
CS 380: Artificial Intelligence Lecture #4 William Regli.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
Chapter 4 Informed/Heuristic Search
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
CSC3203: AI for Games Informed search (1) Patrick Olivier
1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.
CS 312: Algorithm Design & Analysis Lecture #37: A* (cont.); Admissible Heuristics Credit: adapted from slides by Stuart Russell of UC Berkeley. This work.
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
4/11/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 4, 4/11/2005 University of Washington, Department of Electrical Engineering Spring 2005.
A General Introduction to Artificial Intelligence.
Feng Zhiyong Tianjin University Fall  Best-first search  Greedy best-first search  A * search  Heuristics  Local search algorithms  Hill-climbing.
Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most desirable unexpanded node Implementation:
Informed Search II CIS 391 Fall CIS Intro to AI 2 Outline PART I  Informed = use problem-specific knowledge  Best-first search and its variants.
Informed Search CSE 473 University of Washington.
3.5 Informed (Heuristic) Searches This section show how an informed search strategy can find solution more efficiently than uninformed strategy. Best-first.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 5 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Artificial Intelligence Problem solving by searching CSC 361
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
CS 4100 Artificial Intelligence
Artificial Intelligence Informed Search Algorithms
EA C461 – Artificial Intelligence
Informed search algorithms
Informed search algorithms
Artificial Intelligence
CSE 473 University of Washington
Informed Search Idea: be smart about what paths to try.
Artificial Intelligence
Solving Problems by Searching
Informed Search Idea: be smart about what paths to try.
Informed Search.
Presentation transcript:

1 Heuristic Search Chapter 4

2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*

3 Heuristic Search Heuristic: A rule of thumb generally based on expert experience, common sense to guide problem-solving process In search, use a heuristic function that estimates how far we are from a goal. How do we use heuristics?

4 Romania with step costs in km

5 Greedy best-first search example

6

7

8

9 Robot Navigation

10 Robot Navigation f(N) = h(N), with h(N) = Manhattan distance to the goal

11 Properties of greedy best-first search Complete? No – can get stuck in loops; Yes, if we can avoid repeated states Time? O(b m ), but a good heuristic can give dramatic improvement Space? O(b m ) -- keeps all nodes in memory Optimal? No

12 A* Search A* search combines Uniform-cost and Greedy Best-first Search Evaluation function: f(N) = g(N) + h(N) where: g(N) is the cost of the best path found so far to N h(N) is an admissible heuristic f(N) is the estimated cost of cheapest solution through N 0 <   c(N,N’) (no negative cost steps). Order the nodes in the fringe in increasing values of f(N)

13 A * search example

14 A * search example

15 A * search example

16 A * search example

17 A * search example

18 A * search example

19 Admissible heuristic Let h*(N) be the cost of the optimal path from N to a goal node Heuristic h(N) is admissible if: 0  h(N)  h*(N) An admissible heuristic is always optimistic

20 8-Puzzle Ngoal h 1 (N) = number of misplaced tiles = 6 is admissible h 2 (N) = sum of distances of each tile to goal = 13 is admissible What heuristics are overestimates?

21 Completeness & Optimality of A* Claim: If there is a path from the initial to a goal node, A* using TREE-SEARCH terminates by finding the best path, hence is: complete optimal

22 Optimality of A * (proof) Suppose some suboptimal goal G 2 has been generated and is in the fringe. Let n be an unexpanded node in the fringe such that n is on a shortest path to an optimal goal G. We can show f(n) < f(G 2 ), so A* would not have selected G 2.

23 Optimality of A * (proof) Cont’d: f(G 2 ) = g(G 2 )since h(G 2 ) = 0 g(G 2 ) > g(G) since G 2 is suboptimal f(G) = g(G) since h(G) = 0 f(G 2 ) > f(G) from above

24 Optimality of A * (proof) Cont’d: f(G 2 )> f(G) from above h(n)≤ h*(n) since h is admissible g(n) + h(n)≤ g(n) + h * (n) f(n) ≤ f(G) Hence f(G 2 ) > f(n), and A * will never select G 2 for expansion

25 Exampel: Graph Search returns a suboptimal solution h= h=6 h=1h=0 S A B G h is admissible

26 Exampel: Graph Search returns a suboptimal solution h= h=6 h=1h=0 S A B G h is admissible

27 Exampel: Graph Search returns a suboptimal solution h= h=6 h=1h=0 S A B G h is admissible

28 Exampel: Graph Search returns a suboptimal solution h= h=6 h=1h=0 S A B G h is admissible

29 Exampel: Graph Search returns a suboptimal solution h= h=6 h=1h=0 S A B G h is admissible

30 Consistent Heuristic The admissible heuristic h is consistent (or satisfies the monotone restriction) if for every node N and every successor N’ of N: h(N)  c(N,N’) + h(N’) (triangular inequality) A consisteny heuristic is admissible. N N’ h(N) h(N’) c(N,N’)

31 Exampel: Graph Search returns a suboptimal solution h= h=6 h=1h=0 S A B G h is admissible but not consistent; e.g. h(S)=7  c(S,A) + h(A) = 5 ? No.

32 8-Puzzle Ngoal h 1 (N) = number of misplaced tiles h 2 (N) = sum of distances of each tile to goal are both consistent. But do you see why?

33 Claims If h is consistent, then the function f along any path is non-decreasing: f(N) = g(N) + h(N) f(N’) = g(N) +c(N,N’) + h(N’) h(N)  c(N,N’) + h(N’) f(N)  f(N’) If h is consistent, then whenever A* expands a node it has already found an optimal path to the state associated with this node N N’ h(N) h(N’) c(N,N’)

34 Optimality of A * A * expands nodes in order of increasing f value Gradually adds "f-contours" of nodes Contour i has all nodes with f=f i, where f i < f i+1

35 Avoiding Repeated States in A* If the heuristic h is consistent, then: Let CLOSED be the list of states associated with expanded nodes When a new node N is generated: If its state is in CLOSED, then discard N If it has the same state as another node in the fringe, then discard the node with the largest f

36 Heuristic Accuracy h(N) = 0 for all nodes is admissible and consistent. Hence, breadth-first and uniform- cost are particular A* !!! Let h 1 and h 2 be two admissible and consistent heuristics such that for all nodes N: h 1 (N)  h 2 (N). Then, every node expanded by A* using h 2 is also expanded by A* using h 1. h 2 is more informed than h 1 h2 dominates h1 Which heuristic for 8-puzzle is better?

37 Complexity of A* Time: exponential Space: can keep all nodes in memory If we want save space, use IDA*

38 Iterative Deepening A* (IDA*) Use f(N) = g(N) + h(N) with admissible and consistent h Each iteration is depth-first with cutoff on the value of f of expanded nodes

39 8-Puzzle 4 6 f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=4

40 8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=4 6

41 8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=4 6 5

42 8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=

Puzzle 4 6 f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=

44 8-Puzzle 4 6 f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=5

45 8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=5 6

46 8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=5 6 5

47 8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=5 6 57

48 8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=

49 8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=

50 8-Puzzle f(N) = g(N) + h(N) with h(N) = number of misplaced tiles Cutoff=

51 About Heuristics Heuristics are intended to orient the search along promising paths The time spent computing heuristics must be recovered by a better search After all, a heuristic function could consist of solving the problem; then it would perfectly guide the search Deciding which node to expand is sometimes called meta-reasoning Heuristics may not always look like numbers and may involve large amount of knowledge

52 When to Use Search Techniques? The search space is small, and There are no other available techniques, or It is not worth the effort to develop a more efficient technique The search space is large, and There is no other available techniques, and There exist “good” heuristics

53 Summary Heuristic function Greedy Best-first search Admissible heuristic and A* A* is complete and optimal Consistent heuristic and repeated states Heuristic accuracy IDA*