1 / 61

Uninformed Search (AIMA, Sections 3.3-3.4)

Introduction to Artificial Intelligence. Uninformed Search (AIMA, Sections 3.3-3.4). Alan M Frisch, Dimitar Kazakov kazakov@cs.york.ac.uk Department of Computer Science University of York. Outline for this Topic (2 lectures). What is search? What is uninformed search?

talon
Download Presentation

Uninformed Search (AIMA, Sections 3.3-3.4)

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. Introduction to Artificial Intelligence Uninformed Search(AIMA, Sections 3.3-3.4) Alan M Frisch, Dimitar Kazakov kazakov@cs.york.ac.uk Department of Computer Science University of York

  2. Outline for this Topic (2 lectures) • What is search? • What is uninformed search? • Five uniformed search algorithms • Breadth-first search (BFS) • Uniform-cost search (UCS) • Depth-first search (DFS) • Depth-limited search (DLS) • Iterative deepening search (IDS) • Handling repeated states

  3. What Is Search? • Given a problem representation, search is the process that builds some or all of the search tree for the representation in order to do one of the following: • If the search tree has one or more goals, identify one (or all of them) and the sequence of operators that produce each. • If the search tree has one or more goals, identify a least costly one and the sequence of operators that produces it. • If the search tree is finite and does not contain a goal, recognise this.

  4. Tree Search Algorithms • Basic idea: • offline, simulated exploration of state space by generating successors of already-explored states (a.k.a. ‘expanding’states)

  5. Tree Search Example

  6. Tree Search Example

  7. Tree Search Example

  8. Generic Search Algorithm General idea: maintain a list L containing the fringe nodes. • Set L to the list containing only the initial node of the problem representation. • While L is not empty do • Pick a node n from L. • If n is a goal node, stop and return it along with the path from the initial node to n. • Otherwise, remove n from L expand n to generate its children add to L all children of n • Return fail

  9. Implementation: states vs. nodes • A state is a (representation of) a physical configuration • A node is a data structure constituting part of a search tree includes state, parent node, action, path cost g(x), depth • The Expand function creates new nodes, filling in the various fields and using the Successorfunction of the problem representation to create the corresponding states.

  10. Search Algorithms: Informed vs Uninformed • Search algorithms differ by how they pick which node to expand. • Uniformed Search Algorithms: In making this decision, these look only at the structure of the search tree and not at the states inside the nodes. • AKA blind search algorithms. • This unit examines 5 of these • Informed Search Algorithms: In making this decision these look at the states inside the nodes. • AKA heuristic search algorithms. • Unit 6 (Advanced Search) examines these.

  11. Evaluating Search Strategies • Strategies are evaluated along the following dimensions: • completeness: does it always find a solution if one exists? • time complexity: number of nodes generated(not expanded) • space complexity: maximum number of nodes in memory • optimality: does it always find a least-cost solution? • Time and space complexity are measured in terms of • b: maximum branching factor of the search tree • d: depth of the least-cost solution (root is depth 0) • m: maximum depth of the state space (may be ∞)

  12. Breadth-First Search

  13. Breadth-First Search • Expand shallowest unexpanded node

  14. Breadth-First Search: Example

  15. Breadth-First Search: Example

  16. Breadth-First Search: Example

  17. Breadth-First Search: Example

  18. Breadth-First Search: Implementation • Expand shallowest unexpanded node • Implementation: ?

  19. Breadth-First Search: Implementation • Expand shallowest unexpanded node • Implementation: fringe is a FIFO queue, so new nodes go at end, nodes selected from front

  20. Properties of breadth-first search if b is constant • Complete? Yes (if b is finite) • Time? 1+b+b2+b3+… +bd = O(bd+1) = O(b. bd) = O(bd) • Space? O(bd+1) or O(bd) - if only fringe is in memory • Optimal? Yes, if all operators have the same cost. • Space is the bigger problem (more than time) What if we want to find the optimal solution and operators have different costs?

  21. Uniform-Cost Search

  22. Uniform-cost search • Expand least-cost unexpanded node • Implementation?

  23. Uniform-cost search • Expand least-cost unexpanded node • Implementation:fringe is queue ordered by increasing path cost. Nodes selected from front.

  24. Properties of Uniform-cost search • Equivalent to breadth-first if step costs all equal • Complete? Yes, if step cost ≥ ε • Time? # of nodes with g ≤ cost of optimal solution, O(bceiling(C*/ ε)) where C* is the cost of the optimal solution. Or O(bd). • Space? # of nodes with g≤ cost of optimal solution, O(bceiling(C*/ ε)). Or O(bd). • Optimal? Yes, since nodes are expanded in increasing order of g(n)

  25. Depth-First Search

  26. Depth-first search • Expand deepest unexpanded node

  27. Depth-First Search: Example • Expand deepest unexpanded node

  28. Depth-First Search: Example • Expand deepest unexpanded node

  29. Depth-First Search: Example • Expand deepest unexpanded node

  30. Depth-First Search: Example • Expand deepest unexpanded node

  31. Depth-First Search: Example • Expand deepest unexpanded node

  32. Depth-First Search: Example • Expand deepest unexpanded node

  33. Depth-First Search: Example • Expand deepest unexpanded node

  34. Depth-First Search: Example • Expand deepest unexpanded node

  35. Depth-First Search: Example • Expand deepest unexpanded node

  36. Depth-First Search: Example • Expand deepest unexpanded node

  37. Depth-First Search: Example • Expand deepest unexpanded node

  38. Depth-First Search: Example • Expand deepest unexpanded node

  39. Depth-first search: Implementation • Expand deepest unexpanded node • Implementation: ?

  40. Depth-first search: Implementation • Expand deepest unexpanded node • Implementation: Fringe is a LIFO queue, so new nodes are put at front and nodes removed from front.

  41. Properties of depth-first search • Complete? No: could run forever without finding solution in trees with infinite-depth. Complete in finite spaces. • Time?O(bm): terrible if m is much larger than d (especially if m = ∞) • but if solutions are dense, may be much faster than breadth-first • Space?O(bm), i.e., linear space! • Optimal? No

  42. Depth-Limited Search

  43. Depth-limited search • depth-first search with depth limit l. That is, nodes whose depth is greater than l are ignored. • Implementation: same as depth-first search but if a node has depth l then it is not expanded.

  44. Properties of depth-limited search • Complete?No: solution not found if d>l • Time? O(bl) • Space? O(bl), i.e., linear space! • Optimal? No.

  45. Iterative Deepening Search

  46. Iterative deepening search • To overcome incompleteness of depth-limited search, if no solution is found, redo the search with an increased depth limit. • Implementation: set l to 0 do perform depth-limited search with limit l increment l until solution found or no nodes at depth l have children

  47. Iterative deepening search: l =0

  48. Iterative deepening search: l =1

  49. Iterative deepening search: l =2

  50. Iterative deepening search: l =3

More Related