Graph Theory37 sections · 1633 units
Open in Course

The Decision Framework

(When to use each technique)

Here is how you decide which technique to use:

BFS: Shortest path in unweighted graphs, multi-source problems, level-by-level exploration.

DFS: Find any path, check connectivity, detect cycles, traverse entire components.

Cycle Detection: Validate DAGs before topo sort, detect circular dependencies.

DP on DAGs: Count paths, find longest/shortest weighted paths, when subproblems overlap.