🌍 Artificial Intelligence · subject

Artificial Intelligence Search and Optimization Syllabus

The Search and Optimization syllabus for Artificial Intelligence in full: 6 chapters and 27 topics, every one listed below, plus 50 Search and Optimization flashcards with answers.

6Chapters
27Topics
50Flashcards

Search and Optimization syllabus: all 6 chapters

Expand any chapter to see its topics and sub-topics.

  1. Uninformed Search Strategies

    5 topics
    • Breadth-First Search
    • Uniform-Cost Search
    • Depth-First and Depth-Limited Search
    • Iterative Deepening Search
    • Bidirectional Search
  2. Informed (Heuristic) Search

    4 topics
    • Greedy Best-First Search
    • A* Search
    • Memory-Bounded Heuristic Search
    • Designing Heuristics
  3. Local Search and Optimization

    5 topics
    • Hill-Climbing Search
    • Simulated Annealing
    • Local Beam Search
    • Genetic Algorithms
    • Continuous Space Optimization
  4. Search in Complex Environments

    3 topics
    • Searching with Nondeterministic Actions
    • Searching with Partial Observations
    • Online Search Agents
  5. Adversarial Search and Games

    5 topics
    • Minimax Algorithm
    • Alpha-Beta Pruning
    • Imperfect Real-Time Decisions
    • Stochastic and Partially Observable Games
    • Monte Carlo Tree Search
  6. Constraint Satisfaction Problems

    5 topics
    • Defining CSPs
    • Constraint Propagation
    • Backtracking Search
    • Local Search for CSPs
    • Structure of Problems

