Search in AI
- 36Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is a reflex agent in AI?
An agent that chooses an action based on its current percept and possibly memory, but does not consider future consequences of its actions.
Or swipe the card
36 cards
What is a reflex agent in AI?
An agent that chooses an action based on its current percept and possibly memory, but does not consider future consequences of its actions.
What is a planning agent in AI?
An agent that considers the consequences of its actions by using a model of how the world evolves and a goal test. It asks 'what if' to decide which actions lead to desired outcomes.
What are the four components of a search problem?
- A set of states
- A successor function with actions and costs
- A start state
- A goal test
What is a solution to a search problem?
A sequence of actions (a plan) that transforms the start state into a goal state.
What is abstraction in the context of search problems?
Ignoring irrelevant details of the real world to create a simpler model that makes search feasible.
How does a search state differ from a world state?
A world state includes every last detail of the environment; a search state keeps only the details needed for planning.
What is a state space graph?
A mathematical representation of a search problem where nodes are states and arcs are successors. Each state appears exactly once.
What is a search tree?
A what-if tree rooted at the start state, where each node represents a path from the start to a state. Children correspond to successors, and states may repeat.
In the general tree search algorithm, what does the fringe contain?
The fringe is a set of partial plans (paths from the start state) that are candidates for expansion.
Describe the general tree search algorithm.
- Initialize fringe with start state.
- Loop:
- If fringe empty, return failure.
- Choose a leaf node from fringe (according to strategy).
- If node is goal, return solution.
- Else expand node and add resulting nodes to fringe.
Which data structure does depth-first search (DFS) use for the fringe?
A stack (last-in, first-out).
Is depth-first search complete?
No, unless the search space is finite or a depth limit is used to prevent infinite paths.
Is depth-first search optimal?
No, it finds the leftmost solution (or first found) regardless of path cost or depth.
What are the time and space complexities of depth-first search (DFS) when the maximum depth is m and branching factor is b?
Time: O(b^m) Space: O(b*m)
Which data structure does breadth-first search (BFS) use for the fringe?
A queue (first-in, first-out).
Is breadth-first search complete?
Yes, if a solution exists at a finite depth, BFS will find it.
Is breadth-first search optimal?
Yes, only if all actions have the same cost (e.g., unit costs). It finds the shallowest goal.
What are the time and space complexities of breadth-first search (BFS) when the shallowest solution depth is s and branching factor is b?
Time: O(b^s) Space: O(b^s)
When would you prefer depth-first search over breadth-first search?
When memory is limited, because DFS has space complexity O(b*m) compared to BFS's O(b^s).
What is iterative deepening search (IDS)?
A hybrid search that runs depth-first search with an increasing depth limit until the goal is found.
What are the time and space complexities of iterative deepening search (IDS) when solution depth is s and branching factor is b?
Time: O(b^s) Space: O(b*s)
Why is iterative deepening not as wasteful as it seems?
Because most nodes are at the deepest level; re-expanding shallow nodes adds only a constant factor overhead (approximately b/(b-1) times BFS's cost).
What data structure does uniform cost search (UCS) use for the fringe?
A priority queue ordered by cumulative path cost.
Is uniform cost search complete?
Yes, assuming every action has a positive cost (no zero-cost cycles).
Is uniform cost search optimal?
Yes, it finds the least-cost path.
What are the time and space complexities of uniform cost search (UCS) when the optimal cost is C* and the minimum arc cost is ε?
Time: O(b^{C*/ε}) Space: O(b^{C*/ε})
How does uniform cost search differ from breadth-first search?
UCS accounts for varying action costs by expanding nodes in order of cumulative cost, while BFS expands in order of depth (number of actions).
What does 'uninformed search' mean?
Uninformed search uses no information about the goal other than the goal test. The algorithm has no 'heuristic' to guide it towards the goal.
In the context of the lecture, what is the 'fringe' in tree search?
The set of partial plans (paths from the start) that have been generated but not yet expanded.
What are the three types of planning mentioned in the lecture?
Optimal planning, complete planning, and planning vs replanning.
Give an example of a state space component for Pac-Man pathfinding.
State: (x, y) coordinates of Pac-Man. Actions: North, South, East, West. Successor: updates coordinates. Goal test: (x, y) equals target location.
What additional information is needed for the state in 'eat all the dots' compared to simple pathfinding?
A boolean array indicating which dots remain (dot positions).
Why can the search tree be infinite even if the state space graph is finite?
Because each node in the search tree corresponds to a path from the start, and cycles in the state space graph produce infinitely many distinct paths.
In uniform cost search, when do you stop and return a goal node?
When the goal node is popped from the priority queue (i.e., when it is the cheapest node on the fringe).
What is the 'cost' in uniform cost search?
The cumulative cost of the path from the start state to the current state, summing the costs of all actions taken.
Compare DFS and BFS in terms of memory usage for a problem with branching factor 10 and solution at depth 5.
DFS uses roughly 10×5 = 50 nodes; BFS uses roughly 10^5 = 100,000 nodes.

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