7.1 Max-flow min-cut theorem

Given a simple graph G=(V,E), we set E to be the set of ordered edges of E whereby we give both the orientations to an edge eE. In other words, eE implies that e=(x,y)(y,x) and we rather denote e=(y,x) in such a case. Further, we set e=x,e+=y.

Definition 7.1.

(Flow ) Let s,tV (source, target). A flow f from s (source) to t (target/sink) is a function f:E such that

  1. 1.

    (anti-symmetry) f(e)=f(e)

  2. 2.

    (Kirchoff’s node law ) (df)(x):=e:e=xf(e)=0 for all x{s,t}.

  3. 3.

    (Positive output at source :) (df)(s)0.

Definition 7.2.

Let c:E[0,] be the capacity function. A flow from s to t is said to satisfy the capacity constraints if f(e)c(e) and we call such a flow feasible.

One can suitably define in-flow and out-flow at a vertex and show that Kirchoff’s node law implies that the in-flow and out-flow are equal at all vertices except the sink. We can further define value of a flow v(f):=df(s). Using double-counting and anti-symmetry, we derive that

xVdf(x)=eEf(e)=12eE(f(e)+f(e))=0.

So, from Kirchoff’s node law and definition of v(f), we obtain df(t)=df(s)=v(f).

Let SV. We call a pair (S,Sc) a (s,t)-cut if sS,tS. Defining C(X,Y)=xX,yYc(x,y), f(X,Y)=xX,yYf(x,y), we can show that v(f)=f(S,Sc) for any (s,t)-cut (S,Sc) and any feasible st flow. Note that if S={s}, v(f)=f(S,Sc) by definition. Re-iterating the above argument,

v(f) =df(s)=xSdf(x)=eE,eSf(e)
=e,e,e+Sf(e)+e,e,e+Sf(e)
=12e,e,e+S(f(e)+f(e))+f(S,Sc)=f(S,Sc).

Thus, we have that v(f)=f(S,Sc)C(S,Sc) for a feasible st flow and so

sup{v(f):fis a (s,t)-flow}infS:sS,tSC(S,Sc).

That the converse holds is the non-trivial max-flow min-cut theorem that we will state and prove now. Since the infimum for cuts is taken over a finite set, it is trivally a minimum. Though the LHS may not always be a maximum (see Lemma 7.4 and Exercise 7.8), we refer to it as max-flow and the RHS as min-cut.

Theorem 7.3 (Max-flow min-cut theorem ; Elias-Feinstein-Shannon and Ford-Fulkerson (1956) ).
sup{v(f):fis a feasible (s,t)-flow}=minSV:sS,tSC(S,Sc).

It will soon become clear that Max-flow min-cut theorem is not a single theorem but a class of theorems that can be proven under different frameworks using variants of the ideas we will use to prove the above theorem - Theorem 7.3. We say P=e1ek is a st path if e1=s,ek+=t and ei+=ei+1 for all 1i<k.

Lemma 7.4.

If there exists an infinite capacity st path (i.e. capacity of every edge on the path is infinite), then the max-flow is infinite and so is the min-cut. Else, the min-cut is finite and so is the max-flow.

Proof.

The proof of first part follows by constructing a sequence of flows with increasing strengths. We will prove the second part alone. Let there be no infinite capcity st path. We construct a finite min-cut as follows : Choose an st path P1 and since it is not infinite, there exists e1 such that c(e1)<. Now repeat this procedure on Ge1 and choose an edge e2 in a st path P2 such that c(e2)<. Repeatedly, we can choose edges e1,,ek until G{e1,,ek} has no st path. Let S be the set of vertices in the component of s in G{e1,,ek} and clearly tSc. Since st path exists in G, we have that E(S×Sc){e1,,ek} and hence C(S,Sc)i=1kc(ei)<. ∎

Lemma 7.5.

If the capacity function is bounded, then

sup{v(f):fis a feasible (s,t)-flow}=max{v(f):fis a feasible (s,t)-flow}.
Proof.

Let fn be a sequence of feasible st flows such that

v(fn)sup{v(f):fis a feasible (s,t)-flow}.

Enumerate the set of edges in E as e1,,em. Fix an orientation for each ei. Since fn(e1)c(e1)<, by Bolzano-Weierstrass theorem, there exists a convergent subsequence fn1(e1) such that fn1(e1)x1. Set f0(e1)=x1. Now apply the argument to the sequence of flows fn1 on e2. This way we get a limit x2 and set f0(e2)=x2. Continuing, we get f(ei)=xi for all 1im. This is nothing but a diagonalization argument and so we have constructed a subsequence fnm such that fnm(ei)f0(ei) for all 1im. Thus, we have that