Artificial Intelligence Search and Optimization flashcards — 50 questions with answers

  1. What is the completeness, optimality, time complexity, and space complexity of Breadth-First Search (BFS)?

    BFS is complete (if branching factor $b$ is finite) and optimal (when all step costs are equal). Time and space complexity are both $O(b^{d})$, where $b$ is the branching factor and $d$ is the depth of the shallowest goal. Its large memory requirement is usually the bigger problem than its time.

  2. In Breadth-First Search, why is a node tested for the goal when it is generated rather than when it is selected for expansion?

    BFS applies the goal test to each node when it is generated (not when expanded), because all nodes at a given depth are expanded before any deeper node. Testing at generation lets BFS stop as soon as the shallowest goal is first produced, saving a full extra layer of expansion.

  3. What does Uniform-Cost Search expand, and what is the ordering criterion of its frontier?

    Uniform-Cost Search (UCS) expands the node with the lowest path cost $g(n)$ (cumulative cost from the start), using a priority queue ordered by $g(n)$. Unlike BFS, it optimizes for total path cost rather than number of steps.

  4. State the completeness and optimality conditions for Uniform-Cost Search, and give its complexity.

    UCS is complete and optimal provided every step cost is $\geq \epsilon > 0$. Its time and space complexity are $O\!\left(b^{1+\lfloor C^{*}/\epsilon \rfloor}\right)$, where $C^{*}$ is the cost of the optimal solution and $\epsilon$ is the minimum step cost. This can be much worse than $O(b^{d})$ because UCS may explore large trees of small steps.

  5. Why does Uniform-Cost Search apply the goal test when a node is selected for expansion rather than when generated?

    UCS delays the goal test until a node is chosen for expansion because a goal found early (on generation) may lie on a suboptimal path; a cheaper path to it may still be discovered. It also re-checks whether a better path to a frontier node has been found. This guarantees optimality.

  6. What are the completeness, optimality, time, and space complexities of Depth-First Search (DFS) in tree-search form?

    Tree-search DFS is not complete (can loop on infinite paths or repeated states) and not optimal. Time complexity is $O(b^{m})$ and space complexity is $O(bm)$, where $m$ is the maximum depth of the search tree. Its key advantage is linear memory use.

  7. What is Depth-Limited Search, and what problem does the depth limit introduce?

    Depth-Limited Search is DFS with a predetermined depth limit $\ell$: nodes at depth $\ell$ are treated as having no successors. It solves DFS's infinite-path problem but becomes incomplete if $\ell < d$ (goal deeper than the limit) and nonoptimal if $\ell > d$. Its complexities are $O(b^{\ell})$ time and $O(b\ell)$ space.

  8. How does Iterative Deepening Search (IDS) work, and why is its repeated regeneration of nodes acceptable?

    IDS runs Depth-Limited Search repeatedly with limits $\ell = 0, 1, 2, \dots$ until a goal is found. Repeated work is acceptable because in a tree with branching factor $b$, most nodes are in the bottom level, so regenerating the upper levels adds only a constant-factor overhead.

  9. State the completeness, optimality, and complexity of Iterative Deepening Search.

    IDS is complete (finite $b$) and optimal when step costs are all equal. Time complexity is $O(b^{d})$ and space complexity is $O(bd)$. It combines DFS's linear memory with BFS's completeness and shallow-goal optimality, making it the preferred uninformed method when the search space is large and depth unknown.

  10. What is Bidirectional Search and what is its main computational advantage?

    Bidirectional Search runs two simultaneous searches — one forward from the initial state and one backward from the goal — stopping when the frontiers meet. Its advantage is complexity roughly $O(b^{d/2})$ in time and space instead of $O(b^{d})$, since $b^{d/2} + b^{d/2}$ is far smaller than $b^{d}$.

  11. What are the main requirements and difficulties of implementing Bidirectional Search?

    It requires the ability to compute predecessors (to search backward) and an efficient way to test whether the two frontiers intersect (e.g., a hash table). Difficulties: defining the backward search when there are many goal states, and handling abstract or implicitly defined goals for which predecessors are hard to generate.

  12. What evaluation function does Greedy Best-First Search use, and is it optimal?

    Greedy Best-First Search expands the node that appears closest to the goal, using the evaluation function $f(n) = h(n)$, where $h(n)$ is the heuristic estimate of cost from $n$ to the goal. It is not optimal and, in tree-search form, not complete (can get stuck in loops); it ignores the cost already incurred, $g(n)$.

  13. Write the evaluation function used by A* Search and explain each term.

    A* uses $$f(n) = g(n) + h(n),$$ where $g(n)$ is the cost of the path from the start node to $n$, and $h(n)$ is the heuristic estimate of the cheapest cost from $n$ to a goal. Thus $f(n)$ estimates the cost of the cheapest solution through $n$.

  14. Define an admissible heuristic and state its role in A* optimality.

    A heuristic $h(n)$ is admissible if it never overestimates the true cost to reach the goal: $0 \leq h(n) \leq h^{*}(n)$, where $h^{*}(n)$ is the true optimal cost from $n$. Admissibility guarantees that A* using tree search is optimal, because $f(n)$ never overestimates the true cost of a solution through $n$.

  15. Define a consistent (monotonic) heuristic and give its defining inequality.

    A heuristic $h$ is consistent if for every node $n$ and every successor $n'$ generated by an action of cost $c(n, a, n')$: $$h(n) \leq c(n, a, n') + h(n').$$ This is a form of the triangle inequality. Consistency implies admissibility and guarantees A* with graph search is optimal, since $f$ is nondecreasing along any path.

  16. What does it mean that A* is optimally efficient, and what is the relationship between consistency and admissibility?

    A* is optimally efficient: no other optimal algorithm using the same heuristic $h$ is guaranteed to expand fewer nodes than A* (up to tie-breaking). Every consistent heuristic is admissible, but not every admissible heuristic is consistent; consistency is the stronger property needed for optimal graph search.

  17. In A*, what can you say about the $f$-costs of nodes expanded, and what is the C*-contour concept?

    With a consistent heuristic, A* expands nodes in nondecreasing order of $f$. A* expands all nodes with $f(n) < C^{*}$, some nodes with $f(n) = C^{*}$, and no nodes with $f(n) > C^{*}$, where $C^{*}$ is the optimal cost. These form 'contours' in the state space, analogous to UCS's uniform bands when $h = 0$.

  18. Name two memory-bounded heuristic search algorithms and describe how IDA* limits memory.

    Two memory-bounded variants are IDA* (Iterative-Deepening A*) and RBFS (Recursive Best-First Search); also SMA* (Simplified Memory-Bounded A*). IDA* uses linear memory by doing iterative deepening on the $f$-cost: the cutoff at each iteration is the smallest $f$-value that exceeded the previous cutoff, rather than a depth limit.

  19. How does Recursive Best-First Search (RBFS) achieve linear memory, and what is its main inefficiency?

    RBFS mimics best-first search using only linear space by recursively exploring the best path while keeping an $f\_limit$ equal to the best alternative $f$-value from an ancestor. When the current path exceeds $f\_limit$, it backs up and stores the best $f$-value of the forgotten subtree in its parent (backed-up value). Its inefficiency is excessive node regeneration when it repeatedly switches between promising paths.

  20. How does SMA* handle running out of memory during search?

    SMA* (Simplified Memory-Bounded A*) proceeds like A* until memory is full, then drops the worst leaf node (highest $f$-value), backing up its $f$-value to its parent so the forgotten subtree can be regenerated later if needed. It is complete and optimal if the optimal solution fits within available memory; otherwise it returns the best reachable solution.

