David Akinboro

Back to Insights

AI as Search: The Foundation of Intelligent Problem-Solving

February 2025

Understanding How GPS Navigation, Game-Playing Computers, and AI Systems Actually Work

Why Search is Everywhere in AI

From GPS routing to chess engines and Go AI, search algorithms underpin the core mechanisms of modern artificial intelligence.

"AI as search"is a foundational principle in computerized problem solving.

The following sections explain these concepts using only high school level mathematics.

Monte Carlo Tree Search - The Modern Revolution

The Problem with Traditional Game Tree Search

Traditional minimax works great for games like chess, but what about Go?

  • Branching factor: Chess has ~35 moves per position; Go has ~250+
  • Evaluation difficulty: It's hard to evaluate Go positions without playing to the end
  • Tree size: The search space is astronomically large

Enter Monte Carlo Tree Search (MCTS)

MCTS uses a radically different approach: instead of trying to evaluate positions with clever functions, just play lots of games to the end and see what happens!

Core Philosophy:

  • Simulate thousands of random games
  • Track which moves lead to more wins
  • Gradually focus search on promising moves

The Four Steps of MCTS

1. Selection: Navigate down the tree using a smart formula that balances:

  • Exploitation: Go toward moves that have worked well
  • Exploration: Try moves that haven't been tested much

UCT (Upper Confidence bound applied to Trees) Formula:

Choose move i that maximizes:
[Wins_i / Plays_i] + c × √(ln(Total_Plays) / Plays_i)

Where:
- Wins_i / Plays_i = win rate for move i
- Second term = exploration bonus (larger for less-tried moves)
- c = exploration parameter (typically √2)

2. Expansion: When you reach a leaf node (a position with untried moves), add one new child node for an untried move.

3. Simulation: From this new position, play a complete random game to the end. This is called a "playout" or "rollout."

4. Backpropagation: Take the result (win/loss) and update statistics for every node on the path back to the root.

MCTS Algorithm:

While time remaining:
    # Selection: Navigate to leaf using UCT
    leaf = select_best_path_to_leaf(root)
    
    # Expansion: Add one new child
    child = add_new_child(leaf)
    
    # Simulation: Play random game to end
    result = play_random_game(child)
    
    # Backpropagation: Update all nodes on path
    update_path_statistics(child, result)

# Choose move that was simulated most often    
return most_simulated_move(root)

Why MCTS Works: The Multi-Armed Bandit Connection

MCTS treats move selection like a "multi-armed bandit" problem - imagine slot machines with different payout rates. You want to:

  • Try each machine enough to estimate its payout
  • Spend most time on the best machines
  • Still occasionally try other machines in case you were wrong

The UCT formula solves this mathematically, with theoretical guarantees about minimizing regret!

MCTS Success Stories

AlphaGo (2016): Defeated Lee Sedol 4-1

  • Combined MCTS with deep neural networks
  • Neural networks guided both selection and evaluation
  • Revolutionized computer Go

Beyond Go:

  • Poker: Handle incomplete information through simulation
  • Real-time strategy games: Manage complex state spaces
  • General game playing: Works without game-specific knowledge

Benefits of MCTS:

  1. No evaluation function needed: Just simulate to the end
  2. Anytime algorithm: Can stop and make a decision whenever time runs out
  3. Handles large branching factors: Naturally focuses on promising moves
  4. Theoretically grounded: Mathematical guarantees about convergence

Connecting Theory to Practice

Why These Algorithms Matter

These aren't just academic exercises - they're the engines that power technologies you use every day:

GPS Navigation (A*):

  • States: Road intersections
  • Actions: Driving between intersections
  • Heuristic: Straight-line distance
  • Goal: Reach destination optimally

Game AI (Minimax + Alpha-Beta):

  • Chess engines, checkers programs
  • Perfect play in solved games
  • Real-time strategy game AI

Modern AI Systems (MCTS + Deep Learning):

  • AlphaGo, AlphaZero revolutionized game AI
  • Planning in robotics
  • Decision-making under uncertainty

The Evolution of AI Search

  • 1950s: Basic minimax (Turing, Shannon)
  • 1960s: Alpha-beta pruning (McCarthy)
  • 1970s-90s: Sophisticated evaluation functions
  • 1997: Deep Blue defeats Kasparov
  • 2006: MCTS developed
  • 2016: AlphaGo defeats Lee Sedol
  • 2017: AlphaZero masters chess, Go, and shogi from scratch

Key Insights About AI

From these algorithms, we learn fundamental truths about artificial intelligence:

  1. Computers solve problems differently than humans: Methodical exploration vs. intuition
  2. Brute force + clever pruning is powerful: Sometimes trying many possibilities systematically beats trying to be clever
  3. Good heuristics are crucial: The right evaluation function can make the difference between feasible and impossible
  4. Simulation can replace evaluation: Sometimes it's easier to just try it than to predict what will happen

Mathematical Beauty in Simple Terms

Notice that all these algorithms use high school math:

  • Counting: Tracking wins/losses, visits
  • Averages: Win rates, expected values
  • Comparisons: Max/min operations
  • Logarithms: In the UCT formula (but just to balance exploration)
  • Basic probability: Understanding that more trials give better estimates

No calculus, linear algebra, or advanced statistics required for the core ideas!

Building Intuition - Practice Problems

Problem 1: Heuristic Evaluation

For the 15-puzzle, which heuristic is better and why?

  • h₁(s) = number of tiles in wrong position
  • h₂(s) = sum of Manhattan distances

Answer: h₂ is better because it's more informed (gives better estimates) while still being admissible.

Problem 2: Alpha-Beta Pruning

Given this game tree, where can we prune?

        MAX
       /    \
    MIN      MIN
   /  |     /  |  \
  3   5    2   ?  ?

Answer: After finding the right MIN node starts with 2, we can prune the remaining branches because MAX will choose the left side (5 > 2).

Problem 3: MCTS Decision

After 1000 simulations:

  • Move A: 400 plays, 240 wins (60% win rate)
  • Move B: 100 plays, 70 wins (70% win rate)
  • Move C: 500 plays, 200 wins (40% win rate)

Which move should MCTS choose for the next simulation?

Answer: Likely Move B, because it has a high win rate but relatively few plays, so the exploration term in UCT will be large.

The Foundation of AI

Search algorithms represent one of the foundational ideas in artificial intelligence. From the systematic exploration of depth-first and breadth-first search, through the intelligent guidance of A*, to the adversarial reasoning of minimax and the simulation-based approach of MCTS, these algorithms demonstrate how computers can solve complex problems through methodical exploration.

The next time you use GPS navigation, play a computer game, or read about AI breakthroughs like AlphaGo, remember: you're witnessing the power of search algorithms that transform problems into systematic exploration of possibilities.

While serving as a teaching assistant for Professor Hirsh, he would say: "AI as search" isn't just one approach among many - it's a fundamental way of thinking about how intelligent systems can navigate the space of possible solutions to find the best answers. And the beautiful thing is, it all builds on mathematical concepts we already understand.

Intelligence doesn't always require intuition or inspiration. Sometimes it just requires being systematic, strategic, and thorough in exploring possibilities. And that's something computers can do well with compute.

"If I have seen further it is by standing on the shoulders of Giants." - Isaac Newton

The same is true for AI systems: each algorithm builds on previous insights, creating increasingly powerful systems that can tackle more complex problems. I hope these fundamentals have given you the foundation to understand how modern AI really works.