Network Flow
& Optimization
Learn how to model flow through networks, find the maximum flow from source to sink, and apply the powerful Max-Flow Min-Cut Theorem.
What Is a Network?
A network is a directed graph where each edge (arc) has a capacity: the maximum amount of a resource (water, data, traffic) that can travel along it. Every network has a special source node (where flow originates) and a sink node (where flow arrives).
Key Terminology
Why Flow Matters
Network flow models appear everywhere in real life: internet bandwidth, pipeline systems, transportation logistics, and supply chain management. The core question is always the same: what is the maximum amount we can push from source to sink?
The Max-Flow Problem
Given a network with source \( S \) and sink \( T \), find the maximum total flow from \( S \) to \( T \) that respects all capacity constraints and flow conservation.
Max-Flow Min-Cut Theorem
A cut divides the nodes into two groups: one containing \( S \), one containing \( T \). The capacity of a cut is the sum of capacities of edges crossing from the \( S \)-side to the \( T \)-side.
Finding Augmenting Paths
An augmenting path is any path from \( S \) to \( T \) in the residual graph where every edge has positive residual capacity. The algorithm repeatedly finds such paths and pushes flow along them.
Flow vs. Cut: Key Distinction
| Flow | Cut | |
|---|---|---|
| Definition | Amount of resource traveling from \( S \) to \( T \) | Partition of nodes into \( S \)-side and \( T \)-side |
| Measure | Total flow value \( |f| \) | Sum of capacities of crossing edges |
| Goal | Maximize | Minimize |
| Relationship | Max flow = Min cut (always equal at optimum) | |
The Ford-Fulkerson Method
The Ford-Fulkerson method is the foundational algorithm for solving max-flow. It works by repeatedly finding augmenting paths and pushing flow until no more paths exist.
Step-by-Step Approach
Example 1: Simple Network
Example 2: Cross Edges
Example 2: Solution
Example 3: Backward Edges
Common Mistakes
Summary at a Glance
| Concept | Definition | Key Formula |
|---|---|---|
| Capacity | Max flow an edge allows | \( c(u,v) \) |
| Flow | Actual amount sent | \( 0 \le f(u,v) \le c(u,v) \) |
| Residual | Remaining room | \( c_f = c - f \) |
| Max-Flow | Greatest total from \( S \) to \( T \) | \( |f^*| \) |
| Min-Cut | Smallest partition capacity | \( \text{cap}(S^*, T^*) \) |
| Theorem | They are equal | \( |f^*| = \text{min-cut} \) |
Question 1 of 5
In a flow network, the conservation of flow constraint states that:
Question 2 of 5
A network has edges \(S \to A\) (cap 8), \(S \to B\) (cap 5), \(A \to T\) (cap 6), and \(B \to T\) (cap 7). What is the maximum flow?
Question 3 of 5
The Max-Flow Min-Cut Theorem states that:
Question 4 of 5
If edge \((A, B)\) has capacity \(c = 10\) and current flow \(f = 7\), what is the residual capacity of the forward edge \(A \to B\)?
Question 5 of 5
When computing a minimum cut, which edges do you sum?