3 weeks ago
23 lines655 B
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.
Tip: Run
python3 -i file.pyto stay in the interpreter after the program ends and poke at the variables.
Run it
python3 graphs.py
Exercises
See exercises.md. Ask in the forum after you have tried.