Uninformed Search — Quick Revision Notes
GATE Relevance: High
Condensed revision notes for the entire Uninformed Search chapter. Designed for quick review before exams — print-friendly and scannable.
1. Key Definitions
- Search Problem: Defined by (Initial State, Actions, Transition Model, Goal Test, Path Cost).
- State Space: The set of all states reachable from the initial state by any sequence of actions.
- Frontier (Open List): Set of nodes discovered but not yet expanded.
- Explored Set (Closed List): Set of nodes already expanded (used in graph search).
- Branching Factor (b): Maximum number of successors of any node.
- Depth (d): Depth of the shallowest goal node.
- Maximum Depth (m): Maximum depth of any node in the search tree.
- Complete: Guaranteed to find a solution if one exists.
- Optimal: Guaranteed to find the least-cost solution.
- Uninformed (Blind): Uses only information available in the problem definition — no heuristic.
2. Algorithm Quick Summaries
Breadth-First Search (BFS)
- Data structure: FIFO Queue
- Strategy: Expand shallowest unexpanded node first
- Complete: Yes (if b is finite)
- Optimal: Yes, only if all step costs are equal (unit cost)
- Time: O(bd)
- Space: O(bd) — stores entire frontier
- Goal test: Typically on generation (early goal test)
Depth-First Search (DFS)
- Data structure: LIFO Stack (or recursion)
- Strategy: Expand deepest unexpanded node first
- Complete: No (tree search); Yes for graph search on finite spaces
- Optimal: No
- Time: O(bm) — may explore entire tree
- Space: O(b·m) — stores one path + siblings
- Best for: Memory-constrained problems where any solution suffices
Depth-Limited Search (DLS)
- Data structure: Stack with depth limit L
- Strategy: DFS that stops at depth L
- Complete: No (solution may be deeper than L)
- Optimal: No
- Time: O(bL)
- Space: O(b·L)
- Returns: solution, failure, or cutoff (depth limit reached)
Iterative Deepening DFS (IDDFS)
- Data structure: Repeated DLS with limits 0, 1, 2, …
- Strategy: Run DLS(0), DLS(1), DLS(2), … until solution found
- Complete: Yes
- Optimal: Yes (with unit step costs)
- Time: O(bd) — same order as BFS
- Space: O(b·d) — linear!
- Overhead: b/(b−1). For b=10, only ~11% extra work
- Preferred uninformed method when depth is unknown and costs are uniform
Uniform Cost Search (UCS)
- Data structure: Priority Queue (min-heap on g(n))
- Strategy: Expand node with lowest cumulative path cost g(n)
- Complete: Yes (if step cost ≥ ε > 0)
- Optimal: Yes (if step cost ≥ ε > 0)
- Time: O(b1+⌊C*/ε⌋) where C* = optimal solution cost
- Space: O(b1+⌊C*/ε⌋)
- Goal test: On expansion (late goal test) — ensures cheapest path found first
- Note: Reduces to BFS when all step costs are equal
Bidirectional Search
- Data structure: Two BFS frontiers (from start and goal)
- Strategy: Expand from both ends; stop when frontiers intersect
- Complete: Yes (if both directions use BFS)
- Optimal: Yes (with unit costs and BFS in both directions)
- Time: O(bd/2)
- Space: O(bd/2)
- Requirements: Explicit goal state + reversible operators
3. Master Comparison Table
| Strategy | Complete? | Optimal? | Time | Space | Data Structure |
|---|---|---|---|---|---|
| BFS | Yes1 | Yes2 | O(bd) | O(bd) | FIFO Queue |
| DFS | No | No | O(bm) | O(b·m) | LIFO Stack |
| DLS | No | No | O(bL) | O(b·L) | Stack + limit |
| IDDFS | Yes | Yes2 | O(bd) | O(b·d) | Repeated DLS |
| UCS | Yes3 | Yes3 | O(b1+⌊C*/ε⌋) | O(b1+⌊C*/ε⌋) | Priority Queue |
| Bidirectional | Yes | Yes2 | O(bd/2) | O(bd/2) | Two Queues |
1 if b is finite. 2 if step costs are uniform. 3 if step cost ≥ ε > 0.
4. Formula Quick Reference
- Nodes in a complete tree of depth d: ∑i=0d bi = (bd+1 − 1) / (b − 1)
- BFS nodes expanded (early goal test): (bd − 1) / (b − 1)
- BFS nodes generated: (bd+1 − 1) / (b − 1)
- IDDFS total nodes generated: (d+1)·1 + d·b + (d−1)·b2 + … + 1·bd
- IDDFS overhead factor: b / (b − 1) — e.g., b=10 gives 10/9 ≈ 1.11
- Bidirectional speedup: bd → 2 · bd/2 (exponential reduction)
- UCS expands all nodes with g(n) < C* before the goal node
5. Mnemonics & Memory Aids
💡 “BFS = Broad & Fat, DFS = Deep & Thin”
BFS explores broadly (wide frontier, high memory). DFS explores deeply (thin path, low memory).
💡 Data Structure Mnemonic: “BFS = Queue (Both start with consonants), DFS = Stack (Both have 'S')”
BFS → Queue (FIFO). DFS → Stack (LIFO). UCS → Priority Queue (sorted by cost).
💡 IDDFS = “I Do DFS, Smartly”
IDDFS combines DFS space efficiency with BFS completeness. Think of it as “smart DFS” — it tries all depths systematically.
💡 Completeness Check: “BUI are Complete”
BFS, UCS, IDDFS are complete (with their respective conditions). DFS and DLS are NOT.
💡 Optimality: “Unit costs? BFS/IDDFS. Variable costs? UCS only.”
For uniform step costs, BFS and IDDFS are optimal. For variable step costs, only UCS guarantees optimality among uninformed strategies.
6. Important Theorems & Properties
- Theorem (BFS Optimality): BFS finds the shallowest goal. It is optimal if and only if path cost is a non-decreasing function of depth (e.g., all step costs are equal).
- Theorem (UCS Optimality): UCS is optimal and complete provided every step cost satisfies c(s,a,s′) ≥ ε for some fixed ε > 0.
- Theorem (IDDFS Optimality): IDDFS is asymptotically optimal for unit-cost problems. Its time complexity is O(bd), same order as BFS, despite repeated iterations.
- Property (Graph vs. Tree Search): Graph search (with explored set) prevents re-expansion of states, making DFS complete on finite state spaces. However, it uses O(|V|) extra space.
- Property (UCS = Dijkstra): UCS is equivalent to Dijkstra’s single-source shortest path algorithm. If you know Dijkstra’s, you know UCS.
7. Common Mistakes to Avoid
- ❌ “BFS is always optimal” — Only with unit step costs. For variable costs, use UCS.
- ❌ “DFS space is O(m)” — It’s O(b·m), not O(m). You must store siblings at each level.
- ❌ “DFS is complete” — Tree-search DFS can loop forever. Only graph-search DFS on finite spaces is complete.
- ❌ “IDDFS is very wasteful” — The overhead is only b/(b−1), which is ≤ 2 for b≥2 and ~11% for b=10.
- ❌ “UCS works with zero-cost edges” — UCS requires ε > 0 minimum cost. Zero-cost cycles break completeness.
- ❌ Confusing “expanded” vs. “generated” — Generated = added to frontier. Expanded = removed from frontier and successors generated. BFS with early goal test checks on generation.
- ❌ “Bidirectional search always works” — Requires explicit goal state and reversible operators. Cannot be used with abstract goal tests.
8. When to Use Each Strategy
| Strategy | Use When | Avoid When |
|---|---|---|
| BFS | Small state space, unit costs, need shortest path | Large/deep state space (memory explosion) |
| DFS | Any solution is fine, memory is tiny, many solutions exist | Need optimal solution, infinite depth possible |
| DLS | Known maximum solution depth | Unknown depth (risk missing solution) |
| IDDFS | Unknown depth, limited memory, unit costs, need optimal | Variable step costs (use UCS instead) |
| UCS | Variable step costs, need optimal path | Unit-cost problems (overkill; use BFS/IDDFS) |
| Bidirectional | Explicit goal, reversible operators, very large space | Abstract goal test, irreversible actions |
9. GATE Exam Tips
- Most frequently tested: Comparison table properties (completeness, optimality, complexity).
- Common question type: “How many nodes does X expand?” — Always clarify if goal test is on generation or expansion.
- NAT trap: IDDFS node count questions. Sum nodes across all iterations, not just the last one.
- MCQ trap: “Which is optimal?” — Remember the conditions (unit cost for BFS/IDDFS, ε>0 for UCS).
- Trace questions: Maintain an explicit frontier on paper. For DFS, use a stack; for BFS, use a queue; for UCS, use a sorted list.
- Shortcut: For b=2, d=n: BFS generates 2n+1−1 nodes. For IDDFS overhead: multiply by b/(b−1).
- Time saver: If the question says “all edges have weight 1”, you can use BFS instead of UCS.
10. One-Page Summary
- 6 strategies: BFS, DFS, DLS, IDDFS, UCS, Bidirectional.
- IDDFS is the preferred uninformed method — complete, optimal (unit costs), O(b·d) space.
- UCS is the only uninformed method optimal for variable costs (equivalent to Dijkstra’s).
- Bidirectional gives O(bd/2) but needs explicit goal + reversible operators.
- DFS is space-efficient but incomplete and non-optimal.
- All uninformed methods are blind — they don’t use domain-specific heuristics (that’s Chapter 3: Informed Search).
- For GATE: memorise the comparison table, understand conditions for completeness/optimality, and practice tracing algorithms on small trees.
References
- Russell & Norvig, Artificial Intelligence: A Modern Approach, Chapter 3 (Sections 3.3–3.4).
- Korf, R. E. (1985). “Depth-First Iterative-Deepening: An Optimal Admissible Tree Search.” Artificial Intelligence, 27(1), 97–109.