Presentation is loading. Please wait.

Presentation is loading. Please wait.

Uninformed Search Strategies

Similar presentations


Presentation on theme: "Uninformed Search Strategies"— Presentation transcript:

1 Uninformed Search Strategies
What are the four things known in the problem definition?

2 Uninformed Search Strategies
What are the four things known in the problem definition? Start State Successor Functions Goal State Path Cost

3 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

4 With a neighbor List the type of search domain where breadth first is a good solution. A bad solution List the type of search domain where depth first sear is a good solution.

5 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

6 Properties of Breadth-First Search
Complete?? Yes (if b is finite) 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) Optimal?? Yes (if cost = 1 per step); not optimal in general Space is the big problem: can easily generate nodes at 10MB/sec, so 24hours = 860GB.

7 Properties of Breadth-First Search
Complete?? Yes (if b is finite) 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) Optimal?? Yes (if cost = 1 per step); not optimal in general Space is the big problem: can easily generate nodes at 10MB/sec, so 24hours = 860GB.

8 Problem Solving Agents

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

10 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??

11 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 

12 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  Time??

13 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  Time?? # of nodes with g  cost of optimal solution, O(b C*/) where C* is cost of optimal solution

14 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  Time?? # of nodes with g  cost of optimal solution, O(b C*/) where C* is cost of optimal solution Space??

15 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  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*/)

16 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  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*/) Optimal??

17 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  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*/) Optimal?? Yes – nodes expanded in increasing order of g(n)

18 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 Time?? O(bm): terrible if m is much larger than d but if solutions are dense, may be much faster than breadth-first Space?? O(bm), I.e., linear space! Optimal?? No

19 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 Time?? O(bm): : terrible if m is much larger than d but if solutions are dense, may be much faster than breadth-first Space?? O(bm), I.e., linear space! Optimal?? No

20 Depth-limited Search = depth-first search with depth limit L, i.e., nodes at depth L have no successors Recursive implementation:

21 Iterative Deepening Search

22 Iterative Deepening Search l = 0
Limit = 0

23 Iterative Deepening Search l = 1
Limit = 1

24 Iterative Deepening Search l = 2
Limit = 2

25 Iterative Deepening Search l = 3
Limit = 3

26 Properties of Iterative Deepening Search
Complete??

27 Properties of Iterative Deepening Search
Complete?? Yes Time??

28 Properties of Iterative Deepening Search
Complete?? Yes Time?? (d+1)b0 + db1 + (d-1)b2 + … + bd = O(bd) Space??

29 Properties of Iterative Deepening Search
Complete?? Yes Time?? (d+1)b0 + db1 + (d-1)b2 + … + bd = O(bd) Space?? O(bd) Optimal??

30 Properties of Iterative Deepening Search
Complete?? Yes Time?? (d+1)b0 + db1 + (d-1)b2 + … + bd = O(bd) Space?? O(bd) Optimal?? Yes, if step cost = 1 Can be modified to explore uniform-cost tree Numerical comparison for b=10 and d=5, solution at far right: N(IDS) = , , ,000 = 123,450 N(BFS) = , , , ,990 = 1,111,100

31 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.

32 Solution Depth Limited, l=3 Iterative Deepening
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

33 Summary of algorithms

34 PA #1 Light’s Out Turn off all of the lights.
But switching one light switches all lights immediately adjacent to it.

35 PA#1 You can play a version online at:

36 PA #1 READ the specific requirements
Can use any language that I can run in the labs. (But I strongly suggest python or Java). Should print an optimal path, the number of nodes considered so far, and the number of nodes in memory at the end. Must follow naming conventions listed in assignment. (File named LightsOut, method named search)

37 PA #1

38 PA #1


Download ppt "Uninformed Search Strategies"

Similar presentations


Ads by Google