Tải bản đầy đủ (.pdf) (55 trang)

Minimum cost maximum flow problem

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.54 MB, 55 trang )

MINIMUM COST MAXIMUM FLOW PROBLEM

ADDIS ABABA UNIVERSITY
SCHOOL OF GRADUATE STUDIES
FACULTY OF COMPUTER AND MATHEMATICAL SCIENCES
DEPARTMENT OF MATHEMATICS

In partial fulfillment of the requirement of the degree of
Master of Science in Mathematics
(Optimization Stream)
By: Haileleule Getnet
Advisor: Berhanu Guta (PhD)

Jun, 2017
1


Permission
This is to certify that this project is compiled by Mr. Haileleule Getnet Ademe in
the Department of Mathematics, Addis Ababa University, under my supervision. I hereby
also confirm that the project can be submitted for evaluation by examiners and eventual
defense.
Date: ----------------------------------

Advisor:
---------------------------------

Berhanu Guta (Ph.D)

2



Abstract
This work presents an algorithm for computing the maximum flow and minimum cost flow
problem of undirected graphs, based on the well-known algorithm presented by Ford and
Fulkerson for directed graphs. The new algorithm is equivalent to just applying Ford and
Fulkerson algorithm to the directed graph obtained from original graph but with two directed
arcs for each edge in the graph, one in each way.
We shall also discuss a range of network problems and finally discuss in details the minimum
cost maximum flow problem. Network models in this chapter will focus on techniques of finding
the most efficient ways of finding the shortest route between two locations; determine the
minimum-cost flow in a network that satisfies supply and demand requirements that will produce
maximum flow in the network.
Goal: Build a cheap network to satisfy the flow requirement
Keywords: Max Flow, Minimum Cost, Parametric Flow

3


Acknowledgement
Foremost, I would like to express my sincere gratitude to my advisor Dr.Berhanu Guta for
his generous advice throughout the preparation of this project.
I also express my thanks to all staff members of the department of Mathematics and to all
my friends for their unmentioned cooperation on my project.
Finally I thank my family for their endless love and support.

4


Contents
Abstract


i

Acknowledgements

ii

1

Introduction

1

2

Preliminary Concepts

4

2.1 Network Optimization Models (NOM) and Network flow problem

4

2.1.1 Methods to solve Minimum cost maximum flow problems . . . . . . 4
2.1.2 Graphs and Network Flows……………………………………........5
3

Maximum Flow Problems ………………………………………………...14
3.1 Notation and Assumptions ……………………………………………..15
3.2 Applications…………………………………………………………….16

3.3 Flows and Cuts …………………………………………………………20
3.4 Generic Augmenting Path Algorithm …………………………………..21
3.5 Labeling Algorithm and the maximum flow minimum cut theorem

22

3.6 Maximum Flow Algorithm ……………………………………………..24
4

Minimum Cost Flow Problems……………………………………………25
4.1 Generalized Minimum Cost Flow Problems …………………………...25
4.2 Residual Network ………………………………………………………28
4.3 Reduced Cost Optimality Conditions …………………………………..29
4.4 Algorithm and the Integrality Property ………………………………...30

5

The Minimum Cost Maximum Flow Problems…………………………………………43
5.1 The Minimum Cost Circulation Problem ……………………………………………..44

6

Reference ………………………………………………………………… ……………………………………………………………………………51

5


CHAPTER 1
INTRODUCTION
We encounter many different types of networks in our everyday lives, including electrical,

telephone, cable, highway, rail, manufacturing and computer networks. Networks consist of
special points called nodes and links connecting pairs of nodes called arcs. The maximum flow
problem is one of the most fundamental problems in network flow theory and has been
investigated extensively. From last few decades researchers have made a steady stream of
innovation that have resulted in new solution methods and improvements to known methods.
Continuous improvements to algorithms have been made by researchers for solving several
classes of problems. In this paper recent techniques and algorithms related to parametric
maximum flow problem are given.
In the selection of the best optimal solution on many network optimization problems more than
one criterion can be considered. For example, in Transportation problems, the criteria that can be
used are the minimization of the cost for selected routes, the minimization of arrival times at the
point of destination, the minimization of the deterioration of goods, the minimization of the load
capacity that would not be used in the selected vehicles, the maximization of safety, reliability,
etc. This leads to Multi objective optimization problems. In Multi objective optimization
problems there are more than one objective functions and there is no single optimal solution that
simultaneously optimizes all the objective functions. In this case the decision makers are looking
for the most preferred solution. In MOOP the concept of optimality is replaced with that of
efficiency or Pareto optimality. The efficient (or Pareto optimal, non-dominated, non-inferior)
solutions are the solutions that cannot be improved in one objective function without
deteriorating their performance in at least one of the rest.
In this project we are going to deal with Maxim flow minimum cost problem assuming that flows
are both continuous and integer variables, taking advantage of the matrix property of the feasible
region. Maximum flow minimum cost problem is a particular case of the multi objective linear
programming (MOLP) and therefore Maximum flow minimum cost problem can be solved by
general MOLP techniques. However, the special feature of Maximum flow minimum cost can be
exploited to design more efficient algorithm. The aim in MFMC is to find efficient solutions. To
solve these efficient solutions in the objective space, methods like cycle cancelling algorithm,

