Breadth-First Search
Explores the graph layer by layer. It visits all neighbors of the start node before moving to the next level depth.
- Data Structure: Queue (FIFO)
- Visual Pattern: Wave-like expansion, circular ripples.
- Use Case: Finding shortest path in unweighted graphs.
Depth-First Search
Explores as deep as possible along each branch before backtracking.
- Data Structure: Stack (LIFO) or Recursion
- Visual Pattern: Long winding paths, snake-like movement.
- Use Case: Maze solving, topological sorting, detecting cycles.