Search Flashcards
What defines a search problem?
- initial state (e.g. London)
- sccuessor function (e.g. London->{Berlin, Rome})
- goal test (e.g. ex: are we in Paris? or impl: are we near a big tower?)
- path cost (e.g. km traveled)
What is a solution to a search problem?
A sequance of actions that leads us from the initial state to a goal state.
How do “Tree search algorithms” work?
- generating successors of already-explored states (expanding states)
- maintaining a list of states available for expansion (no closed list)
Implementation: sates vs. nodes what’s the difference?
- A state is a representation of a phisical configuration
- A node is a data structure constituting part of a search tree
it includes parent, children, depth, path cost
States do not have parents, children, depth, or path cost!
How do “Graph search algorithms” work?
- generating successors of already-explored states (expanding states)
- maintaining a list of states available for expansion and a list of already explored states (frontiet + closed list)
Search strategies…
- define the order of node expansion
Types of search strategies are…
- uninformed search: basic algorithms
- informed search: further information about solution costs (heuristics)
- local search: “historyless”, one-step change
Search strategies are evaluated by…
- completeness: does it always find a solution if one exists?
- time complexity: number of nodes generated/expanded
- space complexity maximum number of nodes in memory
- optimality: does it always find a least-cost solution?
BFS
Breadth-first search
- expand shallowest unexpanded node
- frontier is a FIFO queue
- goal test at generation
complete? Yes (if b is finite)
time? O(b^d)
space? O(b^d) every node is kept in memory
optimality? Yes (if cost = 1 per step); not optimal in general
UCS
Uniform-cost search
- expand least-cost unexpanded node
- frontier = queue ordered by cost, lowest first
- goal test at expansion => otherwise might miss better solution
complete? Yes, if step cost has a lower bound
time? O(b^(1+x))
space? O(b^(1+x))
optimal? Yes, goal test at expansion time ensures optimality
DFS
Depth-first search
- expand deepest unexpanded node
- frontier is a LIFO queue
complete? No, fails in infinte-depth spaces, spaces with loops
time? O(b^m) m … max depth
space? O(b*m), linear space!
optimality? No
DLS
Depth-limited search
- Depth-first search (DFS) with depth limitation, when reaching it report a cutoff
IDS
Iterative deepening search
- Depth-limited search + systematically increase depth limit => gain completeness
complete? Yes
time? O(b^d)
space? O(b*m), linear space!
optimality? Yes, if step cost = 1, modifiable to explore uniform-cost tree
Why IDS?
Iterative deepening search uses only linear space and not much more time than other uninformed algorithms.
Time: b/(b-1) * BFS