Heuristic Search - PowerPoint PPT Presentation

1 / 53
About This Presentation
Title:

Heuristic Search

Description:

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 ... – PowerPoint PPT presentation

Number of Views:77
Avg rating:3.0/5.0
Slides: 54
Provided by: JeanClaud85
Category:

less

Transcript and Presenter's Notes

Title: Heuristic Search


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
Greedy best-first search example
7
Greedy best-first search example
8
Greedy best-first search example
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(bm), but a good heuristic can give
    dramatic improvement
  • Space? O(bm) -- 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 lt ? ? 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
N
goal
  • h1(N) number of misplaced tiles 6 is
    admissible
  • h2(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 G2 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) lt f(G2), so A would not have
    selected G2.

23
Optimality of A (proof)
  • Contd
  • f(G2) g(G2) since h(G2) 0
  • g(G2) gt g(G) since G2 is suboptimal
  • f(G) g(G) since h(G) 0
  • f(G2) gt f(G) from above

24
Optimality of A (proof)
  • Contd
  • f(G2) gt 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(G2) gt f(n), and A will never select
    G2 for expansion

25
Exampel Graph Search returns a suboptimal
solution
h6
2
1
B
A
5
S
G
h7
h1
h0
4
  • h is admissible

26
Exampel Graph Search returns a suboptimal
solution
h6
2
1
B
A
5
S
G
h7
h1
h0
4
  • h is admissible

27
Exampel Graph Search returns a suboptimal
solution
h6
2
1
B
A
5
S
G
h7
h1
h0
4
  • h is admissible

28
Exampel Graph Search returns a suboptimal
solution
h6
2
1
B
A
5
S
G
h7
h1
h0
4
  • h is admissible

29
Exampel Graph Search returns a suboptimal
solution
h6
2
1
B
A
5
S
G
h7
h1
h0
4
  • 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 Nh(N) ?
    c(N,N) h(N)(triangular inequality)
  • A consisteny heuristic is admissible.

31
Exampel Graph Search returns a suboptimal
solution
h6
2
1
B
A
5
S
G
h7
h1
h0
4
  • h is admissible but not consistent e.g.
  • h(S)7 ? c(S,A) h(A) 5 ?
  • No.

32
8-Puzzle
N
goal
33
Claims
  • If h is consistent, then the function f alongany
    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

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 ffi, where fi lt fi1

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 h1 and h2 be two admissible and consistent
    heuristics such that for all nodes N h1(N) ?
    h2(N).
  • Then, every node expanded by A using h2 is
    also expanded by A using h1.
  • h2 is more informed than h1
  • 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
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff4
40
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff4
41
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff4
42
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff4
43
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff4
44
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff5
45
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff5
46
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff5
47
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff5
48
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff5
49
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff5
50
8-Puzzle
f(N) g(N) h(N) with h(N) number of
misplaced tiles
Cutoff5
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
Write a Comment
User Comments (0)
About PowerShow.com