1 / 29

Uninformed Search Strategies

Uninformed Search Strategies. Uninformed strategies use only information available in the problem definition Breadth-first search Uniform-cost search Depth-first search Depth-limited search Iterative deepening search. Properties of Breadth-First Search. Complete?? Yes (if b is finite)

chet
Télécharger la présentation

Uninformed Search Strategies

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 Strategies • Uninformed strategies use only information available in the problem definition • Breadth-first search • Uniform-cost search • Depth-first search • Depth-limited search • Iterative deepening search

  2. Properties of Breadth-First Search • Complete?? Yes (if b is finite) • Optimal?? Yes (if cost = 1 per step); not optimal in general • Time?? 1 + b + b2 + b3 + … + bd + b(bd – 1)= O( bd+1 ), ie, exp. in d • Space?? O( bd+1 ) (keep every node in memory) • Space is the big problem: can easily generate nodes at 10MB/sec, so 24hours = 860GB.

  3. Uniform-cost Search • Expand least-cost unexpanded node • Implementation: • fringe = queue ordered by path cost • Equivalent to breadth-first if step costs all equal

  4. Uniform-cost Search • Expand least-cost unexpanded node • Implementation: • fringe = queue ordered by path cost • Equivalent to breadth-first if step costs all equal • Complete?? Yes, if step cost  • Optimal?? Yes – nodes expanded in increasing order of g(n) • Time?? # of nodes with g  cost of optimal solution, O(b C*/) where C* is cost of optimal solution • Space?? # of nodes with g  cost of optimal solution, O(b C*/)

  5. Properties of Depth-first Search • Complete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces • Optimal?? No • Time?? O(bm): terrible if m is much larger than dbut if solutions are dense, may be much faster than breadth-first • Space?? O(bm), I.e., linear space!

  6. Properties of Depth-first Search • Complete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces • Optimal?? No • Time?? O(bm): terrible if m is much larger than dbut if solutions are dense, may be much faster than breadth-first • Space?? O(bm), I.e., linear space!

  7. Depth-limited Search • = depth-first search with depth limit dl, i.e., nodes at depth l have no successors • Recursive implementation:

  8. Depth-limited Search • That works as long as d<dl. • Preferably d=dl • But how are you going to get that lucky?

  9. Iterative Deepening Search • That works as long as d<dl. • Preferably d=dl • But how are you going to get that lucky? • The answer… • Iterative deepening search

  10. Iterative Deepening Search

  11. Iterative Deepening Search l = 0 • Limit = 0

  12. Iterative Deepening Search l = 1 • Limit = 1

  13. Iterative Deepening Search l = 2 • Limit = 2

  14. Iterative Deepening Search l = 3 • Limit = 3

  15. Properties of Iterative Deepening Search • Complete??

  16. Properties of Iterative Deepening Search • Complete?? Yes

  17. Properties of Iterative Deepening Search • Complete?? Yes • Optimal??

  18. Properties of Iterative Deepening Search • Complete?? Yes • Optimal?? Yes, if step cost = 1

  19. Properties of Iterative Deepening Search • Complete?? Yes • Optimal?? Yes, if step cost = 1 • Time??

  20. Properties of Iterative Deepening Search • Complete?? Yes • Optimal?? Yes, if step cost = 1 • Time?? (d+1)b0 + db1 + (d-1)b2 + … + bd = O(bd)

  21. Properties of Iterative Deepening Search • Complete?? Yes • Optimal?? Yes, if step cost = 1 • Time?? (d+1)b0 + db1 + (d-1)b2 + … + bd = O(bd) • Space??

  22. Properties of Iterative Deepening Search • Complete?? Yes • Optimal?? Yes, if step cost = 1 • Time?? (d+1)b0 + db1 + (d-1)b2 + … + bd = O(bd) • Space?? O(bd)

  23. Seems inefficient, but it’s not • Numerical comparison for • b=10 • d=5 • solution at far right • N(BFS) = 10 + 100 + 1,000 + 10,000 + 100,000 + 999,990 = 1,111,100 • N(IDS) = 50 + 400 + 3,000 + 20,000 + 100,000 = 123,450

  24. Summary of algorithms

  25. So let’s try it again… • Consider a state space where the start state is number 1 and the successor function for state n returns two states, numbers 2n and 2n+1. • Suppose the goal state is 11. • List the order in which nodes will be visited in depth limited search with limit 4 • For iterative deepening.

  26. Solution • Depth Limited, l=3 • 1, 2, 4, 8, 16, 17, 9, 18, 19, 5, 10, 20, 21, 11 • Iterative Deepening • 1, 1, 2, 3, 1, 2, 4, 5, 3, 6, 7, 1, 2, 4, 8, 9, 5, 10, 11

  27. Programming Assignment #1 • Posted online – I will reference this in class

  28. Programming Assignment #1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 There are several “optimal” solutions 2, 8, 9, 15 or 15, 9, 8, 2 or 2, 15, 9, 8 …

  29. Programming Assignment #1 • Your language must be “approved” • Your deliverable must include a readme file about how to run your code in the WRT/ITTC labs. • Your code must take an input String describing the board • All on would be “1111111111111111” • Your final result should include the solution path, an indication of how many nodes were expanded (time) and how many nodes are still in memory (space)

More Related