Skip to content

Search Problems - Common Algorithms

Search algorithms are methods for exploring data structures or solution spaces to find a specific value, goal, or optimal configuration. They're foundational in AI, pathfinding, game theory, databases, and optimization.

Below is a structured list of search algorithms, categorized by purpose and properties.


1. Uninformed (Blind) Search Algorithms

These algorithms don’t use any domain-specific information.

AlgorithmStrategyComplete?Optimal?Time Complexity
Breadth-First Search (BFS)Explores neighbors level by level✅ Yes✅ Yes (uniform cost)O(bd)
Depth-First Search (DFS)Explores one branch deeply first✅ (if finite)❌ NoO(bd)
Iterative Deepening DFSDFS with increasing depth limit✅ Yes✅ YesO(bd)
Uniform-Cost SearchExpands node with lowest path cost✅ Yes✅ YesO(b1+⌊C/ε⌋)

b = branching factor, d = depth of goal node, C = cost, ε = smallest step cost.


🔍 2. Informed (Heuristic) Search Algorithms

Use a heuristic function h(n) to guide the search. Common in AI and robotics.

AlgorithmDescriptionComplete?Optimal?Notes
Greedy Best-First SearchChooses node with lowest h(n)Fast but not always correct
A*Uses f(n) = g(n) + h(n) (path cost + heuristic)Optimal if h is admissible
Beam SearchKeeps only best k nodes per levelTradeoff between speed and accuracy
Iterative Deepening A*A* with depth limitsSpace-efficient

A* is widely used in pathfinding, e.g., GPS systems, games.


🔗 3. Local Search Algorithms

Focus on improving a single solution iteratively. Good for large state spaces.

AlgorithmDescriptionNotes
Hill ClimbingMoves to better neighboring statesCan get stuck in local maxima
Simulated AnnealingProbabilistic jumps to escape local optimaSlower but more global
Genetic AlgorithmsEvolves solutions through crossover and mutationWorks on populations
Tabu SearchAvoids cycles by tracking recently visited statesGood for combinatorial problems

Useful for optimization, especially when the search space is vast or poorly understood.


4. Adversarial Search (Game Trees)

Used in game AI or any setting with competing agents.

AlgorithmPurposeDomain
MinimaxChooses the move that minimizes lossChess, Tic-Tac-Toe
Alpha-Beta PruningPrunes Minimax branches that won't helpMore efficient Minimax
ExpectimaxHandles stochastic outcomesDice games, backgammon
Monte Carlo Tree Search (MCTS)Simulates rollouts to estimate move valueGo, real-time strategy

Used in agents like Deep Blue, AlphaGo, and other game-playing AIs.


5. Tree and Graph Traversal

Often used in data structures, compilers, and file systems.

AlgorithmStructure UsedDirection
In-order TraversalBinary TreesLeft → Root → Right
Pre-order TraversalBinary TreesRoot → Left → Right
Post-order TraversalBinary TreesLeft → Right → Root
Topological SortDAGsSorted by dependency
Dijkstra’s AlgorithmWeighted GraphsShortest path
Bellman-FordGraphs w/ negative weightsShortest path

6. Real-World & AI Search Problems

ProblemAlgorithm(s) Commonly Used
Route finding (e.g., GPS)A*, Dijkstra
Puzzle solving (e.g., 8-puzzle)A*, IDA*, BFS
Game playing (e.g., Chess)Minimax + Alpha-Beta
SAT solvingDPLL, CDCL, WalkSAT
Job schedulingTabu Search, Genetic Algorithms
Maze solvingBFS, DFS, A*
Robot path planningRRT, A*, D*

Summary Table

Algorithm TypeExamplesBest Used For
UninformedBFS, DFS, UCSGeneral graphs, unknown domains
InformedA*, Greedy, BeamPathfinding, AI
LocalHill climbing, SA, GAOptimization, continuous problems
AdversarialMinimax, MCTSGames, multi-agent environments
Graph traversalTopo Sort, DFS, BFSData structures, dependency resolution

Powered by VitePress