6



Primal Simplex Algorithm, OUT-OF-KILTER Algorithm, Generic Augmenting Path Algorithm
are presented.
Formulation of Maximum Flow Minimum Cost Problem
Let G = (N, A) be a directed network defined by a set N of n nodes and a set A of m directed
arcs. Each arc (i,j) ∈ A has an associated cost cij that denotes the cost per unit flow on that arc.
We assume that the flow cost varies linearly with the amount of flow. We also associate with
each arc (i, j) ∈ A a capacity Uij that denotes the maximum amount that can flow on the arc and
a lower bound lij that denotes the minimum amount that must flow on the arc. We associate with
each node n ∈ N an integer number b(i) representing its supply/demand. If b(i) > 0, node i is a
supply node; if b(i) < 0, node i is a demand node with a demand of –b(i) and if b(i) = 0, node i is
a transshipment node. The decision variables in the minimum cost flow problem are arc flows
and we represent the flow on an arc (i, j) ∈ A by xij. The mathematical model of maximum flow
minimum cost is divided into phases:
1𝑠𝑡 𝑝h𝑎𝑠𝑒

After we found the maximum value v then we solve the minimum cost flow as follows.
2𝑛𝑑 𝑝h𝑎𝑠𝑒

We refer to the constraints in as mass balance constraints. The first term in this constraint for a
node represents the total outflow of the node (i.e., the flow emanating from the node) and the
second term represents the total inflow of the node (i.e., the flow entering the node). The mass
balance constraint states that the outflow minus inflow must equal the supply/demand of the
7


node. If the node is a supply node, its outflow exceeds its inflow; if the node is a demand node,
its inflow exceeds its outflow; and if the node is a transshipment node, its outflow equals its
inflow. The flow must also satisfy the lower bound and capacity constraints, which we refer to as
flow bound constraints. The flow bounds typically model physical capacities or restrictions

imposed on the flows' operating ranges. In most applications, the lower bounds on arc flows are
zero; therefore, if we do not state lower bounds for any problem, we assume that they have value
zero.
In most parts of this paper we assume that the data are integral (i.e., all arc capacities, arc costs,
and supplies/demands of nodes are integral). We refer to this assumption as the integrality
assumption. The integrality assumption is not restrictive for most applications because we can
always transform rational data to integer data by multiplying them by a suitably large number.
Moreover, we necessarily need to convert irrational numbers to rational numbers to represent
them on a computer.

CHAPTER 2
PRELIMINARY CONCEPTS
2.1 Network Optimization Models (NOM) and Network flow problem
8


Optimization problem has a number of objective functions which are to be minimized or
maximized. This illustrates that different nodes can represent some event that occurs at different
times. In this case, each supply node represents a specific time (or time period) when some cash
will become available to the company (through maturing accounts, notes receivable, sales of
securities, borrowing, etc.). The supply at each of these nodes is the amount of cash that will
become available then. Similarly, each demand node represents a specific time (or time period)
when the company will need to draw on its cash reserves. The demand at each such node is the
amount of cash that will be needed then. The objective is to maximize the company’s income
from investing the cash between each time it becomes available and when it will be used.
Therefore, each transshipment node represents the choice of a specific short-term investment
option (e.g., purchasing a certificate of deposit from a bank) over a specific time interval. The
resulting network will have a succession of flows representing a schedule for cash becoming
available, being invested, and then being used after the maturing of the investment.


2.1.1 Solution Methods of Maximum Flow Minimum Cost Flow Problems
Algorithms to solve MFMCP
The Maximum Flow Minimum cost flow problem can be solved by linear programming, since
we optimize a linear function, and all the constraints are linear. Many algorithms for solving
MFMCP combine the ingredients of both shortest path and maximum flow algorithms. Wellknown fundamental algorithms for MFMCP are:
1. Cycle canceling algorithm
2. Primal Simplex Algorithm
3. OUT-OF-KILTER Algorithm
4. Generic Augmenting Path Algorithm
5. Network simplex algorithm

2.1.2 Graphs and Network flows
Notation and Definitions
All of the problems we consider are defined on a directed graph (N, E) where N is an n-set of
nodes and E is an m-set of directed arcs. For notational convenience, we assume that the graph
9


