In this section, we develop the classic labeling algorithm of Ford and Fulkerson which starts with any flow in a network and proceeds to modify the flow—always increasing the value of the flow—until reaching a step where no further improvements are possible. The algorithm will also help resolve the debate Alice, Bob, Carlos, and Yolanda were having in the previous section.
Our presentation of the labeling algorithm makes use of some natural and quite descriptive terminology. Suppose we have a network \(\GVE\) with a flow \(\phi\) of value \(v\). We call \(\phi\) the current flow and look for ways to augment \(\phi\) by making a relatively small number of changes. An edge \((x,y)\) with \(\phi(x,y)>0\) is said to be used, and when \(\phi(x,y)=c(x,y)>0\), we say the edge is full. When \(\phi(x,y)\lt c(x,y)\), we say the edge \((x,y)\) has spare capacity, and when \(0=\phi(x,y)\lt c(x,y)\), we say the edge \((x,y)\) is empty. Note that we simply ignore edges with zero capacity.
The key tool in modifying a network flow is a special type of path, and these paths are not necessarily directed paths. An augmenting path is a sequence \(P=(x_0,x_1,\dots,x_m)\) of distinct vertices in the network such that \(x_0=S\), \(x_m=T\), and for each \(i=1,2,\dots,m\), either
- \((x_{i-1},x_i)\) has spare capacity or
- \((x_i,x_{i-1})\) is used.
Example13.6
Let's look again at the network and flow in Figure 13.2. The sequence of vertices \((S,F,A,T)\) meets the criteria to be an augmenting path, and each edge in it is a forward edge. Notice that increasing the flow on each of \((S,F)\), \((F,A)\), and \((A,T)\) by any positive amount \(\delta \leq 12\) results in increasing the value of the flow and preserves the conservation laws.
If our first example jumped out at you as an augmenting path, it's probably less clear at a quick glance that \((S,E,D,C,B,A,T)\) is also an augmenting path. All of the edges are forward edges except for \((C,B)\), since it's actually \((B,C)\) that is a directed edge in the network. Don't worry if it's not clear how this path can be used to increase the value of the flow in the network, as that's our next topic.
Ignoring, for the moment, the issue of finding augmenting paths, let's see how they can be used to modify the current flow in a way that increases its value by some \(\delta > 0\). Here's how for an augmenting path \(P=(x_0,x_1,\dots,x_m)\). First, let \(\delta_1\) be the positive number defined by: \begin{equation*} \delta_1 =\min\{c(x_{i-1},x_i)-\phi(x_{i-1},x_i):(x_{i-1},x_i) \text{ a forward edge of } P.\} \end{equation*} The quantity \(c(x_{i-1},x_i)-\phi(x_{i-1},x_i)\) is nothing but the spare capacity on the edge \((x_{i-1},x_i)\), and thus \(\delta_1\) is the largest amount by which all of the forward edges of \(P\). Note that the edges \((x_0,x_1)\) and \((x_{m-1},x_m)\) are always forward edges, so the positive quantity \(\delta_1\) is defined for every augmenting path.
When the augmenting path \(P\) has no backward edges, we set \(\delta= \delta_1\). But when \(P\) has one or more backward edges, we pause to set \begin{equation*} \delta_2 =\min\{\phi(x_{i},x_{i-1}):(x_{i-1},x_i) \text{ a backward edge of } P\}. \end{equation*} Since every backward edge is used, \(\delta_2>0\) whenever we need to define it. We then set \(\delta=\min\{\delta_1,\delta_2\}\).
In either case, we now have a positive number \(\delta\) and we make the following elementary observation, for which you are asked to provide a proof in Exercise 13.7.4.
Proposition13.7
Suppose we have an augmenting path \(P=(x_0,x_1,\dots,x_m)\) with \(\delta>0\) calculated as above. Modify the flow \(\phi\) by changing the values along the edges of the path \(P\) by an amount which is either \(+\delta\) or \(-\delta\) according to the following rules:
Increase the flow along the edges of \(P\) which are forwards.
Decrease the flow along the edges of \(P\) which are backwards.
Example13.8
The network flow shown in Figure 13.2 has many augmenting paths. We already saw two of them in Example 13.6, which we call \(P_1\) and \(P_3\) below. In the list below, be sure you understand why each path is an augmenting path and how the value of \(\delta\) is determined for each path.
\(P_1=(S,F,A,T)\) with \(\delta= 12\). All edges are forward.
\(P_2=(S,B,A,T)\) with \(\delta= 8\). All edges are forward.
\(P_3=(S,E,D,C,B,A,T)\) with \(\delta= 9\). All edges are forward, except \((C,B)\) which is backward.
\(P_4=(S,B,E,D,C,A,T)\) with \(\delta= 2\). All edges are forward, except \((B,E)\) and \((C,A)\) which are backward.
In Exercise 13.7.7, you are asked to update the flow in Figure 13.2 for each of these four paths individually.