Graph algorithms: BFS, DFS, Dijkstra and A*, step by step
12 steps · about 4 h 32 min · Intermediate
- Depth First Search Algorithm | Graph Theory (video, WilliamFiset (YouTube), 15 min)
DFS is the simplest traversal and introduces graphs, visited sets and stacks or recursion.
- Breadth First Search Algorithm | Shortest Path | Graph Theory (video, WilliamFiset (YouTube), 15 min)
BFS swaps the stack for a queue, and that change gives shortest paths on unweighted graphs.
- Breadth-first search (article, Wikipedia, 15 min)
It compares BFS and DFS on completeness and memory use, so you can see the trade-offs.
- Lecture 17: BFS, DFS, Dijkstra, CSE 373: Data Structures and Algorithms (doc, University of Washington, 30 min)
A university lecture that puts BFS, DFS and Dijkstra side by side, and shows how Dijkstra grows a cloud of settled vertices.
- Dijkstra's Algorithm - Computerphile (video, Computerphile (YouTube), 10 min)
A short, clear walkthrough of weighted shortest paths using the sat-nav example.
- Graph Algorithms in Python: BFS, DFS, and Beyond (tutorial, freeCodeCamp, 30 min)
Working Python for all four algorithms, so you can type them in and run them.
- Tracing the Path in DFS, BFS, and Dijkstra's Algorithm (article, Baeldung, 20 min)
Finding a distance is not enough, so this shows how to recover the actual path with parent pointers.
- Introduction to the A* Algorithm (interactive, Red Blob Games (Amit Patel), 40 min)
Interactive diagrams take you from BFS to Dijkstra to A*, so you can see why the heuristic helps.
- A* Pathfinding (E01: algorithm explanation) (video, Sebastian Lague (YouTube), 12 min)
Explains the G, H and F costs and the open and closed sets, which you need before coding A*.
- Pathfinding Algorithm Visualizer (interactive, LivePhysics, 15 min)
Draw walls and weights, then run all four algorithms on the same grid and compare how much each explores.
- Amit's A* Pages (guide, Red Blob Games (Amit Patel), 30 min)
Covers heuristic choice (Manhattan, diagonal, Euclidean) and the speed versus accuracy trade-off.
- mallicee/pathfinder: Interactive pathfinding & maze visualizer (repo, GitHub, 40 min)
A small dependency-free JS codebase where you can read how Dijkstra, A* and BFS share a heap-based core.