Network Flows

Introduction

Network flow theory studies how commodities, information, or other quantities move through networks. Consider water flowing through pipes, traffic through road networks, or data through communication channels. Each edge has a capacity limiting how much can flow through it, and the fundamental question is: what is the maximum amount that can be transported from a source to a destination?

Network flow problems have diverse applications including transportation logistics, telecommunications, bipartite matching, project selection, and image segmentation. The mathematical theory reveals deep connections between maximum flows and minimum cuts.

Flow Networks

A flow network is a directed graph G=(V,E) G equals open paren V comma E close paren with:

A source vertex s∈V s is a member of V with no incoming edges.

A sink (target) vertex t∈V t is a member of V with no outgoing edges.

A capacity function c:E→ℝ≥0 c colon E right arrow the real numbers sub is greater than or equal to 0 assigning a non-negative capacity c⁡(u,v) c of open paren u comma v close paren to each edge (u,v) open paren u comma v close paren

Definition of Flow

A flow is a function ƒ:E→ℝ≥0 f with hook colon E right arrow the real numbers sub is greater than or equal to 0 satisfying two constraints:

Capacity Constraint

For every edge (u,v)∈E open paren u comma v close paren is a member of E

0≤ƒ⁡(u,v)≤c⁡(u,v) 0 is less than or equal to f with hook of open paren u comma v close paren is less than or equal to c of open paren u comma v close paren

The flow through an edge cannot exceed its capacity.

Flow Conservation

For every vertex v∈V∖{s,t} v is a member of V set minus the set s comma t

∑u:(u,v)∈Eƒ⁡(u,v)=∑w:(v,w)∈Eƒ⁡(v,w) the sum over u colon open paren u comma v close paren is a member of E of f with hook of open paren u comma v close paren equals the sum over w colon open paren v comma w close paren is a member of E of f with hook of open paren v comma w close paren

Total flow into a vertex equals total flow out (except at the source and sink).

Value of a Flow

The value of a flow ƒ f with hook is the net flow leaving the source:

|ƒ|=∑v:(s,v)∈Eƒ⁡(s,v)−∑u:(u,s)∈Eƒ⁡(u,s) the absolute value of f with hook equals the sum over v colon open paren s comma v close paren is a member of E of f with hook of open paren s comma v close paren minus the sum over u colon open paren u comma s close paren is a member of E of f with hook of open paren u comma s close paren

By flow conservation, this equals the net flow entering the sink. The maximum flow problem asks: find a flow ƒ f with hook maximizing |ƒ| the absolute value of f with hook

Cuts

An s-t s minus t cut is a partition of vertices into sets (S,T) open paren S comma T close paren where s∈S s is a member of S and t∈T t is a member of T The capacity of a cut is the sum of capacities of edges from S S to T T

c⁡(S,T)=∑u∈S,v∈T:(u,v)∈Ec⁡(u,v) c of open paren S comma T close paren equals the sum over u is a member of S comma v is a member of T colon open paren u comma v close paren is a member of E of c of open paren u comma v close paren

A minimum cut is a cut with the smallest capacity among all s s-t t cuts.

Max-Flow Min-Cut Theorem

One of the fundamental results in combinatorial optimization is the max-flow min-cut theorem:

The value of a maximum flow equals the capacity of a minimum cut.

maxƒ⁡(ƒ)=min(S,T)⁡(c⁡(S,T)) max over f with hook of f with hook equals min over open paren S comma T close paren of open paren c of open paren S comma T close paren close paren

This theorem has a natural interpretation: the maximum amount that can flow from source to sink is limited by the bottleneck cut, and this limit is always achievable.

Residual Networks

Given a flow ƒ f with hook the residual network Gƒ G sub f with hook represents remaining capacity. For each edge (u,v) open paren u comma v close paren in the original network:

The residual capacity is cƒ⁡(u,v)=c⁡(u,v)−ƒ⁡(u,v) c sub f with hook of open paren u comma v close paren equals c of open paren u comma v close paren minus f with hook of open paren u comma v close paren (remaining forward capacity).

A backward edge (v,u) open paren v comma u close paren with residual capacity cƒ⁡(v,u)=ƒ⁡(u,v) c sub f with hook of open paren v comma u close paren equals f with hook of open paren u comma v close paren represents the ability to reduce flow.

