Informed Search — Quick Revision Notes
GATE Relevance: High
Condensed revision notes for the entire Informed Search chapter. Designed for quick review before exams — print-friendly and scannable.
1. Formula Reference
- A* evaluation: f(n) = g(n) + h(n)
- Greedy BFS evaluation: f(n) = h(n)
- Admissibility condition: h(n) ≤ h*(n) for all n (never overestimates)
- Consistency (monotonicity): h(n) ≤ c(n, n′) + h(n′) for every successor n′ of n
- Consistency ⇒ Admissibility (but NOT vice versa)
- SA acceptance probability: P(accept) = e−ΔE/T where ΔE = new_cost − current_cost > 0
- IDA* next threshold: min{f(n) : f(n) > current threshold}
- Dominance: h2 dominates h1 iff h2(n) ≥ h1(n) ∀n and both are admissible
- Max heuristic: h(n) = max(h1(n), h2(n)) is admissible if both are admissible
- GA fitness proportional selection: P(i) = fitness(i) / Σ fitness(j)
2. Algorithm Quick Summaries
A* Search
- Idea: Best-first search with f(n)=g(n)+h(n). Expands node with lowest f.
- Data structure: Priority queue (min-heap) ordered by f.
- Complete: Yes (finite branching factor, step cost ≥ ε > 0).
- Optimal: Tree search with admissible h. Graph search with consistent h.
- Time: O(bd) worst case. Exponential in [h*(n) − h(n)].
- Space: O(bd) — stores all generated nodes.
- Key property: Never expands a node with f(n) > C*.
Greedy Best-First Search
- Idea: Expands node closest to goal: f(n)=h(n). Ignores path cost.
- Complete: No in general (loops in tree search). Yes in finite spaces with graph search.
- Optimal: No.
- Time: O(bm) worst case. Good heuristic helps greatly.
- Space: O(bm).
IDA* (Iterative Deepening A*)
- Idea: DFS with f-cost cutoff. Iterate with increasing thresholds.
- Space: O(b·d) — linear! Same as DFS.
- Complete & Optimal: Yes (same conditions as A*).
- Threshold update: Next = min f-value that exceeded current threshold.
- Best for: Problems where memory is the bottleneck.
RBFS (Recursive Best-First Search)
- Idea: Simulates best-first search using O(b·d) space. Backtracks when current path’s f exceeds the best alternative.
- Space: O(b·d).
- Complete & Optimal: Yes (with admissible h).
- Drawback: Excessive re-generation of nodes (thrashing).
SMA* (Simplified Memory-Bounded A*)
- Idea: A* that drops the worst leaf when memory is full. Backs up forgotten node’s f-value to parent.
- Space: Uses all available memory.
- Complete & Optimal: Yes, if the solution fits in memory.
- Drawback: Can thrash if many nodes have similar f-values.
Hill Climbing
- Idea: Always move to the best neighbour. No backtracking. “Like climbing Everest in fog with amnesia.”
- Complete: No (local maxima, plateaux, ridges).
- Optimal: No.
- Variants: Steepest-ascent, stochastic, first-choice, random-restart.
- Random-restart: Complete with probability approaching 1.
Simulated Annealing (SA)
- Idea: Hill climbing + random downhill moves controlled by temperature T.
- Accept worse move: P = e−ΔE/T. High T ⇒ random walk. T→0 ⇒ hill climbing.
- Cooling schedule: T decreases over time (e.g., T × 0.95 each step).
- Theoretical guarantee: Finds global optimum if T decreases slowly enough (but may take infinite time).
Genetic Algorithms (GA)
- Idea: Population-based search inspired by natural selection.
- Operators: Selection, crossover (recombination), mutation.
- Selection: Fitness-proportional (roulette wheel), tournament, rank-based.
- Crossover: Single-point, two-point, uniform.
- Mutation: Random perturbation with small probability.
- Properties: Stochastic, can escape local optima, good for large search spaces.
3. Algorithm Comparison Table
| Algorithm | f(n) | Complete? | Optimal? | Time | Space |
|---|---|---|---|---|---|
| Greedy BFS | h(n) | No* | No | O(bm) | O(bm) |
| A* | g(n)+h(n) | Yes | Yes† | O(bd) | O(bd) |
| IDA* | g(n)+h(n) | Yes | Yes† | O(bd) | O(b·d) |
| RBFS | g(n)+h(n) | Yes | Yes† | Exponential | O(b·d) |
| SMA* | g(n)+h(n) | Yes‡ | Yes‡ | Depends | Set by user |
| Hill Climbing | h(n) only | No | No | O(∞) | O(1) |
| Simulated Annealing | h(n) + random | Probabilistic | Probabilistic | Depends | O(1) |
| Genetic Alg. | Fitness | No | No | Depends | O(pop × n) |
* Complete in finite spaces with graph search. † With admissible h (tree search) or consistent h (graph search). ‡ If the solution fits in memory.
4. Key Definitions
- Heuristic h(n): Estimate of cost from n to the nearest goal. h(goal) = 0.
- Admissible: h(n) ≤ h*(n). Never overestimates. Required for A* tree search optimality.
- Consistent (Monotone): h(n) ≤ c(n,n′) + h(n′). Triangle inequality. Required for A* graph search optimality.
- Dominance: h2 dominates h1 if h2(n) ≥ h1(n) for all n. More informed ⇒ fewer expansions.
- Relaxed problem: Fewer constraints than original. The optimal cost of a relaxed problem provides an admissible heuristic.
- Pattern database: Precomputed lookup table of exact costs for subproblems. Provides admissible heuristics.
- Local search: Operates on a single current state. No systematic exploration. Suitable for optimisation problems.
5. Heuristic Design Tips
- Relaxation method: Remove constraints from the problem → solve relaxed version → cost = admissible heuristic.
- 8-puzzle example: Remove “can only slide into blank” → misplaced tiles. Remove “must slide” → Manhattan distance.
- Max of heuristics: max(h1, h2, …, hk) is admissible if all are admissible. Always use this!
- Pattern databases: Precompute exact solutions for subsets of the problem (e.g., corner tiles in 15-puzzle).
- Linear combination: α·h1 + β·h2 is admissible if α+β ≤ 1 and both are admissible (but this is usually weaker than max).
- Learning heuristics: Train on solved instances to learn h(n) that approximates h*(n).
6. Mnemonics & Memory Aids
- “A* = g + h, Greedy = just h” — The g(n) term is what makes A* optimal.
- “Consistency ⇒ Admissibility, not the other way” — Think “ConAd” (consistency is the stronger condition).
- “CAG” = Consistency for A* Graph search. “AAT” = Admissibility for A* Tree search.
- “Higher h ⇒ fewer nodes” — More informed heuristic = more pruning. But never exceed h*(n)!
- “Hill Climbing = 3 Problems: LPR” — Local maxima, Plateaux, Ridges.
- “SA = HC + Randomness” — SA is hill climbing that sometimes goes downhill, controlled by temperature.
- “IDA* = DFS + f-cutoff” — Iterative deepening but with f-value thresholds instead of depth limits.
- “e−1 ≈ 0.37” — Quick reference for SA probability calculations. e−0.5 ≈ 0.61, e−2 ≈ 0.14.
7. Common GATE Traps
- Trap 1: “A* is always optimal” — Only with admissible h (tree search) or consistent h (graph search). Without these conditions, A* may return suboptimal paths.
- Trap 2: “Admissible = Consistent” — False. Consistency is strictly stronger. GATE loves to test this.
- Trap 3: Confusing tree search vs graph search. In graph search with an admissible (but not consistent) heuristic, A* may not be optimal without re-opening nodes.
- Trap 4: “Greedy BFS is complete” — Only with graph search in finite spaces. Tree search Greedy can cycle forever.
- Trap 5: Multiplying an admissible heuristic by a constant > 1 usually destroys admissibility (creates weighted A*, which is not standard optimal).
- Trap 6: IDA* threshold is the minimum exceeded f-value, not the average or maximum.
- Trap 7: Hill climbing problems — don’t list “exponential time”; that’s a feature (it’s fast), not a bug. The problems are local maxima, plateaux, and ridges.
- Trap 8: SA “guarantees optimal” — only theoretically with an infinitely slow cooling schedule. In practice, no guarantee.
8. When to Use Each Algorithm
- A*: Default choice when optimality is required and memory is available. Good heuristic is key.
- IDA*: When memory is limited but you still need optimality (e.g., 15-puzzle).
- RBFS: Similar to IDA* but avoids some re-exploration. Use when each iteration of IDA* wastes too much work.
- SMA*: When you have a fixed memory budget and want the best possible search within it.
- Greedy BFS: When you need a quick (possibly suboptimal) answer and the heuristic is reliable.
- Hill Climbing: Optimisation problems where you need a good (not necessarily optimal) solution quickly.
- SA: Optimisation with many local optima. Willing to spend time for a better solution than HC.
- GA: Large, complex search spaces. No gradient information. Multiple good solutions needed.
9. GATE Quick Tips
- A* trace questions: Always maintain an explicit open list table with columns: Node, g, h, f. Sort by f at each step.
- Heuristic admissibility: To prove — show it’s a relaxed problem cost. To disprove — find ONE counter-example.
- SA calculations: Memorise e−0.5≈0.61, e−1≈0.37, e−2≈0.14. GATE won’t ask for harder exponentials.
- Dominance shortcut: If h2 ≥ h1 for all nodes and both are admissible, A*(h2) expands ≤ nodes of A*(h1).
- Check the question: “Tree search” vs “Graph search” changes the answer for optimality conditions. Read carefully!
10. One-Page Summary
- Informed search uses heuristic functions to guide exploration toward the goal.
- A* is the gold standard: complete, optimal (with admissible/consistent h), but memory-hungry.
- IDA*, RBFS, SMA* are memory-efficient alternatives that preserve A*’s guarantees.
- Greedy BFS is fast but provides no guarantees — incomplete and suboptimal in general.
- Admissibility = never overestimate. Consistency = triangle inequality. Consistency ⇒ admissibility.
- Heuristic quality matters: higher (but still admissible) h ⇒ fewer node expansions. Use max of multiple heuristics.
- Local search (Hill Climbing, SA, GA) for optimisation: fast, low memory, but generally no completeness or optimality guarantees.
- SA escapes local optima using temperature-controlled random moves: P = e−ΔE/T.
- For GATE: memorise the comparison table, understand admissibility vs consistency, and practice A* trace questions.
References
- Russell & Norvig, Artificial Intelligence: A Modern Approach, Chapter 3 (Sections 3.5–3.6) & Chapter 4 (Sections 4.1–4.2).
- Hart, Nilsson & Raphael (1968). “A Formal Basis for the Heuristic Determination of Minimum Cost Paths.”
- Korf, R. E. (1985). “Depth-First Iterative-Deepening.” Artificial Intelligence, 27(1).