i
st
es
ft
uf
Fi
.
oti
at
3.4 MAXIMAL-FLOW PROBLEMS 93
called the sink. Unlike the transportation
or arc connecting the source and the sink.
of some intermediate nodes,
flows are rerouted.
problems, there may not be a direct Jink
The flow network will generally consist
known as transshipment Points, through which the
An example of a flow network is given by Fig, 3.1. The source node is de-
noted by the symbol s and the sink node by n. Nodes | and 2 are the intermediate
nodes. There are six arcs connecting the various no
ces,
(1,2), 2, D, (ym), and (2, 2). es, denoted by (s, 1), (s, 2),
Flow in arc (i, /) denoted by f,, is the quantity shipped from node i to node j.
We will assume that all the arcs are directed. In other words, flow in arc (i, j) is
possible from node i to node j only. Let f denote the total amount shipped from
the source to the sink, and k, denote the capacity of arc (i, ), which is the maxi-
mum flow possible from ito j.
The Maximal-Flow Problem Ke
Consider the f] low network represented by Fig. 3.1. Given the capacities ky on
flows on each arc (i, /), and that the flow must satisfy conservation (i.e., the total
flow into a node must be equal to the total flow out of that node), we want to de-
termine the maximum flow f that can be sent from the source node s to the sink
node n.
Figure 3.1
The linear programming formulation of the maximal flow problem is given:
Maximize: Z=f
Subject to:
Satlaaf (3.3)
SiatSin =fat sn (3.4)
Satin =Satha G.5)
Sint Sin =f G.6)
Osfi Sku G.7)
Osfp Ska (3.8)
0Sf2 Ska (3.9)
0=fn Sky (3.10)
- OSfin Skin G1),
OS fin Skin G.12)
Equation 3.3 represents the conservation of flow at the source node; Eqs. 3.4 and
3.5 represent the conservation of flow at the intermediate nodes | and 2, respec-
tively; Eq. 3.6 represents the conservation at the sink node, while Eqs, 3.7 to 3.12
restrict the flows (f,) so as to be nonnegative with finite upperbounds. Although
the maximal flow problem can be sotved by the simplex method, there exists an
efficient network method to find the maximum flow directly. We shall first intro-
ssarr ay a
94 NETWORK ANALYSIS
duce some basic concepts from network theory that are fundamental to the ney,
procedure.
Definitions
Forward Arcs. At any node i, all the arcs that are leaving node i are called for.
ward arcs with respect to node i. Similarly, all the arcs entering a node are calleq
backward arcs for that node. It should be noted here that an arc may bea forward
are with respect to some node, and a backward arc with respect to some other
node.
In Fig. 3.1, the arcs (1, m) and (1, 2) are forward arcs for node 1 while the arcs
(s, 1) and (2, 1) are its backward arcs. But for node 2, the arc (1, 2) is a backward
arc while (2, 1) is a forward arc.
A path connecting the source and the sink is a sequence of arcs starting from
the source node and ending in the sink node. For example, in the same figure, a
path connecting s and 7 is given by the sequence of arcs (5, 1), (1, 2), (2, ). Note
that there exists more than one path connecting s and 7 in Fig. 3.1.
Acycleis a path whose beginning and ending nodes are the same.
Let N denote the collection of all the nodes in the network. Then, a cut sepa-
rating the source and the sink is a partition of the nodes in the network into two
subsets S and 5 such that the source node is in S and the sink node is in 5.
For example, in Fig. 3.1, acut (S, 5) is given by S=(s, 1, 2), S=(n). Note that
SUS=N=(s, 1, 2,1), SM 5=the empty set, se S, and eS. A pictorial repre-
sentation of the cut is given below:
Similarly a number of other cuts may be found for the network. The capacity of #
cut denoted by K(S, 5) is the sum of all the capacities of the arcs from the nodes in
S to those in 5. For example, the capacity of the cut, (S, 5) where S=(s, 1, 2)»
S=(n) is Kj, +Ky,. But the capacity of the cut where S=(s, 2) and 5=(I, n) is
K,, + K,, + Kz,. (Since arc (1, 2) is directed from a node in 5 to a node in §, it is no!
included in the summation.)*
3.4 MAXIMAL‘FLOW PROBLEMS 95
The cut with the smallest capacity is called a minimal cut. From the pictorial
representation of the cuts, it is rather obvious that if all thé arcs of a cut are re-
moved from the network then there exists no path from the source to the sink;
hence, no flow would be possible, In other words, any flow from s to n must flow
through the arcs in the cut, and consequently the flow fis limited by the capacity
of that cut. This relation between flows and cuts is given by the following lemma:
Lemma 1
For any directed network, if f is the flow from the source to the sink, and
(S, 5) is a cut, then the value of fis less than or equal to the capacity of that cut
K(S, 8).
Since Lemma 1 is true for any cut in the network, we can staté that any feasi-
ble flow from source to sink cannot exceed the capacity of any cut. Thus the maxi-
mal flow across the network is limited by the capacity of the minimal cut. The fol-
lowing important theorem states that it is always possible to find a feasible flow
from s to equal to the capacity of the minimal cut.
Max-Flow Min-Cut Theorem (Ford and Fulkerson (3)]. For any network the
value of the maximal flow from source to sink is equal to the capacity of the mini-
mal cut.
Using the max-flow min-cut theorem one can find the maximal flow in a net-
work by finding the capacities of all the cuts, and choosing the minimum capac-
ity. Though this gives the maximal value of f, it does not specify how this flow is
routed through various arcs. So we describe a different procedure known as the
maximal flow algorithm whose validity is based on the max-flow min-cut theo-
rem. The basic principle of this procedure is to find a path through which a posi-
tive flow can be sent from the source node to the sink node. Such a path is termed
a flow augmenting path. This path is used to send as much flow as possible from s
ton. This process is repeated until no such flow augmenting path can be found at
which time we have found the maximal flow.
Labeling Routine. This is used to find’a flow augmenting path from the
source to the sink. We start from the source node s. We say that node j can be
labeled if a positive flow’can be sent from s to j. In general, from any node i, we
can /dbel node j, if one of the following conditions is satisfied:
1. The arc connecting the nodes j and jis a forward arc [i-e., the existing arc is (i, j)], and
the flow in arc (i, /) is less than its capacity Ge. SysK)- 2 en
2. The are connecting i and /is a backward arc [i.e., the existing arc is (j, )], and the flow
in arc (j, i) is greater than zero, (i.e., f,>0)
We continue this labeling routine until the sink node is labeled. We then have a
flow augmenting path.
Max-Flow Algorithm. The algorithm is initiated with a feasible flow on all
arcs, satisfying capacity restrictions, and conservation of flows at all nodes, To
improve this flow, we initially label node s, and then apply the labeling routine to
label another node. When the sink is labeled, we have a flow augmenting path
from s to n through which a positive flow.can be sent. Now we retrace the flow
augmenting path with the help of the labels on the nodes and compute the maxi-
mal flow 6 that can be sent in the path, Then increase the flow by 6 on all the for-
ward arcs in the path, and decrease the flow by 6 on all the backward arcs in the
path, Repeat the procedure by finding another flow augmenting path from s to n96 NETWORK ANALYSIS.
using the labeling routine. The algorithm terminates when no flow augmentin,
path can be found, at which time we have the maximal flow possible from s to a,
We shall illustrate the max-flow algorithm through an example problem,
EXAMPLE3.4-1
Compute the maximal flow f from s to nin the following network, where the
numbers of the arcs represent their capacities:
Prestep. The max-flow algorithm is initiated with zero flows on al}
arcs. In Fig. 3.2, the numbers on the arcs (i, /) represent
Ci, Ki).
Figure 3.2
Step I (Fig. 3.2). To find a flow augmenting path from s to , node s is ini-
tially labeled. (Labels are denoted by asterisks.) From s,
we can label node | since (s, 1) is a forward arc, carrying 4
flow f,, which is less than its capacity. From node 1, node
2 is labeled through the forward arc (1, 2) and from node 2
the sink is labeled. We now have a flow augmenting path
consisting only of forward arcs as shown below:
The numbers on the arcs indicate the maximum flow that
is possible in each arc. Thus the maximal flow that can b¢
sent through this flow augmenting path is 3 units. This in”
creases f by 3 units, and the flow on all (forward) arcs i"
the path by 3-units. The new flow configuration is give"
by Fig. 3.3. ;3.4 MAXIMAL-FLOW PROBLEMS 97
Figure 3.3
Step II (Fig. 3.3). Repeat the labeling routine and a new flow augmenting
Path is
The maximum flow that can be sent through this path is 4 |
- This increases the flow across the network (f}) to 7
units. The new flow configuration is given by Fig. 3.4.
Figure 3.4
Step III (Fig. 3.4). Now node 1 cannot be labeled from node s since (s, 1) is a
forward arc whose flow is equal to its capacity. But a new
flow augmenting path can be found as follows:
eer pe
This increases the total flow from s to n by 5 units as
shown in Fig, 3.5.
Figure 3.5
Step IV (Fig. 3.5). Starting from node s, node 2 can be labeled, but the sink
cannot be labeled from 2 since the flow in arc (2, n) has
reached its capacity. But node | can be labeled from node
2 since (1, 2) is a backward arc carrying a positive flow.a... OS, ORR re ae
98 NETWORK ANALYSIS
From node | the sink can be labeled using the forward are
(1, 7). Thus we have a new flow augmenting path consist.
ing of two forward arcs (s, 2) and (1,7), and a backwarq
arc (1, 2) as shown below:
To increase the flow f through this path, we increase the
flow on the forward arcs and decrease it in the backward
arcs. Thus the maximum increase in f possible is 3 units,
and the new assignment of flows is given in Fig. 3.6.
\
ss
> \ <= Minimal cut
SVs
5
Bal
Figure 3.6
Step V (Fig. 3.6). Even though node 2 can be labeled from node s, the sink
can never be labeled. Hence, no new flow augmenting
paths are possible, and we have found the maximal flow
possible which is 15 units.
REMARKS |
To verify if f= 15 is the maximum flow, we can define a cut (S, 5) by placing
all the labeled nodes in S and the unlabeled nodes in 5 (see Fig. 3.6). This gives
S=(s, 2), 5=(I, n) and the capacity of cut K(S, 5)=15. Since f cannot exceed the
capacity of any cut by Lemma 1, f=15 is the maximal flow possible, and the cut
shown in Fig. 3.6 is the minimal cut.
Extensions and Applications
1. Undirected Arcs. Consider a network that contains arcs with no specified
direction of flow. These arcs are generally called undirected arcs, When an arc
connecting nodes i and jis undirected, with capacity K, we interpret that as
fj SK
Sisk
Sv fi=0
In other words, a maximum of K units of flow is possible between nodes / and jin
cither direction, but flow is permitted in one of the directions only, Recall that the
maximal flow algorithm discussed earlier can be applied to directed networks
a , y