has no parallel arcs; this allows us to uniquely specify an arc by its endpoints. Our algorithms
easily extend to allow for parallel arcs, and the complexity bounds we present remain valid. We
consider only simple directed paths and cycles. In this section we give several basic definitions
from graph theory and present some basic notation. We also state some elementary properties of
graphs. We begin by defining directed and undirected graphs.
Directed graph: A directed graph G = (N, A) consists of a set N of Nodes and a set of A of arcs
Whose elements are ordered pairs of distinct nodes. For example figure 2.1 is directed graph for
this graph N={1,2,3,4,5} and A={(1,2),(1,3),(1,4),(2,3),(2,4),(3,4),(3,5),(4,5)}.

Figure 2.1 example of directed graph
A directed network is a directed graph whose nodes and/or arcs have associated numerical values
Particularly costs, capacities, and /or supplies and demands.

In this particular paper we use the terms graph and network interchangeably. We let n to denote
the number of nodes and m to denote the number of arcs in G.
Undirected Graph and Network: It can be defined in same manner as we did for directed graph
except the direction is not associated to arcs .Figure 2.2 below gives example of an undirected
graph. We can consider an arc joining the node pair i and j as either (i, j) or (j, i). An undirected
arc (i, j) can be considered as a two – way flow either from node i to node j or often from j to i.
But a directed arc (i, j) permits one way flow only form i to j.

10


Figure 2.2 undirected graphs
Tail and Head: A directed arc (i, j) has two end points i and j . We refer as i /tail and j /head
node. An arc (i, j) is an outgoing arc of node i and an incoming arc of node j. If an arc (i, j) ∈ A,
then we say that node j is adjacent to node i.
Degree: degree of node is the number of incoming arcs and outgoing arcs. For example,
in figure 2.2 node 4 has a degree 4.
Parallel arcs: are two or more arcs with the same tail and head nodes.
Loop: is an arc whose tail node is the same as its head node.
Sub-graph: A graph G' = (N', A') is a sub-graph of G = (N, A) if N' C N and A'CA. We say that
G' = (N', A') is the sub-graph of G induced by N' if A' contains each arc of A with both endpoints
in N'. A graph G' = (N', A') is a spanning sub-graph of G = (N, A) if N' = N and A' C A.
Walk: A walk in a directed graph G = (N, A) is a sub-graph of G consisting of a sequence of
nodes and arcs i1 – a1 – i2 – a2 − …. − ir-1 – ar-1 − ir satisfying the property that for all 1 ≤𝑘≤ r - 1,
either 𝑎𝑘=(𝑖𝑘,𝑖𝑘+1) ∈ A or 𝑎𝑘=(𝑖𝑘+1,𝑖𝑘) ∈ A. Alternatively, we shall sometimes refer to a walk as a
set of (sequence of) arcs (or of nodes) without any explicit mention of the nodes (without explicit
mention of arcs).
Directed Walk: A directed walk is an "oriented" version of a walk in the sense that for any two
consecutive nodes 𝑖𝑘𝑎𝑛𝑑 𝑖𝑘+1 on the walk if (𝑖𝑘,ik+1)∈ A then (𝑖𝑘+1,𝑖𝑘) is not an element of A.
Path: A path is a walk without any repetition of nodes. We can partition the arcs of a path into

two groups: forward arcs and backward arcs. An arc (𝑖,j) in the path is a forward arc if the path
visits node i prior to visiting node j, and is a backward arc otherwise.
Directed Path: A directed path is a directed walk without any repetition of nodes. In other
words, a directed path has no backward arcs. We can store a path (or a directed path) easily
within a computer by defining a predecessor index (𝑗) for every node j in the path. If i and j are
two consecutive nodes on the path (along its orientation), 𝑝𝑟𝑒𝑑 𝑗 =𝑖. (Frequently, we shall use
the convention of setting the predecessor index of the initial node of a path equal to zero to
indicate the beginning of the path.) Notice that we cannot use predecessor indices to store a walk
since a walk may visit a node more than once and a single predecessor index of a node cannot
store the multiple predecessors of any node that a walk visits more than once.
11


Cycle: A cycle is a path 𝑖1−𝑖2−⋯−𝑖𝑟 together with the arc (𝑖𝑟,i1) 𝑜𝑟 (𝑖1,𝑖𝑟). We shall often refer to
a cycle using the notation 𝑖1−𝑖2−⋯−𝑖𝑟−𝑖1. Just as we did for paths, we can define forward and
backward arcs in a cycle.
Directed Cycle: A directed cycle is a directed path 𝑖1−𝑖2−⋯−𝑖𝑟 together with the arc (𝑖𝑟,i1) . The
graph shown in Figure 2.A is a cycle, but not a directed cycle; the graph shown in Figure 2.B is a
directed cycle.

