Search Algorithms Lecture
- 22Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
In the city block problem (City 1 to City n forward, then back to City 1 backward) with costs cij≥0, which search algorithms can be used?
Dynamic programming (with state extended to include direction) and uniform cost search.
Or swipe the card
22 cards
In the city block problem (City 1 to City n forward, then back to City 1 backward) with costs cij≥0, which search algorithms can be used?
Dynamic programming (with state extended to include direction) and uniform cost search.
Why can't depth-first search be used in the city block problem?
DFS requires all edge costs to be zero, but here cij≥0 and not necessarily zero.
Why can't breadth-first search be used in the city block problem?
BFS requires all edge costs to be identical (equal), which is not guaranteed here.
How can dynamic programming be applied to the city block problem despite possible cycles?
By extending the state to include both the city and the direction of travel (forward or backward), breaking the cycle.
Define state in the context of search problems.
A state is a summary of all past actions that is sufficient to choose future actions optimally.
List the components of a search problem formulation.
sstart, actions(s), cost(s,a), successor(s,a), and end(s).
Describe the uniform cost search (UCS) algorithm.
Maintain a priority queue (frontier) ordered by past cost. Pop the state with minimum cost. If it is an end state, return its cost. Otherwise, for each successor, update the frontier with cost = past cost + edge cost.
What is the correctness theorem for uniform cost search?
When a state s is popped from the frontier, its priority (past cost) is the minimum cost to reach s.
Compare dynamic programming and uniform cost search in terms of cycles, costs, and complexity.
DP: no cycles allowed, any costs (including negative), O(n); UCS: cycles allowed, costs must be non-negative, O(nlogn).
What is the inverse problem of search?
Given an optimal sequence of actions (path), learn the cost function that led to it.
Explain the update rule of the structured perceptron algorithm for learning action costs.
Initialize w=0. For each training example (true path y), compute predicted path y′ under current w. If y=y′, for each action a: if a∈y, w[a]←w[a]−1; if a∈y′, w[a]←w[a]+1.
In the transportation example with walking and tram, what is the result of structured perceptron with training data containing only walks?
The algorithm may not recover true costs (e.g., walk=1, tram=2) but finds weights that make walking optimal (e.g., walk=1, tram=3). The ratio matters, and missing data leads to underdetermined solution.
How does the structured perceptron generalize to state-dependent costs?
Cost is w⋅ϕ(s,a) where ϕ are features. Update: w←w−∑(s,a)∈true pathϕ(s,a)+∑(s,a)∈predicted pathϕ(s,a).
What is the key idea behind A* search?
Explores states in order of g(s)+h(s), where g(s) is past cost and h(s) is a heuristic estimate of future cost.
How is A* search implemented as a modification of uniform cost search?
Replace edge cost c(s,a) with c′(s,a)=c(s,a)+h(successor)−h(s) and run UCS on the modified costs.
Define a consistent heuristic.
A heuristic h is consistent if c(s,a)+h(s′)≥h(s) for all states s, actions a, and successor s′, and h(send)=0.
Why does A* return the optimal solution when using a consistent heuristic?
The sum of modified costs along any path equals the sum of original costs minus h(sstart), a constant, so the optimal path under modified costs is also optimal under original costs.
How does A* compare to UCS in terms of states explored?
A* explores states with g(s)<g(send)−h(s), while UCS explores states with g(s)<g(send). A* explores fewer states, especially when h is large.
What is an admissible heuristic?
A heuristic h is admissible if h(s)≤FutureCost(s) for all states s.
How are heuristics typically derived?
By relaxing the problem: removing constraints to create an easier problem whose optimal cost can be computed cheaply (e.g., closed form, DP, UCS).
Give an example of relaxation for a grid pathfinding problem with walls.
Remove all walls; the heuristic becomes Manhattan distance from current cell to goal.
How can a heuristic be computed for a problem where the relaxed problem is not trivial?
Solve the relaxed problem optimally for every state using DP or UCS (with a reverse graph), and use the resulting costs as heuristic values.

Ask anything
We've read this whole study set, so questions about it get the best answers.