Professional Documents
Culture Documents
Discrete Ch7
Discrete Ch7
7 NETWORK
FLOWS
Objectives
After studying this chapter you should
7.0
Introduction
There are many situations in life which involve flow rates; some
are self-evident, such as traffic flow or the flow of oil in a
pipeline; others have the same basic structure but are less
obviously flow problems - e.g. movement of money between
financial institutions and activity networks for building
projects. In most of the problems you will meet, the objective is
to maximise a flow rate, subject to certain constraints. In order
to get a feel for these types of problem, try the following
activity.
Activity 1
This diagram represents a road network. All vehicles enter at S
and leave at T. The numbers represent the maximum flow rate
in vehicles per hour in the direction from S to T. What is the
maximum number of vehicles which can enter and leave the
network every hour?
250
S
400
450
300
100
150
400
250
111
7.1
Di-graphs
A
450
250
300
100
150
400
400
250
350
250
You should have found that the maximum rate of flow for the
network is 600. This is achieved by using each edge with flows
as shown.
300
100
50
350
300
250
Exercise 7A
1. The diagrams below show maximum flow
capacities in network N1 , and actual intended
flows in N 2.
A
13
10
T
18
12
C
A
14
14
5
T
16
10
112
19
N2
2.
Draw a network which represents the results of a tournament
discussed by this table
17
20
N1
7.2
The main aim is to find the value of the maximum flow between the
source and sink. You will find the concept of the capacity of a cut
very useful. The network opposite illustrates a straightforward flow
problem with maximum allowable flows shown on the edges.
The dotted line shown in the first diagram illustrates one possible
cut, which separates S from T. Its capacity is defined as the sum
of the maximum allowable flows across the cut; i.e. 2 + 5 + 2 = 9 .
There are many possible cuts across the network. Two more are
shown in the second diagram. For L1, the capacity is
2 + 0 + 4 = 6.
The reason for the zero is as follows: the flows in AC and SB cross
the cut from left to right, whereas the flow in BA crosses from right
to left. To achieve maximum flow across the cut the capacity of
BA is not used.
C
2
4
5
4
3
3
4
L1 B
L2
Activity 2
For the network shown above, find all possible cuts which separate
S from T, and evaluate the capacity of each cut. What is the
minimum capacity of any cut?
Activity 3
Find the maximum flow for the network shown above. What do
you notice about its value?
113
Example
E 5
Solution
By inspection, the maximum flow has value 17; this is
illustrated by the circled numbers on the network opposite.
Also shown is a cut of the same capacity.
7 4
6
If you can find a cut and flow of the same value, can you be sure
that you have found the maximum flow?
2 2
Exercise 7B
1. The network below shows maximum capacities of
each edge. Draw up a table showing the values
of all the cuts from A, B to C, D, E. Which is the
minimum cut? Draw the network with flows
which give this maximum total flow.
(a)
(b)
9
12
S
16
18
(c)
S
12
7.3
12
32
5
20
10
5
20
15
You may have noticed that the minimum cut is coincident with
edges which have a flow equal to their maximum capacity.
The diagram opposite shows a network with its allowable
maximum flow along each edge. The minimum cut is marked L.
It has a capacity of 15. This line cuts the edges with capacities 7
and 8. The actual maximum flow of value 15 is shown in the
diagram, and it should be noted that the minimum cut only
passes through edges that are saturated (or have zero flow in the
opposing direction).
114
30
8
7
10
20
25
11
5
2
7
8
L
7
12
T
10
9
8
7
T
8
8
8
Activity 4
By trial and error, find the maximum possible flow for the
network opposite.
10
Find a cut which has a capacity equal to the maximum flow (you
S
might find it helpful to mark each edge which is satisfied by the
maximum flow - the minimum cut will only cut saturated edges
or edges with zero flows in the opposing direction.)
18
5
27
33
H
4
Exercise 7C
1. Find the maximum flow for each of these
networks, and show the minimum cut in each
case.
40
40
15
20
45
50
10
15
15
25
(a)
12
10
4
T
12
50
(b)
10
15
S
12
20
50
35
35
(c)
20
10
S
8
14
15
7.4
Labelling flows
Example
The network opposite has a maximum flow equal to 21, shown by
the cut XY. When performing the following algorithm you can stop,
either when this maximum flow has been reached or when all paths
from S to T become saturated.
A
12
12
13
15
B
Y
1.
2.
3.
4.
12
T
A
4
13
15
A
0
12
4
9
4
11
A
0
12
1
4
4
9
4
11
12
6.
12
0
8
A
0
S
3
12
4
13
13
9
2
7.
116
4
9
13
The method looks quite complicated, but after a little practice you
should become quite adept at it.
12
13
The next example shows how all possible paths sometimes need
to be considered.
A
Example
Use the labelling procedure to find the maximum flow from S to
T in the network shown opposite.
5
B
4
8
4
T
2
7
C
Solution
1.
2.
4
35
0 5
B
3
4
2
7
C
A
3.
3
0 0 5 1
5
B
3
4
2
8
S
7
C
4.
8
S
3
00 5 1
5
2 B
423
0
5
C
A
5.
8
S
3
00 5 1
8
B
5
0
1 32
0
2
C
A
6.
8
S
4
01 4 0
8
B
6
0
0 42
0
1
7.
8
S
6
4
B
8
4
T
2
117
Exercise 7D
1. Use the labelling algorithm in order to find the
maximum flow in each of these networks, given
the maximum capacity of each edge.
(a)
12
15
18
T
12
16
6
(b)
20
5
14
18
12
12
10
15
6
(c)
35
50
12
20
30 8
6
4
4
T
30
55
14
8
18
15
7.5
S1
S2
3
2
2
1
3
T2
T3
7
5
T1
3
6
3
2
4
3
5
4
Activity 5
Add a super source and a super sink to this network, in which
maximum capacities are shown, and then use the labelling
algorithm to find a maximum flow through it.
20
20
30
15
10
10
10
30
10
15
25
Activity 6
Investigate the traffic flow in a small section of the road
network near to you, for which you could estimate maximum
flows in each road.
118
15
7.6
Minimum capacities
4,6
5,11
5,9
0, 5
2,3
3,9
6,10
Activity 7
Find the maximum flow in the network shown above.
Investigate how the max flow - min cut theorem can be adapted
for this situation.
Example
Find the maximum flow for the network shown opposite.
9,14
4,10
B
6,12
3,6
T
4,11
7,11
0,9
Solution
L3
L1
In order to find a minimum cut, the max flow - min cut theorem
is adapted so that you add upper capacities of edges along the
cut directed from S to T, but subtract lower capacities of edges
directed from T to S.
C
L2
2.
Begin with any flow. The one shown opposite will do.
Note that none of the upper or lower capacities of the
edges has been violated. It is not the best because the
flow is only 15.
B
10
3
5
For each edge, insert the potential excess flow and the
corresponding back flow. For example, BT carries a
flow of 10 at present. It could be 2 more and it could be
4 less, since the minimum and maximum flows in the
edge are
6 and 12.
3
This has been done for all the edges in the network
resulting in the diagram opposite.
10
B
2
1
0
S
3
4
1
119
3.
2
3
2
3
4.
6.
0
6
0
3
2
5
0
6
5.
12
12
3
6
Exercise 7E
1. For the network of Activity 7 find any flow in
the network and then use the labelling algorithm
to find the maximum flow.
2. Which, if any, of the following networks
showing upper and lower capacities of edges has
a possible flow? If there is no possible flow,
explain why.
A
(a)
2,4
T
3,7
5,12
0,7
(b)
S1
S2
0,6 D
3,8
1,12
120
4,11
0,3
4,8
5,8
0,6
3,11
1,9
4,15
2,7
1,6
2,5
3,12
2,4
3,7
3,9
5,7
3,9
T
5,11
T
5,12
7.7
Miscellaneous Exercises
9
8
20
20
12
7
15
25
N2
15
1,12
6,10
3,8
5,9
0,5
3,7
To
Lon
Bir
London
40
Birmingham
Manchester
Leeds
Liverpool
From
Man Lds
Lpl
New
20
10
15
12
12
15
30
2,8
N3
11
18
11
12
12
14
22
12
25
14
10
10
15
20
10
20
20
11 3
6
8
10
6,12
T
9,14
3,7
(a) 7, 10
(b) 3, 12
(c) 4, 5
(d) 1, 8
S3
20
16
15
12
12
11
3
15
15
15
20
20
T1
20
14
x, y 4,6
S2 20 20
12
S1
7
4
4 10
5,8
7,11
9
6
10
20
T2
10
2
5
3
4
4
6
121
5
2,7
2,5
2,7
2,6 E
S
3,6
3
1
1,4
7,10
6,11
T
4,7
3,7
C
4,8
2,6
3,8
20,10
90,50
30,10
C
30,30
30,20
30,20
30,20
30,10
30,0
50,20
90,40
40,30
D
14. In the following basic
network, each arc is
labelled with its capacity:
T
7
80,55
50,20
25,20
30,20
20,10
40,30
122
T
7
2,7
1,4
3,5
T
2
5,10
1,3
6,9
6
3
1
5
B
2
150
200
C
350
B
400
T
50
200
100
D
123
124