Ford-Fulkerson Method

The Ford-Fulkerson method is an iterative approach to finding maximum flow:

Initialize ƒ⁡(u,v)=0 f with hook of open paren u comma v close paren equals 0 for all edges.

While there exists an augmenting path p p from s s to t t in the residual network:

Find the bottleneck capacity cƒ⁡(p)=min(u,v)∈p⁡(cƒ⁡(u,v)) c sub f with hook of p equals min over open paren u comma v close paren is a member of p of open paren c sub f with hook of open paren u comma v close paren close paren

Augment flow along path p p by cƒ⁡(p) c sub f with hook of p

When no augmenting path exists, the current flow is maximum.

Edmonds-Karp Algorithm

The Edmonds-Karp algorithm implements Ford-Fulkerson using BFS to find shortest augmenting paths. This guarantees termination and runs in O⁢(V⁢E2) O times open paren V E squared close paren time.

Applications

Bipartite Matching

Maximum bipartite matching can be solved as a max flow problem. Given a bipartite graph with vertex sets L L and R R add a source connected to all vertices in L L and a sink connected from all vertices in R R with all capacities equal to 1. The maximum flow equals the maximum matching size.

Edge-Disjoint Paths

The maximum number of edge-disjoint paths from s s to t t equals the maximum flow when all edge capacities are 1. By the max-flow min-cut theorem, this also equals the minimum number of edges whose removal disconnects s s from t t (Menger's theorem).

Image Segmentation

In computer vision, minimum cuts can separate foreground from background in images. Pixels are vertices with edges to neighbors; edge weights reflect similarity. A minimum cut finds the optimal boundary.

Proof of Max-Flow Min-Cut Theorem

The proof establishes three equivalent conditions: (1) ƒ f with hook is a maximum flow, (2) there is no augmenting path in Gƒ G sub f with hook and (3) |ƒ|=c⁡(S,T) the absolute value of f with hook equals c of open paren S comma T close paren for some cut (S,T) open paren S comma T close paren

Key insight: for any flow ƒ f with hook and any cut (S,T) open paren S comma T close paren the flow value |ƒ| the absolute value of f with hook equals the net flow across the cut:

|ƒ|=∑u∈S,v∈Tƒ⁡(u,v)−∑u∈T,v∈Sƒ⁡(u,v)≤c⁡(S,T) the absolute value of f with hook equals the sum over u is a member of S comma v is a member of T of f with hook of open paren u comma v close paren minus the sum over u is a member of T comma v is a member of S of f with hook of open paren u comma v close paren is less than or equal to c of open paren S comma T close paren

Thus every flow is bounded by every cut. When equality holds, both are optimal.

Minimum Cost Flows

In minimum cost flow problems, each edge also has a cost w⁡(u,v) w of open paren u comma v close paren per unit of flow. The goal is to find a flow of a specified value d d that minimizes total cost:

min⁡(∑(u,v)∈Ew⁡(u,v))⋅ƒ⁡(u,v)subject to |ƒ|=d min of open paren the sum over open paren u comma v close paren is a member of E of w of open paren u comma v close paren close paren times f with hook of open paren u comma v close paren subject to the absolute value of f with hook equals d

This generalizes shortest path, maximum flow, and assignment problems. Algorithms include successive shortest path and cycle-canceling methods.

Multiple Sources and Sinks

Problems with multiple sources {s1,…,sk} the set s sub 1 comma dot dot dot comma s sub k or sinks {t1,…,tm} the set t sub 1 comma dot dot dot comma t sub m reduce to single source-sink problems by adding a super-source connected to all sources and a super-sink connected from all sinks.

Summary

A flow network is a directed graph with edge capacities, a source, and a sink. A flow assigns non-negative values to edges respecting capacity constraints and conservation (flow in equals flow out at internal vertices).

The max-flow min-cut theorem establishes that the maximum flow value equals the minimum cut capacity. This fundamental duality has algorithmic implications: finding a maximum flow also finds a minimum cut.

The Ford-Fulkerson method iteratively augments flow along paths in the residual network. The Edmonds-Karp variant using BFS runs in polynomial time.

Applications span bipartite matching, edge connectivity, transportation, and computer vision. Network flow theory exemplifies the power of combinatorial optimization, connecting graph structure to algorithmic solutions.