Informed Search - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Informed Search

Description:

When I'm driving a car, I vary the speed of the car based on traffic signs, ... How can we perform a greedy search with the missionaries and cannibals problem? ... – PowerPoint PPT presentation

Number of Views:16
Avg rating:3.0/5.0
Slides: 18
Provided by: dUmn
Category:
Tags: informed | search

less

Transcript and Presenter's Notes

Title: Informed Search


1
Informed Search
  • Use problem specific knowledge to
  • Select a next node to expand
  • To select next operator to use
  • In the real world, we select actions based on the
    state of the world
  • When Im driving a car, I vary the speed of the
    car based on traffic signs, other traffic etc.
  • When I speak a word, I speak it based on the real
    world context
  • So far, operators and nodes have not been
    selected using knowledge of world state
  • E.g., depth-first search (DFS) always applies
    operators in same order and selects next node to
    evaluate in a non-problem specific way
  • Problem solving techniques
  • Heuristics, Greedy search, A Search
  • Iterative improvement Hill climbing, Simulated
    annealing, genetic algorithms

2
Heuristic Evaluation Functions
  • Evaluation function, h(n)
  • n is a search node
  • h(n) returns an numeric value measure of
    nearness to goal
  • Used to decide which node to expand next
  • Say we have two unexpanded nodes, n1, n2
  • If h(n1) lt h(n2), then expand n1 first
  • In the problem solving context
  • Dont have much problem knowledge
  • E.g., dont know how to solve problem
    analytically
  • h(n) will typically be inexact
  • An estimate, or a heuristic function
  • i.e., h heuristic
  • Greedy search
  • Use heuristic function to select next expanded
    node to expand
  • h(goal) 0

3
Example
  • How can we perform a greedy search with the
    missionaries and cannibals problem?

4
Need a heuristic function
  • Consider the state with the mc problem
  • n ((ml cl bl) (mr cr br))
  • How can we compute h(n)?
  • Only constraint so far is that h(goal) 0
  • One heuristic function
  • Define h(((0 0 0) (3 3 1))) 0
  • Otherwise, h(n) ml cl
  • Note
  • This heuristic function is specific for the mc
    problem
  • It will not work on other problems
  • Incorporates some knowledge of the problem into
    the search

5
  • Informed Search Process

Input start state, goal state
Input operators
Input heuristic function
Look for goal
Search Computation
Output
sequence of operators, goal state
6
Another ExampleWater Jug Problem
  • Have a three-gallon jug and a four-gallon jug,
    and an unlimited supply of water
  • Problem get exactly two gallons of water in one
    jug
  • Neither jug has any gallon "markers" (e.g., they
    are not like a measuring cup, with ¼, ½ and other
    gradations).
  • Possible operations are to fill a jug with water
    completely, pour the contents of one jug into
    another (stopping just short of overflow), and
    pour the contents of one jug onto the ground
  • Define the a state representation, and show a
    heuristic, h(n), for this problem

7
A search
  • Combines
  • Uniform cost search
  • g(n) Exact path cost from start state to node n
  • Greedy search
  • h(n) Heuristic path cost from node n to a goal
    state
  • Heuristic function for A
  • f(n) g(n) h(n)
  • With a new restriction on h(n)
  • choose h(n) so that it never overestimates
  • This is termed an admissible heuristic
  • E.g., straight-line distance for shortest
    geometric path is admissible
  • A Next node to expand is node with lowest f(n)

8
Example Geometric Paths
straight-line distances
  • Show an A search tree, proceeding from start (s)
    to goal (g), given the arcs as operators, the arc
    labels as operator costs, and this table giving
    straight-line distances for h(n).

9
Costs for Example
  • What is the
  • Search Cost
  • Path Cost
  • For the last example?

10
A for shortest path
  • Why not an O(n2) shortest path algorithm?
  • E.g., Dijkstras algorithm for finding the
    shortest path on a weighted directed graph
  • Shortest-path in a graph is an example only
  • To illustrate operation of A

11
Admissible HeuristicsAnother Example
  • 8-puzzle

Goal state
Start state
  • Give an admissible heuristic for the 8-puzzle,
    i.e., one that does not overestimate

12
A search Proof of OptimalityMonotonic A
heuristics
  • Monotonic nondecreasing
  • We can force admissible h(n) heuristics to be
    monotonic
  • Method
  • Start with parent node, n
  • generate a child node, n
  • f(n) max( f(n), g(n) h(n) )
  • Following this approach, f-costs along paths do
    not decrease
  • New f() is still optimistic (admissible) because
    h() is optimistic

13
A Proof of optimality
  • What is optimal?
  • Optimal means that when we find a goal, G, with
    the search method, G will have the shortest cost
    path possible
  • I.e., for any other goal states, say, G
  • It must be the case that g(G) gt g(G)
  • Starting assumptions
  • h(G) 0
  • h is admissible
  • h is monotonic

14
A Proof of optimalityProof by contradiction
  • Assume the opposite of what we are trying to
    prove
  • Suppose that A search can reach a suboptimal
    goal state, G
  • That is
  • In our A search we have reached a goal state, G
  • There is another reachable goal state G
  • where g(G) lt g(G) 1
  • G is a lower-cost goal state than G
  • Reachable means we can get there from the start
    node
  • And, we have not detected G prior to reaching G

15
A Proof of optimality
  • In A search, detect goal state by
  • removing node at head of list of unexpanded nodes
  • list ordered using f(n) h(n) g(n)
  • checking if node is a goal state, prior to
    expansion
  • if node is goal state have found goal
  • Because node G detected as the goal
  • G was at head of list of unexpanded nodes
  • Therefore, f(G) lt f(n) for all n in list
  • And, also g(G) lt f(n) for all nodes in
    list 2
  • since f(G) g(G) for goal nodes
  • You have to reach G from a node, n, in list
  • Because G is reachable from the start state
  • Therefore, f(G) gt f(n), for all n in the list
  • Since we have monotonicity
  • and g(G) gt f(n), for all n, since f(G) g(G)
    for goal nodes
  • Reversing this f(n) lt g(G) 3

16
A Proof of optimalityConclusion
  • Putting together 1, 2, and 3
  • g(G) lt g(G) lt f(n) lt g(G)
  • But implies that g(G) lt g(G)
  • Therefore, contradiction
  • Therefore cannot be such a G
  • Therefore A finds optimal G

17
Complexity of A
  • Number of nodes
  • Exponential in the length of the solution
  • For most problems
  • Exponential complexity unless
  • path cost error is logarithmically bounded
  • error h(n) C(n)
  • C(n) actual cost of path from node n to goal
  • bound error lt O(log C(n))
Write a Comment
User Comments (0)
About PowerShow.com