Uninformed Search

Exploring AI Search Strategies Without Domain Knowledge

Dr. Dhaval Patel โ€ข 2025

What We'll Learn Today

Today's lecture will cover the fundamentals of uninformed search strategies in AI, providing you with essential knowledge for problem-solving.

  • Understanding states and knowledge representation
  • Components of atomic agents and search problems
  • Why search is crucial in AI with practical examples
  • Evaluation criteria for search strategies
  • Core uninformed search algorithms
  • Complexity analysis and performance comparison
By the end of this lecture, you'll understand how AI agents find solutions without using domain-specific knowledge.

Fundamentals

States & Knowledge Representation

What is a State?

A state represents a complete description of the world or problem situation at any given moment.

State Definition:
A state captures all relevant information needed to:
  • Determine what actions are possible
  • Evaluate whether the goal has been reached
  • Understand the current situation completely
  • Predict the outcome of actions

Key Point: States are not just snapshots - they're comprehensive representations that enable decision-making and goal achievement in AI systems.

Think of a state as answering: "What is the complete current situation that matters for solving this problem?"

Agent's Knowledge: Vacuum World Example

Vacuum World Visualization

๐Ÿค–
Room A
DIRTY
Room B
CLEAN

Current State: (Agent-A, A-Dirty, B-Clean)

Possible Actions:
โ€ข Suck (clean room A)
โ€ข Move-Right (go to room B)

State Space Analysis

  • Agent Position: A or B (2 options)
  • Room A Status: Clean or Dirty (2 options)
  • Room B Status: Clean or Dirty (2 options)
  • Total States: 2 ร— 2 ร— 2 = 8 states
Actions Available:
โ€ข Move-Right
โ€ข Move-Left
โ€ข Suck

Goal State: Both rooms clean, regardless of agent location (2 winning states out of 8 total).

Atomic Agent Input Components

Every search problem requires four essential components to be well-defined:

1. Set of States
All possible configurations of the world
Example: In vacuum world, all 8 possible combinations of (Agent-Position, Room-A-Status, Room-B-Status)
2. Operators (Actions) and Costs
Available actions and their associated costs
Example: Move-Left (cost=1), Move-Right (cost=1), Suck (cost=1)
3. Start State
The initial configuration where the agent begins
Example: (Agent-A, A-Dirty, B-Dirty)
4. Goal State (Test)
Condition or test that defines success
Example: Both rooms are clean
These components define the "search space" - the landscape of all possible paths from start to goal.

Why Search?

Real-World Applications & Examples

Example 1: The 8-Puzzle

Start State

1
3
4
2
6
7
5
8
โ†’

Goal State

1
2
3
4
5
6
7
8

Problem Analysis

  • States: 9!/2 = 181,440 configurations
  • Actions: Slide tile into empty space (Up, Down, Left, Right)
  • Goal: Arrange numbers 1-8 in order with empty space at bottom-right
  • Challenge: Find shortest sequence of moves
Why Search?
With 181,440 possible states, we need systematic exploration to find the optimal solution!

Example 2: Romania Travel Problem

images/ai/romania-map.jpeg

Problem: Find shortest path from Arad to Bucharest

Search Problem Setup

  • States: Cities (Arad, Oradea, Sibiu, Brasov, Bucharest, etc.)
  • Actions: Drive from one city to a connected city
  • Costs: Distance between cities (in km)
  • Goal: Reach Bucharest from Arad
Multiple Paths Exist:
โ€ข Arad โ†’ Sibiu โ†’ Brasov โ†’ Bucharest
โ€ข Arad โ†’ Oradea โ†’ ... โ†’ Bucharest
Which is shortest?

Example 3: N-Queens Problem

4-Queens Solution

โ™›
โ™›
โ™›
โ™›

โœ“ No queens attack each other!

Problem Complexity

  • Goal: Place N queens on Nร—N board so none attack each other
  • States: Arrangements of queens on board
  • Actions: Place or move queens
  • Constraints: No two queens in same row, column, or diagonal
