2026-spring algorithms/lessons/07-graphs-bfs-and-dfs

README.md

Lesson 7: Graphs: BFS and DFS

Graphs: BFS and DFS comes up in almost every real Python project. We start with the why, then write code together.

Full lesson: https://glibcode.net/courses/algorithms/lessons/7

Files

  • graphs.py: shortest path in an unweighted graph with BFS

Tip: Use a virtual environment per project: python3 -m venv .venv.

Run it

python3 graphs.py

Exercises

See exercises.md. Ask in the forum once you've tried.