Fig.2.A

Fig.2.B

Acyclic Graph: A graph is an acyclic if it contains no directed cycle.
Connectivity: We will say that two nodes 𝑖 𝑎𝑛𝑑 𝑗 are connected if the graph contains at least one
path from node 𝑖 to node j. A graph is connected if every pair of its nodes is connected;
otherwise, the graph is disconnected.
Tree: A tree is a connected graph that contains no cycle. Trees have the following property:
1) A tree on n nodes contains exactly n - 1 arcs.

2) A tree has at least two leaf nodes (i.e., nodes with degree 1).
3) Every two nodes of a tree are connected by a unique path.
Non-basic Arcs : The arcs that are not selected as basic .

Lengths: The shortest path and minimum mean cycle problems use a length function.
𝑙: E⟶𝑅 The length (𝑖,) is the distance from node i to node j. We denote the length of a
cycle (path) Г by
Cut: A cut is a partition of the node set N into two parts, S and S- = N − S .each cut defines
asset of arcs consisting of those arcs that have one endpoint in S and another endpoint in S-.
Therefore we refer to this set of arcs as a cut and represent it by the notation[S, S-]. Figure 2.3
12


illustrates a cut with S = {1,2,3} and S- = {4,5,6,7} .The set of arcs in this cut are {(2, 4), (5, 2),
(5, 3), (3, 6)}.

Fig.2.3 Example of Cut
Costs: The minimum cost flow problem uses a cost function: E⟶𝑅 The cost (𝑖,j) is the unit
shipping cost for arc (𝑖,j) . We denote the cost of a cycle
Capacities: The maximum flow, minimum cost flow, and generalized maximum flow problem
use a capacity function U: E⟶𝑅≥0. The capacity U:(𝑖,𝑗) limits the amount of flow we are
permitted to send into arc (𝑖,𝑗).
Symmetry: For the maximum flow and minimum cost flow problems, we assume the input
network is symmetric, i.e., if (𝑖,j) ∈ E then (𝑗,i) ∈ E also. This is without loss of generality, since
we could always add the opposite arc and assign it zero capacity. Without loss of generality, we
also assume the costs are anti-symmetric, i.e., (𝑖,j) =−𝐶(𝑗,𝑖) for every arc (𝑖,𝑗) ∈ E. The reason for
this assumption will become clear in the next paragraph.
Flows: A pseudo flow f: E⟶𝑅 is a function that satisfies the capacity constraints:
for all (𝑖,j) ∈ E: f(𝑖,𝑗) ≤ 𝑈(𝑖,𝑗) and the anti-symmetry constraints: For all (𝑖,j) ∈ E: f (𝑖,𝑗) = −𝑓(𝑗,𝑖)
To gain intuition, it is useful to think of only the nonnegative components of a pseudo flow. The

negative flows are introduced for notational convenience. Note that we do not need to distinguish
between upper and lower capacity limits. For example, a flow of 17 units sent along arc (𝑖,j) is
also viewed as a flow of −17 units sent along the reverse arc (𝑗,i). The cost of sending one unit of
flow along (𝑖,j) is 𝑐𝑖j ; sending one unit of flow along the opposite arc(𝑗,𝑖) has cost −𝑐𝑖𝑗, and is
equivalent to decreasing the flow on arc (𝑖,𝑗) by one unit. Now, to see how lower bounds are
implicitly modeled, suppose arc (𝑖,j) has zero capacity. This implies that variable (𝑖,j) is
13


nonnegative: the capacity constraint for arc (𝑖,𝑗) is 𝑓(𝑗,𝑖) ≤ 0, so then the anti-symmetry
constraint implies 𝑓 (𝑖,j) = −f (𝑗,𝑖) ≥ 0.
Residual Networks: With respect to a pseudo flow f in network G, the residual capacity
functions 𝑢𝑓: E⟶𝑅 is defined by 𝑢𝑓 (i , j) = 𝑢 (𝑖,𝑗) −𝑓(𝑖,𝑗). The residual network is 𝐺𝑓=(𝑉,𝐸,𝑢𝑓).
Note that the residual network may include arcs with zero residual capacity, and still satisfies the
symmetry assumption. For example, if 𝑈 (𝑖,𝑗) = 20; 𝑈( 𝑗,𝑖) = 0, and (𝑖,𝑗) = −𝑓 (𝑗,𝑖 )=17, then arc
(𝑖,𝑗 ) has 20 -17 = 3 units of residual capacity, and arc( 𝑗,𝑖) has 0-(-17) = 17 units of residual
capacity.
We define 𝐸𝑓= {(i,j)∈𝐸: 𝑢𝑓 (𝑖,𝑗 )>0} to be the set of all arcs in 𝐺𝑓 with positive residual capacity.
A residual arc is an arc with positive capacity. A residual path (cycle) is a path (cycle) consisting
entirely of residual arcs.
Network Flow Problems
In this section we formally define the shortest path, minimum mean cycle, maximum flow,
minimum cut, and minimum cost flow problems. We also state the best known complexity
bounds. We will use these as subroutines in our generalized flow algorithms
Minimum Cost Flow Problem
The minimum cost flow model is the most fundamental of all network flow problem. The
problem is easy to state: We wish to determine a least cost shipment of a commodity through a
network in order to satisfy demands at certain nodes from available supplies at other nodes. This
model has a number of familiar applications: the distribution of a product from manufacturing
plants to warehouses, or from warehouses to retailers; the flow of raw material and intermediate

