Discrete Mathsfor Engineers

Structures, proofs, and intuition

EN | PT

Depth-First Search (DFS)

Series overview — structural graph exploration

Series: Depth-First Search (DFS) 8 parts
1 2 3 4 5 6 7 8

What DFS Solves

Given a graph G = (V, E), Depth-First Search (DFS) explores the graph by going as deep as possible along each branch before backtracking.

Unlike BFS, DFS is not distance-oriented. It is oriented toward structure. It reveals global properties of graphs, such as cycles, strongly connected components, and topological ordering.

Reference: the presentation follows the classic treatment in Introduction to Algorithms (CLRS).

Parts