FINITE MATHEMATICS • LOGIC, SETS, AND NETWORKS

Network Flow & Optimization — Network flow and optimization concepts (intro)

How directed networks model the movement and optimization of flow from source to sink.

Historical Context & Motivation

The study of network flow sits at the intersection of graph theory, combinatorial optimization, and operations research, and its origins are inseparable from twentieth-century military logistics and industrial planning. At its core, the discipline asks a deceptively simple question: given a network of routes, each with limited capacity, what is the maximum amount of material—oil, data packets, rail freight—that can travel from a designated source to a designated sink? This question, while grounded in practical necessity, gave rise to a rich mathematical framework that continues to shape fields from telecommunications to supply-chain management.

1736
Euler & the Königsberg Bridges
Leonhard Euler's solution to the Königsberg Bridge problem established the foundations of graph theory, providing the abstract language of nodes and edges that network flow theory would later adopt.
1954
Ford & Fulkerson's Max-Flow Min-Cut Theorem
Working at the RAND Corporation on Cold War logistics, L. R. Ford Jr. and D. R. Fulkerson proved that the maximum flow through a network equals the minimum cut capacity—a duality result that became the cornerstone of the field.
1956
The Ford–Fulkerson Algorithm
Ford and Fulkerson published their augmenting-path method, the first systematic algorithm for computing maximum flow in a capacitated network.
1972
Edmonds–Karp Algorithm
Jack Edmonds and Richard Karp showed that using breadth-first search to select augmenting paths guarantees polynomial-time termination, advancing the field from heuristic to provably efficient computation.
2000s
Modern Applications
Network flow models became essential tools for Internet routing, airline scheduling, image segmentation in computer vision, and real-time logistics optimization in global supply chains.

The central question that drives network flow theory remains as relevant today as it was during the Cold War era: given a network with constrained capacities, how do we move the greatest possible quantity from origin to destination while respecting every constraint? Answering this question requires us to formalize networks as directed graphs, assign numerical capacities to edges, and develop algorithms that systematically discover optimal flow patterns. The sections that follow introduce these foundational concepts from the ground up.

Core Principles & Definitions

Before we can analyze flow through a network, we must establish a precise vocabulary. A flow network is a directed graph G = (V, E) equipped with a capacity function c : E → ℝ+ that assigns a non-negative upper bound to each edge, a distinguished source node s (where flow originates), and a distinguished sink node t (where flow is absorbed). Understanding the interplay among these elements is essential for grasping every algorithm and theorem that follows.

1

Capacity Constraint

The flow on any edge (u, v) must satisfy 0 ≤ f(u, v) ≤ c(u, v). No edge can carry more flow than its rated capacity.
2

Flow Conservation

At every node except s and t, the total flow entering the node equals the total flow leaving it. Flow is neither created nor destroyed at intermediate nodes.
3

Value of a Flow

The value |f| of a flow is the net flow out of the source s. Maximizing this value is the central objective of the max-flow problem.
4

Augmenting Path

A path from s to t in the residual graph along which additional flow can be pushed. The existence of such a path implies the current flow is not yet maximal.
5

Residual Graph

A modified version of the original graph that tracks remaining capacity on each edge and allows flow to be 'sent back' via reverse edges, enabling the algorithm to correct suboptimal choices.
KEY TAKEAWAY
Think of a flow network like a system of water pipes. Each pipe has a maximum throughput (capacity), water enters from a reservoir (source) and drains into a collection tank (sink), and at every junction the water flowing in must equal the water flowing out—no leaks, no magical new water. The max-flow problem asks: how do you open valves to push the greatest total volume through the entire system without bursting any pipe?

Visual Explanation — Anatomy of a Flow Network

A flow network with source s and sink t. Each edge is labeled f(u,v)/c(u,v), where the numerator is the current flow and the denominator is the capacity. The total flow value |f| = 7 + 6 = 13 units leaving s. Observe that at every interior node (A, B, C, D), the sum of incoming flow equals the sum of outgoing flow—this is the conservation constraint in action.

In the diagram above, the network consists of six nodes and eight directed edges. The source s (highlighted in cyan) pushes flow into nodes A and B, while the sink t (highlighted in pink) absorbs all flow that arrives at it. The purple edges leaving s carry 7/10 and 6/8 respectively, meaning there is still residual capacity available on both arcs. The cross-edges between A–D and B–C (shown in amber) illustrate that networks are not necessarily layered; flow can traverse the graph in complex patterns. A feasible flow must satisfy the capacity constraint on every edge and the conservation constraint at every interior node simultaneously.

Mathematical Framework

We now formalize the intuitive notions introduced in Section 2. Let G = (V, E) be a directed graph with capacity function c and a flow function f : E → ℝ+. The three governing conditions of a valid flow can be stated precisely as follows.

CAPACITY CONSTRAINT
0 ≤ f(u, v) ≤ c(u, v) for every (u, v) ∈ E
The flow on each edge must be non-negative and cannot exceed the edge's capacity.
FLOW CONSERVATION
Σ f(u, v) = Σ f(v, w) for all v ∈ V \ {s, t}
The first sum is over all edges entering v; the second is over all edges leaving v. At every intermediate node, inflow equals outflow.
VALUE OF A FLOW
|f| = Σ f(s, v) − Σ f(v, s)
The value of the flow is the net flow leaving the source. In many textbooks, the second sum is zero because no edges point into s, so |f| = Σ f(s, v).