goods through the various machining stations in a production line; the routing of automobiles
through an urban street network; and the routing of calls through the telephone system. As we
will see later the minimum cost flow model also has many less transparent applications. In this
section we present a mathematical programming formulation of the minimum cost flow problem
and then describe several of its specializations and variants as well as other basic models that we
consider later.
The following special versions of the minimum cost flow problem play a central role in the
theory and applications of network flows.
14


Once again to remind, we assume that the data are integral (i.e., all arc capacities, arc costs, and
supplies/demands of nodes are integral). We refer to this assumption as the integrality
assumption. The integrality assumption is not restrictive for most applications because we can
always transform rational data to integer data by multiplying them by a suitably large number.
Moreover, we necessarily need to convert irrational numbers to rational numbers to represent
them on a computer. The following special versions of the minimum cost flow problem play a
central role in the theory and applications of network flows.
Shortest path problem
The shortest path problem is perhaps the simplest of all network flow problems. For this problem
we wish to find a path of minimum cost (or length) from a specified source node s to another
specified sink node t, assuming that each arc (i,j) ∈ A has an associated cost (or length) cij. Some
of the simplest applications of the shortest path problem are to determine a path between two
specified nodes of a network that has minimum length, or a path that takes least time to traverse,
or a path that has the maximum reliability. This basic model has applications in many different
problem domains, such as equipment replacement, project scheduling, cash flow management,
message routing in communication systems, and traffic flow through congested cities. If we set
b(s) = 1, b(𝑡)= -1, and b(i) = 0 for all other nodes in the minimum cost flow problem, the solution
to the problem will send 1 unit of flow from node s to node t along the shortest path. The shortest
path problem also models situations in which we wish to send flow from a single-source node to

a single-sink node in an uncapacitated network. That is, if we wish to send v units of flow from
node s to node t and the capacity of each arc of the network is at least v, we would send the flow
along a shortest path from node s to node t. If we want to determine shortest paths from the
source node s to every other node in the network, then in the minimum cost flow problem we set
b(s) = (n - 1) and b(𝑖)= - 1 for all other nodes. [We can set each arc capacity 𝑈𝑖𝑗 to any number
larger than (n - 1).] The minimum cost flow solution would then send unit flow from node s to
every other node i along a shortest path.

Maximum flow problem
The maximum flow problem is in a sense a complementary model to the shortest path problem.
The shortest path problem models situations in which flow incurs a cost but is not restricted by
any capacities; in contrast, in the maximum flow problem flow incurs no costs but is restricted
15


by flow bounds. The maximum flow problem seeks a feasible solution that sends the maximum
amount of flow from a specified source node s to another specified sink node t. If we interpret 𝑈𝑖𝑗
as the maximum flow rate of arc (𝑖,j), the maximum flow problem identifies the maximum
steady-state flow that the network can send from node s to node t per unit time. Examples of the
maximum flow problem include determining the maximum steady-state flow of petroleum
products in a pipeline network, cars in a road network, messages in a telecommunication
network, and electricity in an electrical network. We can formulate this problem as a minimum
cost flow problem in the following manner. We set b(𝑖) = 0 for all i ∈ N, 𝑐𝑖𝑗 = 0 for all (𝑖,j) ∈ A,
and introduce an additional arc (t, s) with cost 𝑐𝑡𝑠 = - 1 and flow bound 𝑢𝑡𝑠 = ∞. Then the
minimum cost flow solution maximizes the flow on arc (t, s); but since any flow on arc (t, s)
must travel from node s to node t through the arcs in A [since each b(𝑖) = 0], the solution to the
minimum cost flow problem will maximize the flow from node s to node t in the original
network.

Minimum Cut Problem

The s-t minimum cut problem is intimately related to the maximum flow problem. The input is
the same as for the maximum flow problem. The goal is to find a partition of the nodes that
separates the source and sink, so that the total capacity of arcs going from the source side to the
sink side is minimum. Formally, we define an s-t cut [S; T ] to be a partition of the nodes
V = S ∪ T so that s ∈ S and t ∈ T. The capacity of a cut is defined to be the sum of the capacities
of “forward” arcs in the cut.

