Week 2 (Chapter 2) - Solving Problems & Searching Flashcards
How to evaluate a search strategy?
Evaluate along the following dimensions:
- Completeness
- Time complexity
- Space complexity
- Optimality
In what way do we measure the time and space complexity of a strategy?
Time and space complexity are measured in terms of:
b - Maximum branching factor
d - Depth of least cost solution
m - Maximum depth of state space.
Properties of Breadth-first search?
Complete - Yes (if maximum branching factor is finite)
Time - O(b^d) - i.e. exponential in d
Space - O(b^d) - keeps every node in memory
Optimal - Yes (if cost = 1 per step); HOWEVER, in general = not optimal
b - Maximum branching factor
d - Depth of least cost solution
m - Maximum depth of state space.
What is the biggest problem for Breadth-first search?
Space complexity
Properties of uniform-cost search?
Complete - Yes, if step cost >= e
Time - # of nodes with g <= cost of optimal solution
Space - # of nodes with g <= cost of optimal solution
Optimal - Yes
e - epsilon (A REALLY SMALL FUCKING NUMBER)
g - cost of path
Properties of depth-first search?
Complete - No, fails in infinite-depth spaces, spaces with loops. If it is modified to avoid repeated states along path, can complete in finite spaces
Time - O(b^m), if m is lager than d, then time will be terrible, but dense, faster than bfs
Space - O(bm) i.e. linear
Optimal - No
b - Maximum branching factor
d - Depth of least cost solution
m - Maximum depth of state space.
How to modify depth-first search so it’s complete?
Modify to avoid repeated states along path
-> completes in finite spaces
What is iterative deepening search?
function Iterative-Deepening-Search( problem) returns a solution sequence \_\_inputs: problem, a problem
__for depth ← 0 to ∞ do
____result ← Depth-Limited-Search( problem, depth)
____if result ̸= cutoff then return result
__end
Properties of iterative deepening search?
Complete - Yes
Time - O(b^d)
Space - O(bd) - Linear
Optimal - Yes, if step cost = 1
Can iterative deepening be used to explore uniform cost tree?
Yes if modified
What is bidirectional search?
Search simultaneously forwards from the start point, and backwards from the goal, and stop when the two searches meet in the middle.
What is the problem(s) with bidirectional search?
- generate predecessors
- many goal states
- efficient check for node already visited by other half of the search
- what kind of search
Properties of bidirectional search
Complete - Yes
Time - O(b^(d/2))
Space - O(b^(d/2))
Optimal - Yes if done with correct strategy - e.g. breadth first