1 / 55

Uninformed Search

Uninformed Search. Problem-solving agents. Example: Romania. On holiday in Romania; currently in Arad . Flight leaves tomorrow from Bucharest. What do we need to define?. Problem Formulation. The process of defining actions, states and goal. States:

gaston
Download Presentation

Uninformed Search

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Uninformed Search

  2. Problem-solving agents

  3. Example: Romania • On holiday in Romania; currently in Arad. • Flight leaves tomorrow from Bucharest

  4. What do we need to define?

  5. Problem Formulation • The process of defining actions, states and goal. • States: • Cities (e.g. Arad, Sibiu, Bucharest, etc) • Actions: • GoTo(adjacent city) • Goal: • Bucharest Why not “turn left 5 degrees” or “walk 100 meters forward…”?

  6. Abstraction • The process of removing details from a representation. • Simplifies the problem • Makes problems tractable (possible to solve) • Humans are great at this! • Imagine a hierarchy in which another agent takes care of the lower level details, such as navigating from the city center to the highway.

  7. Back to Arad… • We are in Arad and need to find our way to Bucharest.

  8. Step 1 – Check Goal Condition • Check, are we at the goal? • (obviously not in this case, but we need to check in case we were)

  9. Step 2 – Expand Current Node • Enumerate all the possible actions you could take from the current state • Formally: apply each legal action to the current state, thereby generating a new set of states. • From Arad can go to: • Sibiu • Timisoara • Zerind

  10. Step 3 – Select which action to perform • Perform one of the possible actions(e.g. GoTo(Sibiu)) • Then go back to Step 1 and repeat.

  11. This is an example of Tree Search • Exploration of state space by generating successors of already-explored states (a.k.a. expanding states) • Usually performed offline, as a simulation • Returns the sequence of actions that should be performed to reach the goal, or that the goal is unreachable.

  12. Example: Romania

  13. Tree Search

  14. Tree search example

  15. Tree search example: start with Sibiu

  16. Tree search example: need to process the descendants of Sibiu Note that we can loop back to Arad. Have to make sure we don’t go in circles forever!

  17. Tree search algorithms

  18. Implementation: general tree search a.k.a. frontier

  19. This is the part that distinguishes different search strategies

  20. Search strategies • A search strategy is defined by picking the order of node expansion

  21. Uninformed search strategies • Uninformed search strategies use only the information available in the problem definition • What does it mean to be uninformed? • You only know the topology of which states are connected by which actions. No additional information. • Later we’ll talk about informed search, in which you can estimate which actions are likely to be better than others.

  22. Breadth-first search • Expand shallowest unexpanded node • Implementation: • Fringe is a FIFO queue, i.e., new successors go at end

  23. Breadth-first search • Expand shallowest unexpanded node • Implementation: • Fringeis a FIFO queue, i.e., new successors go at end

  24. Breadth-first search • Expand shallowest unexpanded node • Implementation: • Fringeis a FIFO queue, i.e., new successors go at end

  25. Breadth-first search • Expand shallowest unexpanded node • Implementation: • Fringeis a FIFO queue, i.e., new successors go at end

  26. BFS on a Graph

  27. Search Strategy Evaluation: finding solutions • Strategies are evaluated along the following dimensions: • completeness: does it always find a solution if one exists? • optimality: does it always find a least-cost solution?

  28. Search Strategy Evaluation: complexity (cost) • Two types of complexity • time complexity: number of nodes visited • space complexity: maximum number of nodes in memory • Time and space complexity are measured in terms of • b: maximum branching factor of the search tree (may ∞) • d: depth of the least-cost solution • m: maximum depth of the state space (may be ∞)

  29. Properties of breadth-first search • Complete? • Yes (if b is finite) • Optimal? • Yes (if cost = 1 per step) • Time? • 1+b+b2+b3+… +bd= O(bd) • Space? • O(bd) (keeps every node in memory)

  30. Problems of breadth first search • Space is the biggest problem (more than time) • Example from book, BFS b=10 to depth of 10 • 3 hours (not so bad) • 10 terabytes of memory (really bad) • Only reason speed is not a problem is you run out of memory first

  31. Problems of breadth first search • BFS is not optimal if the cost of some actions is greater than others…

  32. Uniform-cost search • For graphs with actions of different cost • Equivalent to breadth-first if step costs all equal • Expand least-cost unexpanded node • Implementation: • fringe = queue sorted by path cost g(n), from smallest to largest (i.e. a priority queue)

  33. Uniform-cost search

  34. Uniform-cost search • Complete? • Yes, if step cost ≥ ε • Time? • O(bceiling(C*/ ε)) where C* is the cost of the optimal solution • Space? • # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε)) • Optimal? • Yes – nodes expanded in increasing order of g(n) See book for detailed analysis.

  35. Depth-first search • Expand deepest unexpanded node • Implementation: • fringe = LIFO queue, i.e., put successors at front (i.e. a stack)

  36. Depth-first search • Expand deepest unexpanded node • Implementation: • fringe = LIFO queue, i.e., put successors at front

  37. Depth-first search • Expand deepest unexpanded node • Implementation: • fringe = LIFO queue, i.e., put successors at front

  38. Depth-first search • Expand deepest unexpanded node • Implementation: • fringe = LIFO queue, i.e., put successors at front

  39. Depth-first search • Expand deepest unexpanded node • Implementation: • fringe = LIFO queue, i.e., put successors at front

  40. Depth-first search • Expand deepest unexpanded node • Implementation: • fringe = LIFO queue, i.e., put successors at front

  41. This is the part that distinguishes different search algorithms

  42. Search Solution • Each node needs to keep track of its parent • Once the goal is found, traverse up the tree to the root to find the solution

  43. Properties of depth-first search • Complete? • No: fails in infinite-depth spaces • Yes: in finite spaces • Optimal? • No • Time? • O(bm): (m is max depth of state space) • terrible if m is much larger than d • but if solutions are plentiful, may be much faster than breadth-first • Space? • O(bm), i.e., linear space!

  44. Depth-limited search • depth-first search with depth limit l (i.e., don’t expand nodes past depth l) • … will fail if the goal is below the depth limit

  45. Iterative deepening search

  46. Iterative deepening search l=0

  47. Iterative deepening search l=1

  48. Iterative deepening search l=2

  49. Iterative deepening search l=3

More Related