The goal is to find an s-t cut of minimum capacity. It is easy to see that the value of any flow is
less than or equal to the capacity of any s-t cut. Any flow sent from s to t must pass through
every s-t cut, since the cut disconnects s from t. Since flow is conserved, the value of the flow is
limited by the capacity of the cut. A cornerstone result of network flows is the much celebrated
max-flow min-cut theorem of Ford and Fulkerson. It captures the fundamental duality between
the maximum flow and minimum cut problems.

Circulation problem
16


The circulation problem is a minimum cost flow problem with only transshipment nodes; that is,
b(𝑖) = 0 for all i ∈ N. In this instance we wish to find a feasible flow that honors the lower and
upper bounds 𝑙𝑖𝑗 and 𝑢𝑖𝑗 imposed on the arc flows 𝑥𝑖𝑗. Since we never introduce any exogenous
flow into the network or extract any flow from it, all the flow circulates around the network. We
wish to find the circulation that has the minimum cost. The design of a routing schedule of a
commercial airline provides one example of a circulation problem. In this setting, any airplane
circulates among the airports of various cities; the lower bound 𝑙𝑖𝑗 imposed on an arc (𝑖,j) is 1 if
the airline needs to provide service between cities i and j, and so must dispatch an airplane on
this arc (actually, the nodes will represent a combination of both a physical location and a time of
day so that an arc connects two cities). We also study the following generalizations of the
minimum cost flow problem.


Minimum spanning tree problem
A spanning tree is a tree (i.e., a connected acyclic graph) that spans (touches) all the nodes of an
undirected network. The cost of a spanning tree is the sum of the costs (or lengths) of its arcs. In
the minimum spanning tree problem, we wish to identify a spanning tree of minimum cost (or
length). The applications of the minimum spanning tree problem are varied and include (1)
constructing highways or railroads spanning several cities; (2) laying pipelines connecting
offshore drilling sites, refineries, and consumer markets; (3) designing local access networks;
and (4) making electric wire connections on a control panel. A minimum spanning tree-problem
is not a special type of minimum cost flow problem. (It is not even a special type of linear
programming problem.) . That is the bad news. The good news is that you can solve it very
easily by using Greedy algorithm without even using a computer.

17


CHAPTER 3
MAXIMUM FLOW PROBLEMS
The maximum flow problem and the shortest path problem are complementary. They are similar
because they are both pervasive in practice and because they both arise as sub problems in
algorithms for the minimum cost flow problem. The two problems differ, however, because they
capture different aspects of the minimum cost flow problem: Shortest path problems model arc
costs but not arc capacities; maximum flow problems model capacities but not costs. Taken
together, the shortest path problem and the maximum flow problem combine all the basic
ingredients of network flows. As such, they have become the nuclei of network optimizations.
Our discussion of maximum flows, which we begin in this chapter, introduces several key ideas
that reoccur often in the study of network flows. The maximum flow problem is very easy to
state: In a capacitated network, we wish to send as much flow as possible between two special
18



nodes, a source node s and a sink node t, without exceeding the capacity of any arc. In this
chapter, we discuss a number of algorithms for solving the maximum flow problem. These
algorithms are of two types:
1. Augmenting path algorithms that maintain mass balance constraints at every node of the
network other than the source and sink nodes. These algorithms incrementally augment flow
along paths from the source node to the sink node.

2. Pre flow-push algorithms that flood the network so that some nodes have excesses (or buildup
of flow). These algorithms incrementally relieve flow from nodes with excesses by sending flow
from the node forward toward the sink node or backward toward the source node.
We discuss the importance of the maximum flow problem; we begin by describing several
applications. This discussion shows how maximum flow problems arise in settings as diverse as
manufacturing, communication systems, distribution planning, matrix rounding, and scheduling.
We begin our algorithmic discussion by considering a generic augmenting path algorithm for
solving the maximum flow problem and describing an important special implementation of the
generic

approach,

known

as

the

labeling

algorithm.The

labeling


algorithm

is

a

pseudopolynomial-time algorithm. In this Chapter we develop improved versions of this generic
approach with better theoretical behavior. The correctness of these algorithms rests on the
renowned max-flow min-cut theorem of network flows (recall from the introduction part that a
cut is a set of arcs whose deletion disconnects the network into two parts). This central theorem
in the study of network flows (indeed, perhaps the most significant theorem in this problem
domain) not only provides us with an instrument for analyzing algorithms, but also permits us to
model a variety of applications in machine and vehicle scheduling, communication systems
planning, and several other settings, as maximum flow problems. The max-flow min-cut theorem
establishes an important correspondence between flows and cuts in networks. Indeed, as we will
see, by solving a maximum flow problem, we also solve a complementary minimum cut
problem: From among all cuts in the network that separate the source and sink nodes, find the cut
with the minimum capacity. The relationship between maximum flows and minimum cuts is
important for several reasons. First, it embodies a fundamental duality result that arises in many
problem settings in discrete mathematics and that underlies linear programming as well as
mathematical optimization in general. In fact, the max- flow min-cut theorem, which shows the
equivalence between the maximum flow and minimum cut problems, is a special case of the
19


