Back to Adversarial Search

Depth-Limited Search: Practical AI

Real-World Game Playing with Limited Resources

When full tree search isn't possible, use evaluation functions!
Depth Control
Current Setting

Search limited to 2 moves ahead
Beyond this depth, use heuristic evaluation

Current Position
X
O

X in corner, O in center.
Full search = hundreds of positions!

Algorithm Controls

Position Evaluation Function

When search depth is reached, use heuristic evaluation instead of terminal utilities:

Eval(position) = (X_threats - O_threats) × 0.5 + center_control × 0.3 + corner_control × 0.2
Threat Analysis

Count potential winning lines for each player. More threats = higher evaluation.

Center Control

Center square (position 4) is strategically important - bonus for controlling it.

Corner Control

Corner positions offer multiple winning paths - moderate strategic value.

Note: This is a simplified evaluation. Real chess engines use hundreds of features!

Computational Complexity

Depth 1
~7 nodes

Very fast, limited lookahead

Depth 2
~49 nodes

Good balance of speed/quality

Depth 3
~343 nodes

Higher quality, slower search

Full Tree
~500,000 nodes

Perfect play, impractical time

Real-World Applications

Chess Engines
  • Search 15-20 moves deep in middlegame
  • Use complex evaluation functions
  • Combine with alpha-beta pruning
  • Real-time move generation required
Game AI Benefits
  • Scalability: Works for any game size
  • Real-time: Guaranteed response time
  • Tuneable: Adjust depth vs speed
  • Practical: Good decisions quickly