Chapter 4 Heuristic Search Continued - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Chapter 4 Heuristic Search Continued

Description:

estimate of cost from n to closest goal ... 'Like climbing Everest in thick fog with amnesia' Local Search Algorithms. Hill-climbing ... – PowerPoint PPT presentation

Number of Views:79
Avg rating:3.0/5.0
Slides: 28
Provided by: systema178
Category:

less

Transcript and Presenter's Notes

Title: Chapter 4 Heuristic Search Continued


1
Chapter 4Heuristic SearchContinued
2
ReviewLearning Objectives
  • Heuristic search strategies
  • Best-first search
  • A algorithm
  • Heuristic functions
  • Local search algorithms
  • Hill-climbing
  • Simulated annealing

3
ReviewHeuristic Search
  • Greedy search
  • Evaluation function h(n) (heuristic)
    estimate of cost from n to closest goal
  • Example hSLD(n) straight-line distance from n
    to Bucharest
  • Greedy search expands the node that appears to be
    closest to goal

4
ReviewHeuristic Search
  • Properties of greedy search
  • Complete?? No can get stuck in loops, e.g.,
  • Complete in finite space with repeated-state
    checking
  • Time?? O(bm), but a good heuristic can give
    dramatic improvement
  • Space?? O(bm) keeps all nodes in memory
  • Optimal?? No

5
ReviewHeuristic Search
  • A search
  • Premise - Avoid expanding paths that are already
    expansive
  • Evaluation function f(n) g(n) h(n)g(n)
    cost so far to reach nh(n) estimated cost to
    goal from nf(n) estimated total cost of path
    through n to goal

6
ReviewHeuristic Search
  • A search
  • A search uses an admissible heuristici.e., h(n)
    ? h(n) where h(n) is the true cost from
    n.(also require h(n) ?0, so h(G) 0 for any
    goal G.)example, hSLD(n) never overestimates
    the actual road distance.

7
Heuristic Search
  • A search example

8
Heuristic Search
  • A search example

9
Heuristic Search
  • A search example

10
Heuristic Search
  • A search example

11
Heuristic Search
  • A search example

12
Heuristic Search
  • Properties of A
  • Complete?? Yes, unless there are infinitely many
    nodes with f ? f(G)
  • Time?? Exponential in relative error in
    h x length of solution.
  • Space?? Keeps all nodes in memory
  • Optimal?? Yes cannot expand f i1 until fi is
    finished A expands all nodes with f(n) lt C A
    expands some nodes with f(n) C A expands no
    nodes with f(n) gt C

13
Heuristic Search
  • A algorithm
  • Optimality of A (standard proof)
  • Suppose some suboptimal goal G2 has been
    generated and is in the queue. Let n be an
    unexpanded node on a shortest path to an optimal
    goal G1.

14
Heuristic Search
  • A algorithm
  • f(G2) g(G2) since h(G2) 0 gt
    g(G1) since G2 is suboptimal ?
    f(n) since h is admissible
  • since f(G2) gt f(n), A will never select G2 for
    expansion

15
Heuristic Functions
  • Admissible heuristicexample for the
    8-puzzleh1(n) number of misplaced tilesh2(n)
    total Manhattan distance i.e. no of squares
    from desired location of each
    tileh1(S) ??h2(S) ??

16
Heuristic Functions
  • Admissible heuristicexample for the
    8-puzzleh1(n) number of misplaced tilesh2(n)
    total Manhattan distance i.e. no of squares
    from desired location of each
    tileh1(S) ?? 6h2(S) ?? 40331021
    14

17
Heuristic Functions
  • Dominance
  • if h1(n) ? h2(n) for all n (both admissible)then
    h2 dominates h1 and is better for searchTypical
    search costs d 14 IDS 3,473,941 nodes
    A(h1) 539 nodes A(h2) 113
    nodesd 24 IDS ? 54,000,000,000 nodes
    A(h1) 39,135 nodes A(h2) 1,641
    nodes

18
Heuristic Functions
  • Admissible heuristicexample for the
    8-puzzleh1(n) number of misplaced tilesh2(n)
    total Manhattan distance i.e. no of squares
    from desired location of each
    tileh1(S) ?? 6h2(S) ?? 40331021
    14

But how do you come up with a heuristic?
19
Heuristic Functions
  • Relaxed problemsAdmissible heuristics can be
    derived from the exact solution cost of a relaxed
    version of the problemIf the rules of the
    8-puzzle are relaxed so that a tile can move
    anywhere, then h1(n) gives the shortest
    solutionIf the rules are relaxed so that a tile
    can move to any adjacent square, then h2(n)
    gives the shortest solutionKey point the
    optimal solution cost of a relaxed problem is no
    greater than the optimal solution cost of the
    real problem

20
Heuristic Functions
  • Relaxed problems
  • Well-known example traveling salesperson problem
    (TSP) find the shortest tour visiting all
    cities exactly once
  • Minimum spanning tree can be computed in O(n2)
    and is a lower bound on the shortest (open) tour

21
Heuristic Functions
  • Iterative improvement algorithms
  • Iterative optimization problems, path is
    irrelevant the goal state itself is the solution
  • Then state space set of complete
    configurations find optimal configuration e.g.
    TSPor, find configuration satisfying
    constraints, e.g. timetable
  • In such cases, can use iterative improvement
    algorithms keep a single current state, try
    to improve it
  • Constant space, suitable for online as well as
    offline search

22
Heuristic Functions
  • Example Traveling Salesperson Problem
  • Start with any complete tour, perform pairwise
    exchanges

23
Heuristic Functions
  • Example n-queensPut n queens on an n x n board
    with no queens on the same row, column, or
    diagonalMove a queen to reduce number of
    conflicts

24
Local Search Algorithms
  • Hill-climbing (or gradient ascent/descent)Like
    climbing Everest in thick fog with amnesia

25
Local Search Algorithms
  • Hill-climbingProblem depending on initial
    state, can get stuck on local maximaIn
    continuous spaces, problems with choosing step
    size, slow convergence

26
Local Search Algorithms
  • Simulated annealingEscape local maxima by
    allowing some bad moves but gradually decrease
    their size and frequency

27
Local Search Algorithms
Write a Comment
User Comments (0)
About PowerShow.com