Show the other 30 Search and Optimization flashcards
  1. When combining two admissible heuristics, which should you use, and why is the answer 'the maximum'?

    Given admissible heuristics $h_{1}$ and $h_{2}$, use $h(n) = \max\{h_{1}(n), h_{2}(n)\}$. The maximum is still admissible (never exceeds the true cost) and dominates each individual heuristic, so it expands no more nodes than either alone — a more accurate estimate that stays a valid lower bound.

  2. Define heuristic dominance and explain why a dominating heuristic is preferable.

    Heuristic $h_{2}$ dominates $h_{1}$ if $h_{2}(n) \geq h_{1}(n)$ for all nodes $n$, with both admissible. A dominating heuristic is preferable because it is closer to the true cost, so A* with $h_{2}$ never expands more nodes than with $h_{1}$ (aside from tie-breaking). Higher heuristic values mean better-informed, more efficient search.

  3. How can relaxed problems be used to design admissible heuristics?

    A relaxed problem is one with fewer restrictions on actions; the exact cost of an optimal solution to the relaxed problem is an admissible heuristic for the original. Because the relaxed problem's solution set is a superset, its optimal cost is a lower bound. Example: allowing an 8-puzzle tile to move to any square yields the misplaced-tiles heuristic; allowing moves to any adjacent square yields Manhattan distance.

  4. What is the effective branching factor $b^{*}$, and how is it used to compare heuristics?

    If A* generates $N$ nodes and finds a solution at depth $d$, the effective branching factor $b^{*}$ is the branching factor a uniform tree of depth $d$ would need to contain $N+1$ nodes: $$N + 1 = 1 + b^{*} + (b^{*})^{2} + \dots + (b^{*})^{d}.$$ A well-designed heuristic gives $b^{*}$ close to 1; it is a standard measure of heuristic quality.

  5. What is a pattern database, and how does it provide admissible heuristics?

    A pattern database stores exact solution costs for every possible configuration of a subset (pattern) of the problem's components (e.g., a subset of puzzle tiles), computed by backward search from the goal. Looking up the cost of the current subproblem gives an admissible heuristic, since solving the subproblem is a relaxation of solving the whole problem.

  6. Describe the Hill-Climbing (steepest-ascent) search algorithm.

    Hill-Climbing is a local search that keeps a single current state and repeatedly moves to the neighboring state with the highest objective (or lowest cost) value, terminating when no neighbor is better. It uses no search tree — only the current node and its immediate successors — so it uses very little memory but keeps no history.

  7. What three landscape features cause Hill-Climbing to fail, and name two variants that mitigate them.

    Hill-Climbing gets stuck at: (1) local maxima, (2) ridges (sequences of local maxima hard to navigate), and (3) plateaux/shoulders (flat regions). Mitigations include stochastic hill climbing, first-choice hill climbing, and random-restart hill climbing, which restarts from random states until a goal is found and is complete with probability approaching 1.

  8. Describe the Simulated Annealing algorithm and its acceptance rule for worse moves.

    Simulated Annealing combines hill climbing with random moves. At each step it picks a random neighbor; if it improves the objective (positive $\Delta E$) it is always accepted, otherwise it is accepted with probability $e^{\Delta E / T}$, where $\Delta E < 0$ is the change in value and $T$ is the temperature. $T$ starts high and is gradually lowered per a cooling schedule, so bad moves become less likely over time.

  9. In Simulated Annealing, what happens to behavior as temperature $T \to \infty$ and as $T \to 0$, and what does theory say about optimality?

    As $T \to \infty$, the acceptance probability $e^{\Delta E / T} \to 1$, so it behaves like a random walk; as $T \to 0$, worse moves are almost never accepted, so it behaves like greedy hill climbing. If $T$ is lowered slowly enough, Simulated Annealing finds the global optimum with probability approaching 1.

  10. How does Local Beam Search work, and how does it differ from running $k$ parallel random restarts?

    Local Beam Search keeps $k$ states at once. At each step it generates all successors of all $k$ states; if any is a goal it halts, otherwise it selects the $k$ best from the entire pool for the next round. Unlike $k$ independent restarts, information is shared: useful states attract search effort, so beams effectively abandon unpromising states and concentrate on productive regions.

  11. What is stochastic beam search, and what problem does it solve?

    Stochastic beam search selects the $k$ successors with probability proportional (increasing) to their objective value, rather than deterministically choosing the top $k$. This maintains diversity and prevents the $k$ states from clustering in a small region of the space — the concentration problem of plain local beam search — analogous to natural selection.

  12. Outline the main steps of a Genetic Algorithm.

    A Genetic Algorithm: (1) starts with a population of $k$ randomly generated individuals (states encoded as strings); (2) evaluates each with a fitness function; (3) selects parents with probability proportional to fitness; (4) applies crossover at a random crossover point to combine parent strings; (5) applies random mutation; (6) repeats over generations until a satisfactory individual or limit is reached.

  13. In Genetic Algorithms, define fitness function, crossover, and mutation.

    The fitness function rates each individual (higher = better) and biases selection. Crossover combines two parent strings by splitting each at a random point and exchanging the parts, producing offspring. Mutation randomly alters individual elements of a string with a small probability, introducing new genetic material and helping escape local optima.

  14. Why can crossover make Genetic Algorithms effective, and what is the role of the encoding/schema?

    Crossover is effective when the string encoding groups related components into contiguous blocks (schemata), so that useful sub-solutions (building blocks) are preserved and combined across individuals. If the representation is arbitrary, crossover just shuffles information randomly and offers little benefit over mutation-only stochastic beam search.

  15. In continuous-space optimization, what is the gradient, and state the gradient-ascent update rule.

    For an objective $f(\mathbf{x})$ over continuous variables, the gradient is the vector of partial derivatives $$\nabla f = \left( \frac{\partial f}{\partial x_{1}}, \frac{\partial f}{\partial x_{2}}, \dots, \frac{\partial f}{\partial x_{n}} \right).$$ Gradient ascent updates the state by $\mathbf{x} \leftarrow \mathbf{x} + \alpha \nabla f(\mathbf{x})$, where $\alpha$ is the step size (learning rate).

  16. What is the Newton–Raphson method for continuous optimization, and what does the Hessian represent?

    Newton–Raphson finds where the gradient is zero using the update $$\mathbf{x} \leftarrow \mathbf{x} - \mathbf{H}_{f}^{-1}(\mathbf{x})\, \nabla f(\mathbf{x}),$$ where $\mathbf{H}_{f}$ is the Hessian matrix of second partial derivatives, $H_{ij} = \frac{\partial^{2} f}{\partial x_{i} \partial x_{j}}$. The Hessian captures the local curvature, giving faster convergence than plain gradient methods near an optimum.

  17. What problems can arise with the step size $\alpha$ in continuous gradient-based optimization?

    If $\alpha$ (step size) is too small, convergence is very slow; if too large, the search overshoots the optimum and may diverge or oscillate. Techniques such as line search (adjusting $\alpha$ each step, e.g., doubling until $f$ stops improving) and using the Hessian help choose an effective step size.

  18. How is a search problem with nondeterministic actions represented, and what is a solution to it?

    With nondeterministic actions, each action can lead to several possible outcomes, described by a RESULTS function returning a set of states. The agent must reason about belief-like sets of contingencies. A solution is not a linear sequence but a contingency plan (conditional plan / strategy) with branches such as 'if state = s then action a else action b', accounting for every possible outcome.

  19. Describe the AND-OR search tree used for nondeterministic problems.

    An AND-OR tree has two node types: OR nodes, where the agent chooses one action (only one branch need succeed), and AND nodes, representing the environment's nondeterministic outcomes, where the plan must handle every branch (all must succeed). A solution is a subtree that has a goal node at every leaf, specifies one action at each OR node, and includes every branch at each AND node.

  20. What is a belief state, and how does the search space change under partial observability?

    A belief state is the set of physical states the agent believes it could currently be in, given its percept history. Under partial observability the agent searches in belief-state space rather than physical-state space; actions map belief states to belief states, and the goal is a belief state all of whose members are goal states.

  21. For a sensorless (conformant) problem, how are the initial belief state and the result of an action defined?

    In a sensorless problem the agent has no percepts, so the initial belief state is the set of all possible physical states. The predicted belief state after action $a$ is $b' = \{\, \text{RESULT}(s, a) : s \in b \,\}$ (the union of results over all states in the current belief state $b$). A solution is an unconditional action sequence leading to a belief state of only goal states.

  22. How does the prediction–observation update cycle work for search with partial observations?

    Each cycle has: (1) Prediction — compute the belief state from the action, $\hat{b} = \text{PREDICT}(b, a)$; (2) Observation Prediction — determine possible percepts; (3) Update — for a received percept $o$, filter to states consistent with it: $b' = \{\, s \in \hat{b} : o = \text{PERCEPT}(s) \,\}$. Percepts partition the predicted belief state and generally shrink it, reducing uncertainty.

  23. What distinguishes an Online Search Agent from an offline search agent?

    An offline agent computes a complete solution before acting in the real world. An online search agent interleaves computation and action: it takes an action, observes the resulting environment, then decides the next action. Online search is necessary in unknown environments (where the agent must explore to learn the map) and in dynamic or semidynamic domains where planning ahead fully is infeasible.

  24. What is the competitive ratio for an online search agent, and why might it be unbounded?

    The competitive ratio is the ratio of the total path cost the online agent actually incurs to the cost of the optimal path it could have taken with full knowledge of the space; smaller is better, with 1 being ideal. It can be infinite (unbounded) if the agent encounters dead ends or irreversible actions (irreversible states) from which the goal becomes unreachable, making no algorithm competitive in the worst case.

  25. How does Online DFS explore, and what environments does it require to be effective?

    Online DFS acts like depth-first search but physically moves: it tries untried actions from the current state, remembers outcomes, and when stuck it physically backtracks by taking the reverse action to a previous state. It works well only in state spaces where actions are reversible (safely explorable); it can fail badly with irreversible actions since it cannot 'teleport' back like offline DFS.

  26. What is the LRTA* (Learning Real-Time A*) algorithm, and how does it update heuristic estimates?

    LRTA* is an online agent that stores a table of current cost estimates $H(s)$ (initialized to $h(s)$). It moves to the neighbor with the lowest estimated cost-to-goal and then updates its estimate of the state just left to $$H(s) \leftarrow \min_{a} \big( c(s, a, s') + H(s') \big).$$ These updates make estimates more accurate (increasing them out of dead ends), so the agent eventually learns to reach the goal and improves over repeated trials.

  27. What is the Minimax algorithm, and what does the minimax value of a node represent?

    Minimax computes the optimal move in a two-player, zero-sum, perfect-information game assuming both players play optimally. The minimax value of a node is the utility (for MAX) of being in the corresponding state, given optimal play by both sides: MAX nodes take the maximum of children's values, MIN nodes take the minimum, and terminal nodes use the utility function.

  28. Give the recursive definition of the minimax value of a state.

    $$\text{MINIMAX}(s) = \begin{cases} \text{UTILITY}(s) & \text{if } s \text{ is terminal} \\ \max_{a} \text{MINIMAX}(\text{RESULT}(s,a)) & \text{if PLAYER}(s) = \text{MAX} \\ \min_{a} \text{MINIMAX}(\text{RESULT}(s,a)) & \text{if PLAYER}(s) = \text{MIN} \end{cases}$$ MAX maximizes utility while MIN minimizes it, alternating by whose turn it is.

  29. State the time and space complexity of the Minimax algorithm and its main practical limitation.

    Minimax performs a complete depth-first exploration of the game tree with time complexity $O(b^{m})$ and space complexity $O(bm)$ (or $O(m)$ if actions are generated one at a time), where $b$ is the number of legal moves and $m$ is the maximum depth. Its limitation is that $O(b^{m})$ is infeasible for real games (e.g., chess), motivating alpha–beta pruning and depth-limited evaluation functions.

  30. Compare Greedy Best-First Search and A* Search in terms of evaluation function, optimality, and typical efficiency.

    Greedy Best-First uses $f(n) = h(n)$, is not optimal and not always complete, but is often fast because it heads straight for the goal. A* uses $f(n) = g(n) + h(n)$, is complete and optimal with an admissible/consistent heuristic, and is optimally efficient — but may expand many more nodes and use more memory because it accounts for path cost so far.

Artificial Intelligence Search and Optimization FAQ

What is in the Artificial Intelligence Search and Optimization syllabus?

Artificial Intelligence Search and Optimization is split into 6 chapters: Uninformed Search Strategies, Informed (Heuristic) Search, Local Search and Optimization, Search in Complex Environments, Adversarial Search and Games and Constraint Satisfaction Problems. Together they contain 27 topics.

How many chapters are in Artificial Intelligence Search and Optimization?

6 chapters, containing 27 topics. The largest chapter is Uninformed Search Strategies, with 5 topics.

Are there flashcards for Artificial Intelligence Search and Optimization?

Yes — a 50-card Search and Optimization deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.