Problem Solving: Searching - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Problem Solving: Searching

Description:

Two empty jugs, a big one and a small one. The big one holds 3 pints. The small one holds 1 pint ... the small jug into the big one. Empty the big jug into the ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 19
Provided by: lila7
Category:

less

Transcript and Presenter's Notes

Title: Problem Solving: Searching


1
Problem Solving Searching
2
  • Problem
  • Collection of information that the agent uses to
    decide what to do.
  • Needed
  • an initial state
  • a set of possible actions (and the states that
    they produce)
  • goal test
  • path cost (sum of the costs of individual
    actions)
  • This is the input to the search algorithm.
  • Output is the solution.
  • The path from the initial state to the goal
    state.
  • Search
  • The process of examining different sequence of
    actions to determine which sequence will result
    in the most success.

3
Example 8-puzzle
  • Initial State
  • An (almost) arbitrary distribution of the
    numbered tiles.
  • For example
  • Goal state

4
  • Operators
  • Move the tile left of the blank right
  • Move the tile right of the blank left
  • Move the tile above the blank down
  • Move the tile below the blank up

5
Example A Water Jug Problem
  • Initial Situation
  • Two empty jugs, a big one and a small one
  • The big one holds 3 pints
  • The small one holds 1 pint
  • Operators
  • Fill big jug from the tap
  • Fill small jug from the tap
  • Fill the small jug from the big one
  • Empty the small jug into the big one
  • Empty the big jug into the sink
  • Empty the small jug into the sink
  • Goal
  • Small jug is empty
  • Big jug contains 2 pints.

6
Search Strategies
  • Different flavours of search
  • Blind Search
  • Heuristic Search

7
Evaluation of Search Strategies
  • Four Criteria
  • Completeness
  • If a solution exists it is guaranteed to be found
  • Time Complexity
  • Time taken to find the solution
  • Space Complexity
  • Memory required to perform search.
  • Optimality
  • Finding of the highest-quality solution when a
    number exist.

8
Blind Search
  • No information about the cost or number of steps
    to reach the goal is used to guide the search.
  • Two main types of blind search
  • Depth-first Search (DFS)
  • Breadth-first Search (BFS)
  • These strategies differ in the order in which
    nodes are expanded.
  • Blind Search quickly leads to search spaces that
    are too large.

9
Breadth First Search
  • Expands all nodes at one level before moving to
    the next.
  • Finds the shallowest goal state.
  • Uses a lot of memory because the entire search
    tree must be stored.
  • Space complexity is a problem
  • Complete.
  • Optimal if cost is directly related to depth.
  • Modifications
  • Uniform Cost Search

10
Example Breadth-First Search
  • 0 0
  • 3 0 0 1
  • 3 1 2 1 0 0 3 1 1 0 0 0
  • 0 1 3 0 3 0 0 1

2 0
11
Uniform Cost Search
  • Expands the lowest cost node, rather than the
    lowest depth node.
  • Solution is guaranteed to be the cheapest if the
    path cost function is nondecreasing.

12
Depth First Search (DFS)
  • Expands nodes at the deepest level of the search
    tree.
  • Stores only one path from root to leaf.
  • Space complexity not a problem
  • Time could be wasted going down the wrong branch
    of the tree.
  • The above is really bad if there is an infinite,
    or really big search tree.
  • Neither complete nor optimal.
  • Modifications
  • Depth Limited Search
  • Iterative Deepening Search

13
Example Depth-First Search
  • 0 0
  • 3 0
  • 3 1
  • 0 1
  • 3 1 1 0
  • 1 1

2 0
14
  • Depth Limited Search
  • Set a limit on the depth of the search.
  • Addresses the problem of wasting time going down
    the wrong branch.
  • The difficulty with this approach is choosing a
    suitable limit.
  • Iterative Deepening Search
  • Combines DFS and BFS
  • Iterative depth limited search
  • Overcomes the problem of choosing a suitable
    limit.
  • Start with a very low limit and increase
    gradually until a solution is found..

15
Informed Searches
  • Definition
  • A search that uses a heuristic function to direct
    the search towards the goal.
  • Heuristic Function (h(n))
  • A function that calculates the cost of reaching
    the goal state from the node n.
  • Two Basic Approaches
  • Greedy Search
  • Minimises the estimated cost to reach the goal.
  • A Search
  • Minimises total path cost.

16
Greedy Search
  • The node closest to the goal state, as determined
    by h(n), is expanded first.
  • Issues
  • Finds solution quickly
  • Doesnt always find the best solution, since it
    evaluates the immediate best choice, not the long
    term options.
  • Can fall prey to false starts
  • Expands a node that leads to a dead end.
  • Resembles DFS (likes to follow a path to a
    solution or a dead end) so has similar problems.

17
Example Greedy Search
  • pg. 95 (Russell Norvig)

18
A Search
  • g(n)
  • The path cost from start to node n.
  • Admissible Heuristic
  • One that never overestimates the cost to reach
    the goal.
  • f(n)
  • Estimated cost of the cheapest solution through
    n. If h is admissible
Write a Comment
User Comments (0)
About PowerShow.com