well-known strong duality theorem of linear programming. The fact that maximum flow
problems and minimum cut problems are equivalent has practical implications as well. It means
that the theory and algorithms that we develop for the maximum flow problem are also
applicable to many practical problems that are naturally cast as minimum cut problems.

3.1 Notation and Assumptions
We consider a capacitated network G = (N, A) with a nonnegative capacity 𝑢𝑖𝑗 associated with
each arc (𝑖,j)∈𝐴. Let 𝑢= max{ 𝑢𝑖𝑗:(𝑖,𝑗)∈𝐴} . To define the maximum flow problem, we
distinguish two special nodes in the network G: a source node s and a sink node t. We wish to
find the maximum flow from the source node s to the sink node t that satisfies the arc capacities
and mass balance constraints at all nodes. We can state the problem formally as follows.

We refer to a vector 𝑥= {𝑥𝑖𝑗} satisfying (a) and (b) as a flow and the corresponding value of the
scalar variable v as the value of the flow. We consider the maximum flow problem subject to the
following assumptions.
Assumption 1: The network is directed.
We can always fulfill this assumption by transforming any undirected network into a directed
network.
Assumption 2: All capacities are nonnegative integers. Although it is possible to relax the
integrality assumption on arc capacities for some algorithms, this assumption is necessary for
others. Algorithms whose complexity bounds involve U assume integrality of the data. In reality,
the integrality assumption is not a restrictive assumption because all modern computers store
capacities as rational numbers and we can always transform rational numbers to integer numbers
by multiplying them by a suitably large number.
Assumption 3: The network does not contain a directed path from node s to node t composed
only of infinite capacity arcs.
20


Whenever every arc on a directed path P from s to t has infinite capacity, we can send an infinite
amount of flow along this path, and therefore the maximum flow value is unbounded.
Assumption 4: Whenever an arc (𝑖,) belongs to A, arc(𝑗,𝑖) also belongs to A. This assumption is
nonrestrictive because we allow arcs with zero capacity.
Assumption 5: The network does not contain parallel arcs.
Before considering the theory underlying the maximum flow problem and algorithms for solving

it, and to provide some background and motivation for studying the problem, we first describe
some applications.
3.2 APPLICATIONS
The maximum flow problem, and the minimum cut problem, arises in a wide variety of
situations and in several forms. For example, sometimes the maximum flow problem occurs as a
sub problem in the solution of more difficult network problems, such as the minimum cost flow
problem or the generalized flow problem. As we will see later, the maximum flow problem also
arises in a number of combinatorial optimization applications that might not appear to be
maximum flow problems at all. The problem also arises directly in problems as far reaching as
machine scheduling, the assignment of computer modules to computer processors. In this section
we describe a few such applications.
Application 1 Feasible Flow Problem The feasible flow problem requires that we identify a flow
x in a network G = (N, A) satisfying the following constraints:

As before, we assume that

The following distribution scenario illustrates

how the feasible flow problem arises in practice. Suppose that merchandise is available at some
seaports and is desired by other ports. We know the stock of merchandise available at the ports,
the amount required at the other ports, and the maximum quantity of merchandise that can be
21


shipped on a particular sea route. We wish to know whether we can satisfy all of the demands by
using the available supplies. We can solve the feasible flow problem by solving a maximum flow
problem defined on an augmented network as follows. We introduce two new nodes, a source
node s and a sink node t. For each node 𝑖 with b(𝑖)>0, we add an arc 𝑠, with capacity 𝑏(𝑖), and for
each node 𝑖 with 𝑏(𝑖)<0, we add an arc (𝑖,𝑡) with capacity –𝑏(𝑖) we refer to the new network as
the transformed network. Then we solve a maximum flow problem from node s to node t in the

