Sep 01, 2003 ------------- - Recap basic search algorithms - BFS and UCS - More search algorithms: Depth First Search (DFS) - uses a stack in place of a queue - primary advantage is its space complexity - problems: does not provide optimal solution - more problems: can go into an infinite loop - DFS features - time complexity: O(b^m) - space complexity: O(bm) - where m is the max depth of search tree - DBS: Depth Bounded Search - uses a limit "l" to prevent infinite loops - complete only if l is chosen large enough so that l >= d (but then need not be optimal) - if l < d, not complete - time complexity: O(b^l) - space complexity: O(bl) - Thus far - BFS and UCS are good for "guarantees" - DFS and DBS good for space complexity - DFID: Depth First Iterative Deepening - best of both worlds - DFID Details - performs a series of DBSs with increasing l - guaranteed to find solution and, - since at each time it is doing only a DFS, has the nice space complexity we want - time complexity: O(b^d) - space complexity: O(bd) - complete and optimal - Still.. - Q: won't DFID be wasting too much time expanding nodes over and over again? - A: not really, asymptotically the bulk of the work is really in the "last iteration" - Bidirectional search - Search 'from both directions' - at least one should be BFS (why?) - need fast lookup (indexing and constant time checking) - time complexity: O(b^(d/2)) - space complexity: O(b^(d/2)) - All search algorithms studied thus far can be categorized as - "uninformed search" - Informed search algorithms - e.g., "psychic search" - Psychic search - provides an evaluation function that somehow knows the true cost to goal - called a heuristic, or h(n) Using it in a search - Create the evaluation function f(n) as f(n) = g(n) + h*(n) - g(n): cost expended thus far (history/experience) - h(n): cost expeceted from now on (future/promise) - Example of psychic search on a graph - One simple psychic - make h(n) = 0 - reduces to BFS/UCS, which is complete and optimal