
What Is an Augmenting Path? The Core Idea Behind Max Flow
An augmenting path is a source-to-sink route in the residual graph with available capacity. Learn how Ford-Fulkerson and Edmonds-Karp use them.
Page 6 of 61 · Ideas for curious minds in tech.
Back to the archive
An augmenting path is a source-to-sink route in the residual graph with available capacity. Learn how Ford-Fulkerson and Edmonds-Karp use them.

The residual graph is how max-flow algorithms undo bad decisions. Learn how backward edges work, why greedy augmentation fails, and what Edmonds-Karp fixes.

A flow network is a directed graph with capacity constraints. Learn the residual graph, max-flow min-cut theorem, and Edmonds-Karp for interviews.

Graph diameter is the longest shortest path in a graph. Learn the two-BFS tree trick, LeetCode 543's DFS pattern, and when to use Floyd-Warshall.

An independent set in graph theory picks vertices with no shared edges. Learn when it's NP-hard, when it's O(n), and why House Robber is this problem.

The vertex cover problem asks for the fewest vertices that touch every edge. NP-hard in general graphs, polynomial in bipartite. Here's the full breakdown.

What is a perfect matching algorithm? Learn Hall's theorem, augmenting path DFS, Hopcroft-Karp, and how to spot matching problems in coding interviews.

What is a Hamiltonian cycle? Learn the definition, why it's NP-complete, the Held-Karp algorithm, and how it shows up in coding interviews.

Tree DP is postorder DFS with state. Learn the skeleton, how to define the return tuple, and when to recognize tree DP in coding interviews.

Interval DP uses dp[i][j] over contiguous ranges. Learn the fill-order rule, the last-burst inversion, and how to spot it in hard LeetCode problems.

Digit DP counts integers in [L,R] by digit property in O(D×S×10). Covers the tight flag, Python implementation, common bugs, and LeetCode problems.

Bitmask DP encodes subsets as integers to run dynamic programming in O(n·2^n) instead of O(n!). Learn the pattern, signals, and common mistakes.

DFS labels every edge as tree, back, forward, or cross. This DFS edge classification guide explains cycle detection, topological sort, and Tarjan's algorithm.
What is a back edge in DFS? It connects the current vertex to a GRAY ancestor on the call stack, meaning the graph has a cycle. Here's how it works.

Graph density determines whether to use adjacency lists or matrices and which algorithms win. Here's the formula and how to read it in interviews.

A forest data structure is a collection of disjoint trees. Learn the n-k edge formula, Union-Find's forest structure, and the outer-loop traversal pattern.

Binary tree height vs depth explained: what each measures, the off-by-one convention trap, why LeetCode 104 is misnamed, and why interviews care about height.

A leaf node has no children. Learn the binary tree definition, why it matters for Path Sum and Minimum Depth, and the coding interview patterns it drives.

A tree rotation is a local O(1) pointer swap that keeps BST height at O(log n). Learn left rotation, right rotation, and all four imbalance cases.

A plain BST degrades to O(n) on sorted input. Self-balancing binary search trees use rotations to keep height O(log n) unconditionally.

The centroid of a tree is the node whose removal leaves no component larger than n/2. Find it in O(n) with two DFS passes. Python code included.

The euler tour explained: check Eulerian circuit conditions, implement Hierholzer's O(E) algorithm, and use the tree euler tour to answer O(1) LCA queries.

Topological order arranges graph nodes so every edge points forward. Learn the definition, Kahn's algorithm, DFS method, and where it appears in interviews.

Graph cycle detection for coding interviews: three-color DFS for directed graphs, Union-Find for undirected, and the two bugs that cost candidates offers.