Search Space:
โ€ข 4-Queens: 2 solutions
โ€ข 8-Queens: 92 solutions
โ€ข But millions of possible arrangements to check!

Strategy Evaluation

How Do We Judge Search Algorithms?

Search Strategy Evaluation Criteria

A search strategy is defined by the order of node expansion. We evaluate strategies along five key dimensions:

1. Completeness: Does it always find a solution if one exists?
Will the algorithm eventually find the goal, or might it get lost?
2. Time Complexity: Number of nodes generated/explored
How much computation time does it take?
3. Space Complexity: Maximum number of nodes stored in memory
How much memory does it require?
4. Optimality: Does it always find the least-cost solution?
Is the solution the best possible?
5. Systematicity: Does it visit each state at most once?
Does it avoid redundant work?
Complexity Measures:
โ€ข b: maximum branching factor (max children per node)
โ€ข d: depth of least-cost solution
โ€ข m: maximum depth (may be โˆž)

Uninformed Search

Strategies Using Only Problem Definition

Uninformed Search Strategies

Uninformed search strategies use only the information available in the problem definition - no domain-specific knowledge!

  • Breadth-First Search (BFS): Expand shallowest nodes first
  • Depth-First Search (DFS): Expand deepest nodes first
  • Depth-Limited Search: DFS with maximum depth limit
  • Iterative Deepening Search: Gradually increase depth limit
  • Bidirectional Search: Search from both start and goal
Also called "blind search" - they don't know if one non-goal state is more promising than another.

Each strategy makes different trade-offs between time, space, completeness, and optimality.

Breadth-First Search (BFS) Visualization

BFS Expansion Order: Level by Level
S
A
B
C
D
E
F
G
H
...
...
...
...

Order: S โ†’ A, B, C โ†’ D, E, F, G, H โ†’ ...

BFS Characteristics

  • Strategy: Expand all nodes at depth d before depth d+1
  • Complete: โœ“ Yes (if b is finite)
  • Optimal: โœ“ Yes (if step costs are equal)
  • Time: O(b^d)
  • Space: O(b^d) - stores entire frontier
Key Insight: BFS guarantees shortest path but uses exponential memory!

Depth-First Search (DFS) Visualization

DFS Expansion Order: Depth First
S
A
B
C
D
E
F
G
H
I
J
...
...

Order: S โ†’ A โ†’ D โ†’ I โ†’ J โ†’ ... (backtrack) โ†’ E โ†’ ...

DFS Characteristics

  • Strategy: Expand deepest node first, backtrack when stuck
  • Complete: โœ— No (can get lost in infinite paths)
  • Optimal: โœ— No (finds any solution, not necessarily shortest)
  • Time: O(b^m)
  • Space: O(bm) - only stores path
Key Insight: DFS uses much less memory but may never find the optimal solution!

Breadth-First vs Depth-First Search

Breadth-First Search

Strategy: Expand all nodes at depth d before any nodes at depth d+1

โœ“ Complete & Optimal
โœ“ Finds shortest path
โœ— High memory usage O(b^d)
โœ— Slow if solution is deep

Use when: Solutions are shallow, optimality is crucial, memory is available

Depth-First Search

Strategy: Expand deepest node first, backtrack when needed

โœ“ Low memory usage O(bm)
โœ“ Fast if many solutions exist
โœ— Not optimal
โœ— May get stuck in infinite paths
โœ— Not complete

Use when: Memory is limited, any solution is acceptable, search space is finite

VS

Time and Space Complexity: BFS Example

Breadth-First Search Complexity Analysis

Depth Nodes Time Memory
2110milliseconds11 kilobytes
411,110milliseconds11 megabytes
610โถseconds1.1 gigabytes
810โธminutes100 gigabytes
1010ยนโฐhours10 terabytes
1210ยนยฒdays1 petabyte
1410ยนโดyears100 petabytes
1610ยนโถyears10 exabytes
Assumptions: Branching factor b = 10, 1 million nodes/second, 1000 bytes/node.

