video thumbnail 20:52
Depth First Search (DFS) Explained: Algorithm, Examples, and Code

2020-07-05

[public] 62.9K views, 13.9K likes, 13.0 dislikes audio only

channel thumbReducible

In this video, I explain the fundamental ideas behind the Depth First Search (DFS) graph algorithm. We first introduce the concept of a graph traversal. We then go through several examples of DFS to provide intuition. Afterwards, we then go through both a recursive and iterative implementation with provided code. We discuss the differences between the implementation and also make a distinction between a preorder and post order DFS traversal. We then finish the video off with some practical and fun applications of depth first search in graph theory.

0:00 Intro and Preview

0:50 Graph Traversal

1:20 DFS Walkthrough and Examples

6:26 Recursive Implementation

11:08 Iterative Implementation

15:06 Preorder vs Postorder DFS

17:01 DFS Applications

Support: https://www.patreon.com/reducible

This video wouldn't be possible without the open source manim library created by 3blue1brown: https://github.com/3b1b/manim

Here is link to the repository that contains the code used to generate the animations in this video: https://github.com/nipunramk/Reducible


Introduction to Graph Theory: A Computer Science Perspective by Reducible
/youtube/video/LFKZLXVO-Dg
5 Simple Steps for Solving Any Recursive Problem by Reducible
/youtube/video/ngCos392W4w
Intro and Preview
/youtube/video/PMMc4VsIacU?t=0
Graph Traversal
/youtube/video/PMMc4VsIacU?t=50
DFS Walkthrough and Examples
/youtube/video/PMMc4VsIacU?t=80
Recursive Implementation
/youtube/video/PMMc4VsIacU?t=386
Iterative Implementation
/youtube/video/PMMc4VsIacU?t=668
Preorder vs Postorder DFS
/youtube/video/PMMc4VsIacU?t=906
DFS Applications
/youtube/video/PMMc4VsIacU?t=1021
Reducible This channel is all about animating computer science concepts in a fun, interactive, and intuitive manner.
/youtube/channel/UCK8XIGR5kRidIw2fWqwyHRA
The Discrete Fourier Transform: Most Important Algorithm Ever? 24,415 views
/youtube/video/yYEMxqreA10
Patreon patreon.com
https://www.patreon.com/reducible