Presentation is loading. Please wait.

Presentation is loading. Please wait.

What to do when you don’t know anything know nothing

Similar presentations


Presentation on theme: "What to do when you don’t know anything know nothing"— Presentation transcript:

1 What to do when you don’t know anything know nothing
UnInformed Search What to do when you don’t know anything know nothing

2 What to know Be able to execute (by hand) an algorithm for a problem
Know the general properties Know the advantages/disadvantages Know the pseudo-code Believe you can code it

3 Assumptions of State-Space Model
Fixed number of operators Finite number of operators Known initial state Known behavior of operators Perfect Information Real World  Micro World What we can do.

4 Concerns State-space: tree vs graph?
Are states repeated? Completeness: finds a solution if one exists Time Complexity Space Complexity: Major problem Optimality: finds best solution Assume Directed Acyclic graphs (DAGS) no cycles Later: adding knowledge

5 General Search Algorithm
Current State = initial state While (Current State is not the Goal) Expand State compute all successors/ apply all operators Store successors in Memory Select a next State Set Current state to next If current state is goal: success, else failure

6 Derived Search Algorithms
Algorithm description incomplete What is “store in memory” What is “memory” What is “select” Different choices yield different methods.

7 Abstract tree for evaluation
Let T be a tree where each node has b descendants. B is the branching factor. Suppose that a goal lies at depth d. If goal is root, depth of solution is 0. Unlike in theory, tree usually generated dynamically.

8 Breadth First Memory = Queue Store = add to end
Select = take from the front Properties: complete, optimal: min of steps Time/Space Complexity = 1+b+b^2…+b^d = [b^(d+1) -1 ]/ (b-1) = O(b^d) Problem: Exponential memory Size.

9 Uniform Cost Now assume edges have positive cost
Storage = Priority Queue: scored by path cost or sorted list with lowest values first Select, add unchanged. Complete & optimal Time & space like Breadth.

10 Uniform Cost Example Root – A cost 1 Root – B cost 3 A -- C cost 4
B – C cost 1 C is goal state. Why is Uniform cost optimal? Expanded does not mean checked node.

11 Depth First Storage = Stack Add = push Select = Pop
Not complete (if infinite or cycles, otherwise complete) Not optimal Time: O(b^m), space O(bm) where m is max depth.

12 Depth Limited Depth First search with limit = l
Algorithm change: states not expanded if at depth k. Complete : no Time: O(b^k) Space: O(b*l) Complete if solution <=l, but not optimal.

13 Iterative Deepening Set l = 0 Repeat Until solution is found.
Do depth limited search to depth l l = l+1 Until solution is found. Complete & Optimal Time: O(b^d) Space: O(bd) when goal at depth d

14 Comparison Breadth vs ID
Branching Factor 10 Depth Breadth ID

15 Bidirectional Won’t work with most goal predicates
Needs identifiable goal states Needs reversible operators. Needs a good hashing functions to determine if states are the same. Then: O(b^d/2) time if bf is b in both directions.

16 Bidirectional Search Simple Case:
Initial State = {Start State+ Goal State} Operators: forward from start, backwards from goal Standard: Breadth in both directions Check: newly generated states intersect fringe. (can be expensive)

17 Repeated States Occurs whenever reversible operators
Occurs in many problems Improvements Do not return to state on path Do not return to k recent states Do not return to any seen state Memory costs increase for all algorithms

18 Grid World Start (0,0) Goal (8,8) Legal moves: up, down, left, right
What happens to algorithms?


Download ppt "What to do when you don’t know anything know nothing"

Similar presentations


Ads by Google