110 likes | 207 Views
More on basic search methods. 2012/3/13. start. goal. B idirectional Search. search forward from the initial state generate successors to the current node search backward from the goal generate predecessors to the current node stop when two searches meet in the middle.
E N D
More on basic search methods 2012/3/13
start goal Bidirectional Search • search forward from the initial state • generate successors to the current node • search backward from the goal • generate predecessors to the current node • stop when two searches meet in the middle
Bidirectional Search (cont.) • Time? O(bd/2) • Space? O(bd/2) • Issues • Search strategy for each half ? • if all operators are reversible, predecessor(n) = successor(n) • Multiple goal states • construct a new dummy goal state whose immediate predecessors are all the actual goal states • Cost of checking if a node exists • implicit description of some possible large set of goal state • e.g., checkmate
Compare Uniformed Search Strategies • b: the branching factor • d: the depth of solution • m: the maximum depth of the search tree • l: the depth limit • superscript: a complete if b is finite; b complete if step cost c optimal if step costs are all identicald if both directions use BFS
Compare Uniformed Search Strategies (cont.) • Issue considered in selecting search strategies • size of the search space • depth of the solution • solution density • finite vs. infinite depth • any vs. all solutions • optimality? • predecessors?
Avoid Repeated States • Failure to detect repeated states can turn a linear problem into an exponential one! • Algorithms that forget their history are doomed to repeat it • trade-off between space and time
Avoid Repeated States (cont.) • Do not return to the previous state • Do not create paths with cycles • Do not generate the same state twice • store state in a hash table • check for repeated states
Graph Search • To modify Tree Search Algorithm by adding closed list • closed list: store every expanded node • open list: the fringe of unexpanded nodes function GRAPH-SEARCH (problems, fringe) returns a solution, or failure closed an empty set fringe INSERT(MAKE-NODE(INITIAL-STATE[problem]), fringe) loop do if EMPTY?( fringe) then return failure node REMOVE-FIRST( fringe) if GOAL-TEST[ problem](STATE[node]) then return SOLUTION(node) if STATE[node] is not in closedthen add STATE[node] to closed fringe INSERT-ALL(EXPAND(node, problem), fringe)
Search with Partial Information • Sensorless problem (conformant problem) • the agent is in one of possible initial states, and actions lead to one of possible successor states • Contingency problem • the environment is partially observable, or actions are uncertain • adversarial problem • the uncertainty is caused by another agent • Exploration problem • the states and actions of the environment are unknown
8 possible states Sensorless Problem • Vacuum world
Summary • Problem formulation usually requires abstracting away real-world details to define a state space that can feasibly be explored • Variety of uninformed search strategies • Iterative deepening search uses only linear space and not much more time than other uninformed algorithms