transformed network. If the maximum flow saturates the entire source and sinks arcs, the
problem has a feasible solution; otherwise, it is infeasible.
Application 2 Scheduling on Uniform Parallel Machines
In this application we consider the problem of scheduling of a set J of jobs on M uniform parallel
machines. Each job j ∈ J has a processing requirement 𝑝𝑗 (denoting the number of machine days
required to complete the job), a release date 𝑟𝑗 (representing the beginning of the day when job j
becomes available for processing), and a due date 𝑑𝑗≥𝑟𝑗+𝑝𝑗 (representing the beginning of the
day by which the job must be completed). We assume that a machine can work on only one job
at a time and that each job can be processed by at most one machine at a time. However, we
allow preemptions (i.e., we can interrupt a job and process it on different machines on different
days). The scheduling problem is to determine a feasible schedule that completes all jobs before
their due dates or to show that no such schedule exists. Scheduling problems like this arise in
batch processing systems involving batches with a large number of units. The feasible scheduling
problem, described in the preceding paragraph, is a fundamental problem in this situation and
can be used as a subroutine for more general scheduling problems, such as the maximum lateness
problem, the (weighted) minimum completion time problem, and the (weighted) maximum
utilization problem. Let us formulate the feasible scheduling problem as a maximum flow
problem.
We illustrate the formulation using the scheduling problem described in Figure below with
M = 3 machines. First, we rank all the release and due dates, 𝑟𝑗𝑎𝑛𝑑 𝑑𝑗 for all j, in ascending order
and determine 𝑝≤2 J

-1 mutually disjoint intervals of dates between consecutive milestones.

Let 𝑇𝑘, denote the interval that starts at the beginning of date k and ends at the beginning of date
𝑙+1. For our example, this order of release and due dates is 1, 3, 4, 5, 7, and 9. We have five
intervals, represented by 𝑇1,2, 𝑇3,3, 𝑇4,4, 𝑇5,6,𝑎𝑛𝑑 𝑇7,8. Notice that within each interval 𝑇𝑘,, the set
22



of available jobs (i.e., those released but not yet due) does not change: we can process all jobs j
with 𝑟𝑗≤𝑘 𝑎𝑛𝑑 𝑑𝑗≥𝑙+1 , in the interval.

Figure: Scheduling problem.
We formulate the scheduling problem as a maximum flow problem on a bipartite network G as
follows. We introduce a source node s, a sink node t, a node corresponding to each job j, and a
node corresponding to each interval 𝑇𝑘, as shown in Figure. We connect the source node to every
job node j with an arc with capacity 𝑝𝑗, indicating that we need to assign 𝑝𝑗 days of machine time
to job j. We connect each interval node 𝑇𝑘, to the sink node t by an arc with capacity (𝑙−𝑘+1),
representing the total number of machine days available on the days from 𝑘 𝑡o 𝑙.
Finally, we connect a job node j to every interval node 𝑇𝑘, if 𝑟𝑗≤𝑘 𝑎𝑛𝑑 𝑑𝑗≥𝑙+1 by an arc with
capacity (𝑙−𝑘+1) which represents the maximum number of machines days we can allot to job j
on the days from 𝑘 𝑡𝑜 𝑙. We next solve a maximum flow problem on this network: The
scheduling problem has a feasible schedule if and only if the maximum flow value equals
[Alternatively, the flow on every arc (𝑠,j) 𝑖𝑠 𝑝𝑗. The validity of this formulation is easy to
establish by showing a one-to-one correspondence between feasible schedules and flows of value
from the source to the sink.

23


Figure . Network for scheduling uniform parallel machines

3.3 FLOWS AND CUTS
In this section we discuss some elementary properties of flows and cuts. We use these properties
to prove the max-flow min-cut theorem to establish the correctness of the generic augmenting
path algorithm. We first review some of our previous notation and introduce a few new ideas.
Residual network: The concept of residual network plays a central role in the development of
all the maximum flow algorithms we consider. Earlier we defined residual networks and
discussed its properties. Given a flow x, the residual capacity 𝑟𝑖𝑗 of any arc (𝑖,𝑗)∈𝐴 is the

maximum additional flow that can be sent from node i to node j using the arcs( 𝑖,𝑗 )𝑎𝑛𝑑(𝑗,𝑖) .
[Recall our assumption from that whenever the network contains arc (𝑖,j) , it also contains arc
( 𝑗,𝑖 ). The residual capacity 𝑟𝑖𝑗 has two components: (1) 𝑢𝑖𝑗−𝑥𝑖𝑗, the unused capacity of arc (𝑖,j) ,
and (2) the current flow 𝑥𝑖𝑗 on arc (j, i), which we can cancel to increase the flow from node i to
node j. Consequently ri𝑗 =𝑢𝑖𝑗−𝑥𝑖𝑗+𝑥𝑗𝑖. We refer to the network G(x) consisting of the arcs with
positive residual capacities as the residual network (with respect to the flow x). Figure e gives an
example of a residual network.

24


Figure e.1 an original network with flow X and upper bound U.

Figure e.2 the residual network of the graph above.

Figure f. example of s-t cut.
3.4 GENERIC AUGMENTING PATH ALGORITHM
25


×