UnInformed Search - PowerPoint PPT Presentation

About This Presentation
Title:

UnInformed Search

Description:

UnInformed Search What to do when you don t know anything – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 23
Provided by: uci58
Learn more at: https://ics.uci.edu
Category:

less

Transcript and Presenter's Notes

Title: UnInformed Search


1
UnInformed Search
  • What to do when you dont know anything

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
Depth First
  • Storage Stack
  • Add push
  • Select Pop
  • Not complete (if infinite or cycles, otherwise
    complete)
  • Not optimal
  • Time O(bm), space O(bm) where m is max depth.

9
Ex. DFS for Permutations of 3
  • Initial State lt-gt
  • Next State add to front, no repeats
  • Stack lt-gt
  • Next Stack lt1gt,lt2gt,lt3gt
  • Next Stack lt lt1,2gt, lt1,3gt, lt2gt, lt3gt etc
  • Trick encode states with legal operators
  • lt-gt ? lt-,1,2,3gt
  • How much memory? O(n2)

10
Breadth First
  • Memory Queue
  • Store add to end
  • Select take from the front
  • Properties
  • complete,
  • optimal min of steps
  • Time/Space Complexity
  • 1bb2bd b(d1) -1 / (b-1) O(bd)
  • Problem Exponential memory Size.

11
Ex. BFS for Permutations of 3
  • Init lt-gt
  • Queue lt-gt
  • Next Queue lt1gt, lt2gt, lt3gt
  • Next Queue lt2gt,lt3gt, lt1,2gt, lt1,3gt
  • So whats the big deal?
  • Space n!n for n! search.

12
Uniform Cost
  • Now assume edges have positive cost
  • Storage Priority Queue scored by path cost
  • or sorted list with lowest values first
  • Select- choose minimum cost
  • add maintains order
  • Check careful only check minimum cost for goal
  • Complete optimal
  • Time space like Breadth.

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

14
Watch the queue
  • R/0 // Path/path-cost
  • R-A/1, R-B/3
  • R-B/3, R-A-C/5
  • Note you dont test expanded node
  • You put it in the queue
  • R-B-C/4, R-A-C/5

15
Depth Limited
  • Depth First search with limit l
  • Algorithm change states not expanded if at depth
    k.
  • Complete no
  • Time O(bk)
  • Space O(bl)
  • Complete if solution ltl, but not optimal.

16
Iterative Deepening
  • Set l 0
  • Repeat
  • Do depth limited search to depth l
  • l l1
  • Until solution is found.
  • Complete Optimal
  • Time O(bd)
  • Space O(bd) when goal at depth d

17
Comparison Breadth vs ID
  • Branching Factor 10
  • Depth Breadth ID
  • 0 1 1
  • 1 11 12
  • 2 111
    123
  • 3 1111
    1234
  • 4 11111 12345

18
Bidirectional
  • Wont 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(bd/2) time if bf is b in both
    directions.

19
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)

20
Repeated States
  • Occurs whenever reversible operators
  • Occurs in many problems
  • Improvements
  • Do not return to k recent states
  • cheap and non-effective
  • Do not return to state on path
  • cycle checking Cheap and effective
  • Do not return to any seen state exponential
  • Memory costs increase for all algorithms

21
Algorithm Effects
  • Cycles
  • DFS incomplete fix cycle checking
  • IDS incomplete fix cycle checking
  • BFS still complete, but increased cost

22
Grid World
  • Start (0,0)
  • Goal (8,8)
  • Legal moves up, down, left, right
  • What happens to algorithms?
Write a Comment
User Comments (0)
About PowerShow.com