The max-flow problem seeks a feasible flow f that maximizes |f|. Its solution is intimately connected to the concept of a cut. An s–t cut is a partition of V into two disjoint sets S and T = V \ S such that s ∈ S and t ∈ T. The capacity of this cut is the sum of capacities of all edges from S to T.

MAX-FLOW MIN-CUT THEOREM
max |f| = min c(S, T)
The maximum value of any feasible flow equals the minimum capacity over all possible s–t cuts. This powerful duality result, proved by Ford and Fulkerson, provides both a theoretical bound and a certificate of optimality: once we find a flow whose value equals some cut's capacity, both are optimal.
🔄 Why the Residual Graph Matters
Algorithms such as Ford–Fulkerson operate on the residual graph Gf, which contains a forward edge (u, v) with residual capacity c(u,v) − f(u,v) and a backward edge (v, u) with capacity f(u,v). The backward edge lets the algorithm 'undo' previously committed flow, which is crucial for reaching the global optimum rather than getting stuck at a local one.

The Residual Graph & Augmenting Paths

The residual graph is the algorithmic engine that drives every max-flow computation. Given an existing flow f on G, the residual graph Gf is constructed by replacing each edge (u, v) with up to two edges: a forward edge carrying residual capacity c(u,v) − f(u,v) (if positive), and a reverse edge carrying capacity f(u,v) (if positive). An augmenting path is any path from s to t in Gf with strictly positive residual capacity on every edge. The Ford–Fulkerson method repeatedly finds such paths and pushes flow along them until no augmenting path exists, at which point the flow is maximal by the max-flow min-cut theorem.

Left: a simple network with current flow shown as f/c on each edge. Right: the corresponding residual graph. Green solid arrows represent forward edges (unused capacity); yellow dashed arrows represent backward edges (flow that can be reversed). The bottom-right panel identifies an augmenting path s → B → t with a bottleneck capacity of 1.

The diagram above illustrates the transformation from an original flow network (left) to its residual graph (right). Notice how the edge s → A, which carries 3 units of flow on a capacity of 5, generates two residual edges: a forward edge with residual capacity 2 (representing room to send more flow) and a backward edge with capacity 3 (representing the option to cancel previously routed flow). The bottleneck of an augmenting path—the minimum residual capacity among its edges—determines how much additional flow can be pushed along that path. The algorithm terminates when the residual graph contains no s–t path, and the resulting flow is provably maximum.

Worked Example — Ford–Fulkerson on a Small Network

Consider a network with nodes {s, A, B, t} and edges: s→A (capacity 4), s→B (capacity 3), A→B (capacity 2), A→t (capacity 3), B→t (capacity 5). We apply the Ford–Fulkerson method to find the maximum flow from s to t.

Finding Maximum Flow via Ford–Fulkerson
1
Step 1 — InitializeSet f(e) = 0 for every edge. The initial flow value |f| = 0. Construct the residual graph Gf, which is identical to G since no flow has been assigned yet.
|f| = 0
2
Step 2 — First Augmenting Path: s → A → tIdentify the path s → A → t in Gf. The residual capacities along this path are min(4, 3) = 3. Push 3 units along this path. Update: f(s,A) = 3, f(A,t) = 3.
|f| = 0 + 3 = 3
3
Step 3 — Second Augmenting Path: s → B → tIn the updated residual graph, find path s → B → t. Residual capacities: min(3, 5) = 3. Push 3 units. Update: f(s,B) = 3, f(B,t) = 3.
|f| = 3 + 3 = 6
4
Step 4 — Third Augmenting Path: s → A → B → tThe residual graph still contains path s → A → B → t with residual capacities: s→A has 4 − 3 = 1, A→B has 2 − 0 = 2, B→t has 5 − 3 = 2. The bottleneck is min(1, 2, 2) = 1. Push 1 unit. Update: f(s,A) = 4, f(A,B) = 1, f(B,t) = 4.
|f| = 6 + 1 = 7
5
Step 5 — Verify Termination & Identify Min-CutIn the residual graph, s→A has 0 remaining capacity and s→B has 0 remaining capacity. Since s is disconnected from t in Gf, no augmenting path exists. The algorithm terminates. The minimum cut is S = {s}, T = {A, B, t}, with capacity c(s,A) + c(s,B) = 4 + 3 = 7, confirming max-flow = min-cut = 7.
Maximum flow |f| = 7
Verification Checkpoint
Always verify your final flow by checking both constraints. Capacity: f(s,A)=4 ≤ 4 ✓, f(s,B)=3 ≤ 3 ✓, f(A,B)=1 ≤ 2 ✓, f(A,t)=3 ≤ 3 ✓, f(B,t)=4 ≤ 5 ✓. Conservation: Node A: in = 4, out = 1 + 3 = 4 ✓. Node B: in = 3 + 1 = 4, out = 4 ✓.