v(f0)=df0(s)=limnmdfnm(s)=limnmv(fnm)=sup{v(f):fis a feasible (s,t)-flow,

i.e., f0 is the maximal element. ∎

Lemma 7.6.

Let f be a st flow in a graph and let P=e1ek be a st path. Then for every ϵ>0, f defined as follows is also a flow : f(e):=f(e) for e,ee1,,ek, f(e)=f(e)+ϵ,e=e1,,ek, f(e)=f(e)ϵ,e=e1,,ek. Further v(f)=v(f)+ϵ.

Proof.

Clearly anti-symmetry holds and (df)(s)=e:e=sf(e)=e:e=sf(e)+ϵ0. It remains only to show that (df)(v)=0 for all vs,t. This holds trivially for all vei,i=2,,k. Suppose v=ei for some 1<ik. Then

(df)(v) =e:e=vf(e)=e:e=v,eei1,eif(e)+f(ei)+f(ei1)
=e:e=v,eei1,eif(e)+f(ei)+f(ei1)=(df)(v)=0.

We first present the Ford-Fulkerson algorithm which gives the idea of the proof.

Remark 7.7 (Ford-Fulkerson Algorithm ).

Given a flow f, define the residual capacity cf(u,v)=c(u,v)f(u,v).

  • Step 1: Set f0.

  • Step 2 : If there is a path P (called f-augmenting path from s to t in G such that cf(u,v)>0 for all edges (u,v)P, then go to Step 3 else go to Step 6.

  • Step 3 : Find cf(P)=min{cf(u,v):(u,v)P} (residual capacity).

  • Step 4 : For each edge (u,v)P, set f(u,v)=f(u,v)+cf(P) and f(v,u)=f(v,u)cf(P).

  • Step 5 : Go back to Step 2.

  • Step 6 : Output flow f as the maximal flow.

Defining Sf be the set of vertices that can be reached from s with a path P such that cf(u,v)>0 for all edges (u,v)P, note that Step 2 can also be rephrased as follows : If tSf go to Step 3 else go to Step 6.

Proof.

(Theorem 7.3) Suppose that the capacity function is bounded. We will prove the theorem under this assumption and then argue the other case.

Let f be the max-flow whose existence is guaranteed by Lemma 7.5. Define

S=Sf={v:there exists a positive residual sv path}{s}.

If tS, then [S,Sc] is as st cut. Also, if eS×Sc, then cf(e)=0 as otherwise e+S which is a contradiction. As we argued before and by the zero residular property of edges in StimesSc, we have that

v(f)=f(S,Sc)=C(S,Sc)

and so the theorem is proved as we already have the inequality.

If tS, then there is a positive residual path P. If we increase the capacity along the path by cf(P) as in Lemma 7.6 and define a new flow f then v(f)=v(f)+cf(P). This will contradict the maximality of f if we show that it satisfies the capacity constraints. Trivially, the capacity constraint is satisfied for all e,eP as the f(e)=f(e) for all e,eP. If eP, then f(e)f(e)c(e). If eP, then f(e)=f(e)+cf(p)f(e)+cf(e)=c(e) and so the capacity constraint is satisfied everywhere and the proof is complete.

Now let us assume that the capacity function is unbounded. But since the min-cut is finite, choose a cut [A,Ac] such that c(A,Ac)<. Define c such that c(e)=c(e)𝟏[c(e)<]+c(A,Ac)𝟏[c(e)=]. Observe that the min-cut under c is same as that in c. Further, if a flow is feasible w.r.t c then it is feasible w.r.t. c as well. Since c is a bounded capacity function, we have a max-flow f such that v(f)= min-cut under c. But then, it also holds that v(f)= min-cut under c and f is feasible under c as well. ∎

Exercise(A) 7.8.

The last part of the proof shows that Lemma 7.5 holds under the assumption of finite min-cut alone i.e., the assumption of bounded capacity can be relaxed considerably. Give a direct proof of this without using Max-flow Min-cut theorem.

Theorem 7.9.

Assume that the min-cut is finite. F-F Algorithm terminates if the capacities are integral and also gives that if capacities are integral, there is an integral maximal flow.

Proof.

If capacities are integral, the min-cut is integral and so is the max-flow. At evey step the F-F algorithm increases the flow strength by at least one as the residual capacity along any augmenting path is a positive integer . Since the max-flow is finite, in finitely many steps the algorithm outputs the max flow.

The algorithm starts with f0 and at every step, the flow on any edge is increased/decreased by the residual capcity if the edge is in a f-augmenting path. Since the residual capacity is integral, the flow is always integral and so is the max-flow. ∎

Example 7.10.

The F-F algorithm need not terminate when capacities are non-integral and here is an example. See https://en.wikipedia.org/wiki/Ford_Fulkerson_algorithm#Non-terminating_example

The definition of a flow can be extended to multiple sources and targets. Let SV,TV be the sources and sinks respectively. The definition of flow can be modified by requiring the Kirchoff’s node law to hold for all xST and positive output at S i.e., sS(df)(s)0. An ST cut is AV such that SA,TAc. We again have a max-flow min-cut theorem as follows.

Theorem 7.11 (Max-flow min-cut theorem for multiple sources and sinks.).
max{v(f):fis a feasible ST-flow}=infAV:SA,TAcC(A,Ac).
Proof.

Let us again assume that the min-cut is finite i.e., there is no infinite capacity ST path. The trivial inequality follows as in the original theorem and also the fact that the supremum is maximum. To argue the equality, instead of repeating the proof, we shall use a reduction. Define G as follows : V=V{a,b},E=E(a×S)(T×b). Set the capacity of the new edges to be infinite. Note that any ST cut in G is a ab cut in G. Further, any ab cut involving edges in EE has infinite capacity. Hence the min ab cut in G and G are equal.

If f is a ab flow in G, let f be the restriction of f to G. Clearly f is skew-symmetric and satisfies Kirchoff’s node law. We verify the last condition as follows : By Kirchoff’s node law in G, we have that

0=sS(df)(s)=e:eS,e+Vf(e)+e:eS,e+=af(e)=sS(df)(s)(df)(a).

Thus, v(f)=sS(df)(s)=(df)(a)=v(f)0 and so the max-flow in G is equal to the max-flow in G. Hence the theorem follows from the single-source single-sink max-flow min-cut theorem. ∎

A more general version of max-flow min-cut theorem is as follows : Let G=(V,E) be a directed graph i.e., e=(x,y)E does not imply that e=(y,x)E. Let s,tV and c:E[0,] be a capacity constraint function. Here even if e,eE, c(e)c(e). Then f:E[0,) is a st flow if

  1. 1.

    e:e=xf(e)=e:e+=xf(e) for all xs,t. (conservation of flow / Kirchoff’s node law).

  2. 2.

    |f|:=e:e=sf(e)e:e+=sf(e)0. (flow strength is non-negative.)

As before, we say that f is a feasible flow (i.e., satisfies capacity constraint c) if for all eE, f(e)c(e). As before, a subset SV is a directed st cut if sS,tS. Further capcity of a cut is defined as c(S):=eE(S×Sc)c(e).

1/15/53/41/24/51/13/33/3
Figure 7.1: The arrows are labelled with a/b where a is the flow passing and b is its capacity. The dotted line shows a min cut. This shows the equality of max flow and min cut in a directed graph
Exercise(A) 7.12.

(Max-flow min-cut theorem for directed graphs.) Under the notation as above, we have that

sup{|f|:f is a st flow satisfying capacity constraint c }=min{C(S):SE is an st cut}.

Proof Sketch : The case of infinite min-cut and infinite capacities can be handled as in the undirected version. So let us assume that capacity is bounded i.e., c:E[0,).

An f-augmenting xy path is a path P:x=x0,,xk=y such that for each 1ik either (i) c(xi1,xi)f(xi1,xi)>0 or (ii) f(xi,xi1)>0. In simple words, either the ‘forward’ edges are not of full capacity or the ‘backward’ edges have positive flow. Define cf(xi1,xi)=c(xi1,xi)f(xi1,xi) in Case (i) and cf(xi1,xi)=f(xi,xi1) in Case (ii). If both cases hold, pick one arbitarily as cf(xi1,xi). As before set cf(P)=mincf(xi1,xi). Show that the flow can be increased by adding cf(P) to the ‘forward’ edges and subtracting cf(P) from the ‘backward’ edges. Now use the proof idea of Theorem 7.3 to complete the proof.

A general version of max-flow min-cut theorem is stated in the exercises.

Exercise(A) 7.13.

Use max-flow min-cut theorem for directed graphs to show the undirected version.

Exercise(A) 7.14.

What is the equivalent of Ford-Fulkerson algorithm for flows on directed graphs.

Exercise(A) 7.15.

Does the F-F algorithm terminate is the capacities are rational ?