Advanced Python
Concurrency, performance, metaprogramming, graphs, dynamic programming and internals.
-
Lesson 14 min read
Python graphs: BFS and DFS explained, with the shortest path
How to store a graph in Python as an adjacency list, find the shortest path with breadth first search and a deque, and when depth first search is the better walk. One small function with its real output.