Strengths, Limitations & Algorithm Comparison

While the Ford–Fulkerson framework is conceptually elegant, its practical performance depends on how augmenting paths are selected. Several refinements have been developed to address efficiency concerns, especially for networks with large or irrational capacities. The table below compares three foundational max-flow algorithms in terms of their time complexity and key characteristics.

Comparison of fundamental max-flow algorithms
AlgorithmPath SelectionTime ComplexityKey Property
Ford–FulkersonAny path (e.g., DFS)O(E × |f*|)May not terminate with irrational capacities
Edmonds–KarpShortest path (BFS)O(V × E²)Polynomial; guaranteed termination
Dinic's AlgorithmBlocking flows on level graphO(V² × E)Faster on dense graphs; builds layered structure
KEY TAKEAWAY
The Ford–Fulkerson method is a framework rather than a single algorithm—its performance depends on path-selection strategy. Think of it like a recipe that says 'add spice to taste': the underlying logic is sound, but the result varies greatly depending on which spice you choose. Edmonds–Karp and Dinic's algorithm are specific instantiations that guarantee polynomial performance, much like specifying '1 teaspoon of cumin' turns a vague recipe into a reproducible one.

Connection to Advanced Topics

The max-flow framework introduced here is the gateway to a rich family of optimization problems in combinatorial mathematics. Understanding the basic max-flow problem equips you with the conceptual toolkit needed for extensions that arise in advanced coursework and real-world applications. The table below maps introductory concepts to their more sophisticated generalizations.

From introductory flow concepts to advanced optimization
Introductory ConceptAdvanced ExtensionKey Difference
Max-flow (single commodity)Multi-commodity flowMultiple source-sink pairs share the same network; edges have shared capacity constraints.
Unweighted edges (capacity only)Min-cost max-flowEach edge also has a per-unit cost; objective is to achieve max flow at minimum total cost.
Max-flow min-cut theoremLP dualityMax-flow min-cut is a special case of strong duality in linear programming.
Augmenting paths in graphsBipartite matchingMaximum bipartite matching reduces to max-flow on a specially constructed network with unit capacities.

One particularly elegant connection is between max-flow and bipartite matching. Suppose you have a set of workers and a set of jobs, and you want to assign as many workers to jobs as possible (each worker to at most one job, each job to at most one worker). By constructing a flow network—source connected to all workers, workers connected to their compatible jobs, all jobs connected to a sink, all capacities set to 1—the max-flow through this network equals the size of the maximum matching. This reduction demonstrates the remarkable versatility of flow theory as a unifying lens for discrete optimization.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain in your own words why the flow conservation constraint does not apply at the source s or the sink t. What would happen to the model if it did?
PROBLEM 2BASIC CALCULATION
A network has edges s→A (capacity 6), s→B (capacity 4), A→t (capacity 5), B→t (capacity 7), and A→B (capacity 3). Find a feasible flow of value 10 and verify both constraints at every node.
PROBLEM 3INTERMEDIATE
Given a network with s→A (cap 5), s→B (cap 4), A→C (cap 3), A→B (cap 2), B→C (cap 6), C→t (cap 8), apply the Ford–Fulkerson method (using any augmenting path strategy) to find the maximum flow. Show each augmenting path, its bottleneck capacity, and the updated flow values.
PROBLEM 4APPLIED
A university network administrator models campus Internet traffic as a flow network. The campus gateway (source) connects to two distribution switches (D₁ and D₂) with bandwidths of 100 Mbps and 80 Mbps respectively. D₁ connects to the library server (capacity 60 Mbps) and the dorm server (capacity 70 Mbps). D₂ connects to the dorm server (capacity 50 Mbps) and the lab server (capacity 40 Mbps). The library, dorm, and lab servers all connect to the central data center (sink) with capacities 60 Mbps, 90 Mbps, and 40 Mbps respectively. What is the maximum data throughput from gateway to data center?
PROBLEM 5CRITICAL THINKING
Prove or give a convincing argument that in any flow network, the value of the maximum flow equals the net flow into the sink t. That is, |f| = Σ f(v, t) − Σ f(t, v). Why does this follow from the conservation constraint, and what structural role does this equivalence play in the max-flow min-cut proof?

Lesson Summary

A flow network is a directed graph equipped with a capacity function, a source, and a sink. A feasible flow must obey the capacity constraint (0 ≤ f(u,v) ≤ c(u,v)) and the conservation constraint (inflow equals outflow at every intermediate node). The central optimization problem is to maximize the flow value |f|, which equals the net flow out of the source and, equivalently, the net flow into the sink.

The max-flow min-cut theorem guarantees that the maximum flow equals the capacity of the smallest bottleneck (minimum s–t cut) in the network. Algorithms such as Ford–Fulkerson and Edmonds–Karp exploit the residual graph and augmenting paths to iteratively improve the flow until no further improvement is possible. These foundational concepts extend naturally to advanced topics including multi-commodity flow, minimum-cost flow, linear programming duality, and bipartite matching.

Varsity Tutors • Finite Mathematics • Network Flow & Optimization