Critical Insight: Memory becomes the limiting factor much faster than time! This exponential growth shows why we need smarter strategies for complex problems. Notice how memory requirements become impossible to satisfy well before time does.

Iterative Deepening Search Visualization

Iterative Deepening: Gradually Increase Depth Limit

Depth Limit = 0

S

Depth Limit = 1

S
A
B

Depth Limit = 2

S
A
B
G
C
D

โœ“ Goal Found at Depth 2!

How It Works

  • Step 1: Try DFS with depth limit 0
  • Step 2: Try DFS with depth limit 1
  • Step 3: Try DFS with depth limit 2
  • Continue: Until solution found
Benefits:
โœ“ Complete & Optimal
โœ“ Memory efficient O(bd)
โœ“ Not much slower than BFS
Why It Works: Most work is at the deepest level, so repeating shallow searches is negligible!

Bidirectional Search Visualization

Bidirectional: Two Searches Meet in the Middle
โ†’ FORWARD โ†’
S
Start: Expand from S
vs
Step 1
โ† BACKWARD โ†
G
Goal: Expand from G
โ†’ FORWARD โ†’
S
A
B
Explore: A, B
vs
Step 2
โ† BACKWARD โ†
G
Y
Z
Explore: Y, Z
โ†’ FORWARD โ†’
S
A
B
X
C
โšก
COLLISION!
๐ŸŽฏ
Node X Found

๐Ÿ† SUCCESS!

โ† BACKWARD โ†
G
Y
Z
X
W

๐Ÿ›ค๏ธ Final Path: S โ†’ A โ†’ X โ† Y โ† G

Total Path Length: 4 steps | Nodes Explored: ~10 | vs Normal BFS: ~1000+ saved!

Why It's Powerful

  • Exponential Speedup: O(b^d) โ†’ O(b^(d/2))
  • Early Termination: Stop as soon as searches meet
  • Symmetric Exploration: Both directions contribute equally
  • Optimal Path: Combines shortest segments from both sides
Complexity Example:
โ€ข Normal BFS: 10ยนโฐ nodes
โ€ข Bidirectional: 2 ร— 10โต nodes
โ€ข 50,000x faster!
Requirements:
โ€ข Reversible operators
โ€ข Explicit goal state
โ€ข Same search strategy both ways

Advanced Uninformed Strategies Summary

Iterative Deepening Search

Best general-purpose uninformed search:

  • Combines BFS completeness with DFS memory efficiency
  • Complete and optimal
  • Space complexity: O(bd)
  • Time complexity: O(b^d)
When to Use:
โ€ข Don't know solution depth
โ€ข Want optimal solution
โ€ข Memory is limited
โ€ข General-purpose choice

Bidirectional Search

Most efficient when applicable:

  • Exponential speedup: O(b^d) โ†’ O(b^(d/2))
  • Complete and optimal
  • Requires reversible operators
  • Need explicit goal state
When to Use:
โ€ข Can work backwards from goal
โ€ข Large search spaces
โ€ข Solution depth is large
โ€ข Want maximum efficiency

Summary: Choosing the Right Strategy

Each uninformed search strategy has its place depending on the problem characteristics:

Use Breadth-First Search when:
โ€ข Solution depth is small (d โ‰ค 12)
โ€ข You need the optimal solution
โ€ข Memory is not a constraint
โ€ข Step costs are uniform
Use Depth-First Search when:
โ€ข Memory is severely limited
โ€ข Solutions are deep but plentiful
โ€ข Any solution is acceptable (not necessarily optimal)
โ€ข Search space is finite
Use Iterative Deepening when:
โ€ข You want BFS optimality with DFS memory efficiency
โ€ข Search space has uniform cost
โ€ข Best general-purpose uninformed search
โ€ข Don't know the solution depth in advance
Key Insight: Uninformed search teaches us the fundamental trade-offs in AI: time vs. space vs. optimality. Understanding these prepares us for informed search strategies that use domain knowledge to do much better!

Questions & Discussion

Understanding Uninformed Search

Slide 1 of 23