Python Graph Traversals Explained in Plain English

Published: 25 February 2018
on channel: Jeffrey James
3,547
91

Code: https://gist.github.com/jrjames83/eef...

Without worrying about the differences between breadth first search and depth first search, we first say, "hey, how can we visit all nodes in a graph using a function in python?".

A working knowledge of control flow (while statement), lists and dictionaries is assumed, but I step through the algorithm very slowly and deliberately.

It turns out that the differences between DFS and BFS are fairly minor and in my view, focusing on them initially leads to needless confusion.

Once you have a grasp of the fundamental algorithm, minor differences in managing your route plan queue or stack, give rise to the DFS or BFS distinction, almost without even trying.

Next we'll outline those differences.


On this page of the site you can watch the video online Python Graph Traversals Explained in Plain English with a duration of hours minute second in good quality, which was uploaded by the user Jeffrey James 25 February 2018, share the link with friends and acquaintances, this video has already been watched 3,547 times on youtube and it was liked by 91 viewers. Enjoy your viewing!