Vous êtes sur la page 1sur 230

^"V.

^^

Dewey

ALFRED

P.

WORKING PAPER SLOAN SCHOOL OF MANAGEMENT

NETWORK FLOWS
Ravindra K. Ahuja Thomas L. Magnanti James B. Orlin

Sloan W.P. No. 2059-88

August 1988 Revised: December, 1988

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 50 MEMORIAL DRIVE CAMBRIDGE, MASSACHUSETTS 02139

NETWORK FLOWS
Ravindra K. Ahuja L. Magnanti James B. Orlin

Thomas

Sloan W.P. No. 2059-88

August 1988 Revised: December, 1988

NETWORK FLOWS

Ravindra K. Ahuja* Thomas L. Magnanti, and James Sloan School of Management Massachusetts Institute of Technology Cambridge, MA. 02139
,

B. Orlin

On

leave from Indian Institute of Technology,

Kanpur - 208016, INDIA

MIT.

LffiRARF --^ JUN 1

NETWORK FLOWS
OVERVIEW
Introduction 1.1 Applications 1.2 Complexity Analysis 1.3 Notation and Definitions 1.4 Network Representations 1.5 Search Algorithms 1.6 Developing Polynomial Time Algorithms
Basic Properties of

21

Z2 Z3 24

Network Flows Flow Decomposition Properties and Optimality Conditions Cycle Free and Spanning Tree Solutions Networks, Linear and Integer Programming

Network Transformations

Shortest Paths
3.1

3.2 3.3 3.4 3.5

Algorithm Implementation R-Heap Implementation Label Correcting Algorithms All Pairs Shortest Path Algorithm
Dijkstra's
Dial's

Maximum Flows
4.1

4.2
4.3 4.4

Labeling Algorithm and the Max-Flow Min-Cut Theorem Decreasing the Number of Augmentations Shortest Augmenting Path Algorithm

4.5

Preflow-Push Algorithms Excess-Scaling Algorithm


Cost Flows Duality and Optimality Conditions Relationship to Shortest Path and Maximum Flow Problems

Minimum
5.1

5.2 5.3
5.4 5.5 5.6

Negative Cycle Algorithm Successive Shortest Path Algorithm Primal-Dual and Out-of-Kilter Algorithnns

5.7
5.8 5.9

5.10
5.11

Network Simplex Algorithm Right-Hand-Side Scaling Algorithm Cost Scaling Algorithm Double Scaling Algorithm Sensitivity Analysis
Assignment Problem

Reference Notes

References

Network Flows
Perhaps no subfield of mathematical programming
is

more

alluring than

network optimization.

Highway,

rail,

electrical,
lives.

communication and many other


a consequence,

physical networks pervade

our everyday

As

even non-specialists

recognize the practical importance and the wide ranging applicability of networks.

Moreover, because the physical operating characteristics of networks

(e.g.,

flows on arcs

and mass balance

at

nodes) have natural mathematical representations, practitioners and


of

non-specialists can readily understand the mathematical descriptions

network

optimization problems and the basic ruiture of techniques used to solve these problems.

This combination of widespread applicability and ease of assimilation has undoubtedly

been instrumental in the evolution of network planning models as one of the most
widely used modeling techniques
in all of operatior^s research

and applied mathematics.

Network optimization

is

also alluring to methodologists.

Networks provide a

concrete setting for testing and devising

new

theories.

Indeed, network optimization has

inspired

many

of the

most fundamental

results in all of optimization.

For example,

price

directive

decomposition

algorithms

for

both

linear

programming and
So did cutting

combinatorial optimization had their origins in network optimization.

plane methods and branch and bound procedures of integer programming, primal-dual

methods

of

linear

and nonlinear programming, and polyhedral methods of


In addition, networks

combinatorial

optimization.

have served as the major prototype

for several theoretical domaiiis (for example, the field of matroids) for a

and as the core model

wide variety of min/max duality

results in discrete mathematics.

Moreover, network optimization has served as a

fertile

meeting ground for ideas

from optimization and computer

science.

Many

results in

network optimization are

routinely used to design and evaluate computer systems,


science concerning data structures

and ideas from computer

and

efficient data

manipulation have had a major


optimization algorithms.

impact on the design and implementation of

many network many

The aim
optimization.

of this paf>er

is to

summarilze

of the fundamental ideas of network

In particular,

we

concentrate on network flow problems and highlight a

number

of recent theoretical

and algorithmic advances.


topics:

We

have divided the discussion

into the following

broad major

Applications
Basic Prof)erties of

Network Flows
''

Shortest Path Problems

Maximum Flow Problems Minimum Cost Flow Problems


AssigTunent Problems

Much

of our discussion

focuses on the design of provably good


algorithms,

(e.g.,

polynomial-time) algorithms.

Among good

we have

presented those that


to structure

are simple and are likely to be efficient in practice.

We

have attempted

our

discussion so that

it

not only provides a survey of the field for the specialists, but also

serves as an introduction and

summary

to the non-specialists

who have

a basic

working

knowledge

of the rudiments of optimization, particularly linear

programming.
listed

In this chapter,

we

limit

our discussions to the problems


(i)

above.

Some

important generalizations of these problems such as


(ii)

the generalized network flows;

the

multicommodity flows; and

(iv)

the network design, will not be covered in our

survey.

We, however,

briefly describe these

problems

in Section 6.6

and provide some

important references.

As

a prelude to the

remainder of our discussion,


.

in this section

we

present

several important preliminaries

We

discuss

(i)

different

ways

to

measure the
networks
of

performance of algorithms;
quantitively;
(iii)

(ii)

graph notation and vtirious ways


that

to represent

few basic ideas from computer science


(iv)

underUe the design


to

many
in
1.1

algorithms;

and

two generic proof techniques

that

have proven

be useful

designing polynomial-time algorithms.

Applications

Networks
this section,

arise in

numerous application

settings

emd

in a variety of guises.

In
is

we

briefly describe a

few prototypical applications.

Our

discussion

intended to illustrate a range of applications and to be suggestive of

how network

flow

problems

arise in practice;

more extensive survey would take us

far

beyond the scope

of our discussion.

To

illustrate the

breadth of network applications,


that

we

consider

some

models requiring solution techniques


For the purposes of

we

will not describe in this chapter.

this discussion,

we

will consider four different types of

networks arising

in practice:

Physical networks (Streets, railbeds, pipelines, wires)

Route networks
Space-time networks (Scheduling networks)

Derived networks (Through problem trai^formations)


in coverage.

These four categories are not exhaustive and overlap

Nevertheless,

they provide a useful taxonomy for summarizing a variety of applications.

Network flow models are


also used for several purposes:

Descriptive modeling (answering "what is?" questions)


Predictive modeling (answering "what will be?" questions)

Normative modeling (answering "what should be?" questions,


performing optimization)

that

is,

We

will illustrate

models

in

each of these categories.

We

first

introduce the basic

underlying network flow model and some useful notation.

The Network Flow Model


Let

= (N, A) be a directed network with a cost


(i, j)

Cjj,

lower bound

/,;,

and a

capacity
integer

Uj;

associated with every arc


b(i)

e A.

We

associate with each


If b(i)

node
i

an

number
<
0,

representing
i

its

supply or demand.
if b(i)

>

0,

then node
i

is

a supply

node;
node.

if b(i)

then node
|

is

a
|

demand node; and


|.

0,

then node

is

a transhipment

Let

n =

and

m= A

The minimum

cost

network flow problem can be

formulated as follows:

Minimize

C;; x;:
'

(1.1a)

(i,j)A^

subject to

X^ii
{j:(i,j)e]\}

Xxji
{j:(j,i)6^A}

=b(i),

foralliN,

(1.1b)

/jj

<

Xjj

S u^ =

for all

(i, j)

e A.

(1 .Ic)

We

refer to the vector x

(xjj)

as the flow in the network.

The

constraint (1.1b)

implies that the total flow out of a node minus the total flow into that node must equal

the net supply /demand of the node.


balance constraint.
(1.1c)

We

henceforth refer to this constraint as the moss

The flow must

also satisfy the lower

bound and

capacity constraints

which we

refer to as the flow

bound constraints.

The flow bounds might model


later that they

physical capacities, contractual obligations or simply operating ranges of interest.


Frequently, the given lower bounds
/j;

are

all

zero;

we show

can be

made

zero without any loss of generality.

In matrix notation,

we
:

represent the

minimum
),

cost flow

problem
(1.2)

minimize

ex

Nx

= b and

<xSu

in terms of a node-arc incidence matrix

N. The matrix

has one row for each node of the

network and one column


corresponding to arc
of size n
(i, j),

for each arc.


let
e;

We

let

Njj represent the column of

and

denote the

j-th unit vector

which
is

is

a
1.

column vector
Note
that each
i

whose
x-;

entries are all zeros except for the )-th entry

which

flow variable

app>ears in

two mass balance equations, as an outflow from node


to
Cj

with

a +1 coefficient

and

as

an inflow
is

corresponding to arc

(i, j)

Nj; =

node - e;

with a -1 coefficient.

Therefore the column

The matrix
nonzero,
all

has very special structure: only

2m

out of

its

nm

total entries are

of

its

nonzero entries are +1 or -1, and each column

h<is exactly

one +1 and

one
2.2

-1.

Figure
2.3,

1.1

gives an example of the node-arc incidence matrix.

Later in Sections

and

we

consider

some

of the consequences of this special structure.

For now,

we

make two
(i)

observations.

Summing
gives

all

the

mass balance constraints eliminates

all

the flow variables

and

I N

b(i)

= 0,or
i

{N

Ib(i) = Mi) > 0)

Ib(i)
i

{N

b(i)

<

0)
if

Consequently,

total

supply must equal

total

demand

the

mass balance

cor\straints are to

have any feasible solution.

(ii)

If

the total supply does equal the total

demand, then summing


0,

all

the mass
is

balance equations gives the zero equation Ox =


equal to minus the

or equivalently, any equation


is

sum

of

all

other equations, and hence

redundant.
central role in the

The following

special ccises of the

minimum

cost flow

problem play a

theory and applications of network flows.

(a)

An example

network.

(1,2)
1

2 3 4
5

A c Nj
one
is

N2

representing possible person-to-object assignments, and a cost


(i, j)

C;;

associated with each element


object in a

in A.

The

objective

is to

assign each person to exactly

way

that

minimum

cost flow problem on a network

minimizes the cost of the assignment. The Jissignment problem G = (N^ u N2, A) with b(i) = 1 for all i
i

Nj and

b(i)

= -1 for

all

N2 (we set

l^:=

and

u^;

for all

(i, j)

A).

Physical Networks

"^

The
one
that

familiar city street

map

is

perhaps the prototypical physical network, and the

most readily comes

to inind

when we

envision a network.

Many network

planning problems arise

in this

problem context.
street

As one
to

illustration, consider the

problem of managing, or designing, a


limits,

network

decide upon such issues as speed

one way

street assignments, or

whether or not

to construct a

new

road or bridge.
that tells us

In order to

make

these decisions intelligently,

we need

a descriptive

model

how

to

model

traffic

flows and measure the performance of any design as well as a


effect of

predictive

model

for

measuring the

any change

in the system.

We can

then use

these models to answer a variety of "what if planning questions.

The following type


these types of questions.
specifies

of equilibrium
line of the

network flow model permits us

to

answer
that

Each

network has an associated delay function

how

long

it

takes to traverse this link.


traffic that

The time

to

do so depends upon
is

traffic

conditions;
traverse
it.

the

more

flows on the link, the longer

the travel time to


(e.g.,

Now

also suppose that each user of the system has a point of origin
(e.g.,

his

or her home) and a point of destination

his or her

workplace in the central

business

district).

Each of these users must choose a route through the network. Note,
affect

however, that these route choices

each other;

if

two users

traverse the

same

link,
let

they add to each other's travel time because of the added congestion on the

link.

Now

us

make

the behavioral assumption that each user wishes to travel


possible, that
is,

between

his or her

origin

and destination as quickly as

along a shortest travel time path.

This situation leads to the following equilibrium problem vdth an

embedded

set of

network optimization problems

(shortest path problems);

is

there a flow pattern in the


his (or her) choice of

network with the property

that

no user can unilaterally change

origin to destination path (that

is, all

other ULsers continue to use their specified paths in

the equilibrium solution) to reduce his travel time.

Operations researchers have


setting, as well as related theory

developed

a set of sophisticated

models

for this

problem

(concerning, for example, existence and uniqueness of equilibrium solutions), and

algorithms for computing equilibrium solutions.

Used

in the

mode

of "what if

scenario analysis, these models permit analysts to answer the type of questions
previously.

we posed

These models are actively used

in practice.

Indeed, the Urban Mass Transit

Authority in the United States requires that communities perform a network


equilibrium impact analysis as part of the process for obtaining federal funds for highway
construction or improvement.
Similar types of models arise in

many

other problem contexts.

For example, a

network equilibrium model forms the

heairt of

the Project Independence Energy Systems

(LPIES) model developed by the U.S. Department of Energy as an analysis tool for

guiding public policy on energy.

The

basic equilibrium

model

of electrical

networks

is

another example.

In this setting.

Ohm's Law serves

as the analog of the congestion

function for the traffic equilibrium problem, and Kirkhoff s

Law

represents the network

mass balance equations.


Another type of physical network
circuit).
is

a very large-scale integrated circuit (VLSI

In this setting

the nodes of the network correspond to electrical components

and the

links correspond to wires that connect these links.


in this

Numerous

network
,

planning problems arise


design,
*.he
its

problem context. For example,

how

can

we

lay out

or

smallest possible integrated circuit to

make

the necessary connections

between

components and maintain necessary

sejjarations

between the wires

(to

avoid

electrical interference).

Route Networks
Route networks, which are one
level of abstraction

removed from physical

networks, are familiar to most students of operations research and management science.

The

traditional operations research transportation


at its plants

problem

is illustrative.

shipper

with supplies

must ship

to geographically dispersed retail centers,

each with

a given aistomer
costs based

demand. Each

arc connecting a supply point to a retail center incurs

upon some

physical network, in this case the transportation network. Rather

than solving the problem directly on the physical network,


construct transportation routes.
retail
(i)

we

preprocess the data and

Consequently, an arc connecting a supply point and

center might correspond to a complex four leg distribution channel with legs
to a rail station,
(ii)

from a plant (by truck)


(iii)

from the

rail station to a rail

head

elsewhere in the system,


(iv)

from the

rail

head (by truck)

to a distribution center,

and
even

from the distribution center (on a

local delivery truck) to the final


If

customer

(or

in

some

cases just to the distribution center).

we

assign the arc with the composite

distribution cost of
this route, this

all

the intermediary legs, as well as with the distribution capacity for


classic

problem becomes a

network transportation model:


costs.

find the flows


is

from plants

to

customers that minimizes overall

This type of model

used

in

numerous

applications.

As but one

illustration, a prize

winning practice paper written

several years ago described an application of such a network planning system by the
Cahill
costs

May

Roberts Pharmaceutical

Company

(of Ireland)

to

reduce overall distribution

by 20%, while improving customer

service as well.

Many
address
this

related problems arise in this type of

problem

setting, for instance, the


It is

design issue of deciding upon the location of the distribution centers.

possible to

type of decision problem using integer programming methodology for


sites

choosing the distribution


given choice of
sites;

and network flows

to cost out (or optimize flows) for

any

using this approach, a noted study conducted several years ago

permitted Hunt Wesson Foods Corporation to save over $1 million annually.

One
problem

special case of the transportation

problem merits note the assignment


This problem has numerous

that

we

introduced previously in this section.

applications, particularly in problem contexts such as

machine scheduling.

In this

application context,

we would

identify the supply points with jobs to be performed, the


(i, j)

demand

points with available machines, and the cost associated with arc
i

as the cost

of completing job

on machine

j.

The solution

to the

problem

specifies the

minimum

cost assignment of the jobs to the machines,

assuming

that each

machine has the

capacity to perform only one job.

Space Time Networks


Frequently in practice,

we wish

to schedule

some production

or service activity

over time. In these instances

it is

often convenient to formulate a

network flow problem


facility (a

on a "space time network" with several nodes representing a particular


machine, a warehouse, an airport) but at different points in time.
Figure
economic

1.2,

which represents a core planning model


is

in

production planning, the

an important example. In this problem context, we wish to meet prescribed demands for a product in each of the T time periods. In each d^
lot size

problem,

period,

we can produce
I^

at level

Xj

and /or we can meet the demand by drav^g upon

inventory

from the previous


t

f)eriod.
.

The network representing

this

problem has

T+

nodes: one node

1, 2,

represents each of the planning periods, and one

node

represents the "source" of


Xj

all

production.

The flow on
(t, t

arc

(0, t)

prescribes the

production level
level
I^

in period

t,

and the flow on arc


t

1)

represents the inventory


for each
in

to
t

be carried from period

to period

The mass balance equation

period

models the basic accounting equation: incoming inventory plus production

that period

must equal demand plus


all

final inventory.

The mass balance equation


fir\al

for

node

indicates that

demand (assuming

zero beginning and zero


t

inventory
. . .

over the entire planning period) must be produced in some period

1, 2,

T.

Whenever

the production and holding costs are linear, this problem

is

easily solved as a

we must find the minimum cost path of If we impose to that demand point). production and inventory arcs from node capacities on production or inventory, the problem becomes a minimum cost network
shortest path problem (for each

demand

period,

flow problem.

Id,

Figure 1^.

Network flow model

of the economic lot size problem.

One extension of this economic lot sizing problem Assume that production x^ in any period incurs a fixed
produce
T^.

arises frequently in practice.


cost:

that

is,

whenever we

in period
,

(i.e.,

x^

>

0),

no matter how much or how

little,

we

incur a fixed cost


t

In addition

we may
h^

incur a per unit production cost c^ in period

and a per
t

unit

inventory cost

for carrying

any unit of inventory from period


problem
is

to i>eriod

1.

Hence, the cost on each arc for

this

either linear (for inventory carrying arcs)

or linear plus a fixed cost (for production arcs).

Consequently, the objective function for

10

the

problem

is

concave.

As we

indicate in Section 2.2

any such concave

cost

network

flow problem always has a special type of optimum solution


solution. This problem's spanning tree solution

known

as a spanning trees

decomposes
form

into disjoint directed paths;

the

first

arc

on each path
arc.

is

a production arc (of the

(0, t))

and each other

arc

is

an

inventory carrying
solution,

This observation implies the following production property: in the

each time

we

produce,

we produce enough

to

meet the demand

for an integral

number

of contiguous periods.

Moreover, in no period do

we

both carry inventory from

the previous period and produce.

The production property permits us


shortest path
consists of

to solve the

problem very
as follows.

efficiently as a

problem on an auxiliary network G' defined


1

The network G'


i

nodes
j).

to

T+

1,

and

for every pair of


(i,
j)

nodes

and

with

<

j,

it

contains

an arc

(i,

The length

of arc

is

equal to the production and inventory cost of


i

satisfying the

demand

of the periods

from

to

j-1. Observe that for every production


in

schedule satisfying the production property, G' contair\s a directed path


1

G' from node

to

node T +

of the

same

objective function veilue

and

vice-versa.

Hence we can

obtain the

optimum production schedule by


of the

solving a shortest path problem.

Many enhancements
facility
(ii)

model are

possible, for

example

(i)

the production

might have limited production capacity or limited storage

for inventory, or

the production facility might be producing several products that are linked by

common
share

production costs or by changeover cost

(for

example,

we may need

to

change

dies in an automobile stamping plant

when making
In

different types of fenders), or that


cases, the

common

limited production

facilities.

most

enhanced models are


structure

quite difficult to solve (they are NP<omplete), though the

embedded network

often proves to be useful in designing either heuristic or optimization methods.

Another

classical

network flow scheduling problem

is

the airline scheduling problem

used

to identify a flight schedule for

an

airline.

In this application setting, each


in

node

represents both a geographical location

(e.g.,

an airport) and a point


(i)

time

(e.g..

New

York

at 10 A.M.).

The

arcs are of

two

types:

service arcs connecting


(ii)

two

airports, for

New York at 10 A.M. to Boston at 11 to stay at New York from 10 A.M. until 11 overnight at New York from 11 P.M. until
example
revenues vdth each service
or
leg, a

A.M.;

layover arcs that permit a plane

A.M.
6

to wait for a later flight, or to wait


If

A.M. the next morning.


in this

we

identify

network flow

network (with no external supply

demand)

will specify a set of flight plans

(circulation of airplanes through the


airline's fleet

network).

flow that maximizes revenue will prescribe a schedule for an

11

of planes.

The same type of network representation

arises in

many

other dynamic

scheduling applications.

Derived Networks
This category
a "grab

is

bag" of specialized applications and illustrates that


arise in surprising

sometimes network flow problems

ways from problems

that

on the

surface might not appear to involve networks.


point.

The foUovdng examples

illustrate this

Single Duty

Crew Scheduling.

Figure 1.3 illustrates a

number

of possible duties for the

drivers of a bus company.

Time Period/Duty Number

12

In this formulation the binary variable x: indicates whether


0)

(x;

1)

or not

(x;

=
a of

we

select the j-th duty;

the matrix

represents the matrix of duties


Vs.

and b

is

column vector whose components are

all

Observe
's

that the ones in each

column

occur in consecutive rows because each driver

duty contains a single work


is

shift (no

split shifts or

work

breaks).

We

show

that this

problem

a shortest path problem.

To

make

this identification,

we perform
it.

the

following operations:

In

(1.2b) subtract each

equation from the equation below


to the system.

This transformation does not change the solution


to

Now

add

redundant equation equal

minus the sums of

all

the

equations in the revised system.

Because of the structure of A, each column in the


first

revised system will have a single +1 (corresponding to the

hour of the duty

in the

column
just

of

A) and
last

a single -1 (corresponding to the

row

in

A, or the added row, that Hes

below the

+1 in the column of A).

Moreover, the revised right hand side vector

of the

problem

will

have a +1
is

in

row

and a -1

in the last (the


1

appended) row.
at

Therefore, the problem


cost in the

to ship in

one unit of flow from node


1.4,

to

node 9

minimum

network given

Figure

which

is

an instance of the shortest path

problem.
^5
unit

Figure

1.4.

Shortest path formulation of the single duty scheduling problem.

If

instead of requiring a single driver to be on duty in each period,


to

we

specify a

number
network

be on duty

in

each period, the same


this case the right

transformation would produce a

flow problem, but in


arbitrary.

hand side

coefficients (supply

and

demands) could be

Therefore, the transformed problem


p)ath

would be

a general

minimum

cost

network flow problem, rather than a shortest

problem.

Critical Path

Scheduling and Networks Derived from Precedence Conditions

In construction

and many other project planning applications, workers need

to in

complete a variety of tasks that are related by precedence conditions; for example,

constructing a house, a builder must pour the foundation before framing the house and

complete the framing before beginning

to install either electrical or

plumbing

fixtures.

13

This type of application can be formulated mathematically as follows.


to

Suppose we need

complete

jobs

and

that job
S;

(j

1, 2,

J)

requires

t:

days

to complete.

We are

to

choose the
constraints
jobs

start

time

of each job

so that

we honor

a set of specified precedence


If

and complete the

overall project as quickly as possible.

we

represent the

by nodes, then the precedence constraints can be represented by

arcs, thereby giving

us a network. The precedence constraints imply that for each arc


job
j

(i, j)

in the

network, the

cannot

start until job jobs,

has been completed.

For convenience of notation,


"start" job

we add we
to

two

dummy

both with zero processing time: a


a "completion" job
J

to

be completed before

any other job can begin and


have completed
this
all

that cannot be initiated until

other jobs.

Let

= (N, A) represent the network corresponding


to solve the following optimization

augmented

project.

Then we vdsh
,

problem:

minimize sj^^ - Sq

subject to
Sj

Sj

tj

for each arc

(i

j)

e A.

On
to

the surface, this problem, which

is

a linear

program

in the variables
if

s:

seems
the

bear no resemblance to network optimization.


Sj

Note, however, that

we move

variable

to the left

hand side of the


a plus

constraint, then each constraint contains exactly

two

variables,

one with

one

coefficient

and one with a minus one


structure.
is

coefficient.

The

linear

programming dual
xj:

of this
(i, j)
,

problem has a familiar

If

we

associate a dual

variable

with each arc

then the dual of this problem

maximize

t;

X;;
^

(i,j)X

subject to

^ 2^

X:;

^ 2-

Xjj

si
I

{j:(i,j)eA)

{j:(j,i)!^)

-l,ifi = 0, otherwise, for l,ifi = J + l

all

14

15

xj;

0,

for all

(i, j)

This problem requires us to determine the longest path in the network

from

node

to

node

with

tj

as the

arc length of

arc

(i, j).

This longest path has the


to fulfill the sp>ecified

following interpretation.

It is

the longest sequence of jobs

needed

precedence conditions.

Since delaying any job in this sequence must necessarily delay

the completion of the overall project, this path has

become known

as the critical path


heis

and
a

the problem has

become known

as the

critical

path problem.

This model

become

principal tool in project


projects.

management,
itself is

particularly for

managing
it

large-scale corwtruction

The

critical

path

important because

identifies those jobs that require

managerial attention in order to complete the project as quickly as possible.


Researchers and practitioners have enhanced this basic model in several ways.

For example,

if

resources are available for expediting individual jobs,

we

could consider

the most efficient use of these resources to complete the overall project as quickly as
possible.

Certain versions of this problem can be formulated as

minimum

cost flow

problems.

The open

pit

mining problem

is

another network flow problem that arises from


pit

precedence conditions.
this figure,

Consider the open

mine shown

in Figure

1.5.

As shown
of

in

we have

divided the region to be mined into blocks.

The provisions

any

given mining technology, and perhaps the geography of the mine, impose restrictions

on

how we

can remove the blocks:


that lies

for

example,

we

can never remove a block until


it;

we

have removed any block

immediately above

restrictions

on the "angle" of

mining the blocks might impose similar precedence conditions. Suppose now that each block has an associated revenue n (e.g., the value of the ore in the block minus the
j

cost for extracting the block)


If

and we wish

to extract blocks to
(y^

maximize
-

overall revenue.

we

let
j,

y;

be a zero-one variable indicating whether


(i)

1) or not (y;

0)

we

extract

block

the problem will contain


j

a constraint y; ^ y^

(or, y;

yj

0)

whenever we
that

need wish

to

mine block to maximize

before block
total

i,

and
,

(ii)

an objective function specifying


over
all

we

revenue ny;
linear
y;

summed
or
1)

blocks

j.

The dual

linear

program (obtained from the


constraints

programming version
=
will be a

of the problem (with the

y;

<

1,

rather than

network flow problem with a

node

for each block, a variable for


at

each precedence constraint, and the revenue

as the

demand demand

node

j.

This network will also have a

dummy

"collection
it

node"

with
(that
is.

equal to minus the

sum

of the

rj's,

and an arc connecting

to

node

16

block

j);

this arc

corresponds to the upper bound constraint


is

y;

in the original linear

program. The dual problem

one of finding a network flow that minimizes ths sum of


0.

flows on the arcs incident to node

The

critical

path scheduling problem and open pit mining problem illustrate one
arise indirectly.

way

that

network flow problems


related

Whenever, two variables

in a linear

program are

by

a precedence conditions, the variable corresponding to this


If

precedence constraint in the dual linear program v^ll have a network flow structure.

the only constraints in the problem are precedence constraints, the dual linear program
will

be a network flow problem.

Matrix Rounding of Census Information

The
for a

U.S.

Census Bureau uses census infonnation

to construct millions of tables

wide variety of purposes. By law,


information and not disclose
It

the Bureau has an obligation to protect the source

of

its

statistics that

can be attributed to any particular

individual.
table.

can attempt to do so by rounding the census information contained in any

Consider, for example, the data


is

shown

in Figure 1.6(a).

Since the upper leftmost

entry in this table

1,

the tabulated information might disclose information about a

particular individual.

We

might disguise the information in

this table as follows;

round each entry

in the table, including the

row and column sums,

either

up

or dov^n to

the nearest multiple of three, say, so that the entries in the table continue to

add

to the

(rounded) row and column sums, and the overall

sum

of the entries in the

new

table

adds

to a

rounded version

of the overall
that

sum

in the original table.

Figure 1.6(b) shows a


cast as finding

rounded version of the data

meets

this criterion.

The problem can be

a feasible flow in a network

and can be solved by an application of the maximum flow

algorithm. The network contains a node for each

row

in the table

and one node

for each
j

column.

It

contains an arc connecting node


j):

(corresponding to

row
ij-th

i)

and node

(corresponding to column

the flow on this arc should be the

entry in the

prescribed table, rounded either

up

or dov^T*. In addition,
i:

we add

a supersource s to the
i-th

network connected

to

each row node


Similarly,

the flow

on

this arc
t

must be the

row sum,

rounded up or dov^n.

we add

a supersink

with the arc connecting each


j-th

column node

to this

node; the flow on this arc must be the

column sum, rounded


the flow on this arc
1.7

up

or

down.

We

also

add an arc connecting node

and node

s;

must be the sum of


illustrates the
1.6.
If

all

entries in the original table

rounded up or down. Figure

network flow problem corresponding

to the census data specified in Figure

we

rescale all the flows, meeisuring

them

in integral units of the

rounding base

16a

Time

in

^service (hours)

<1
Income
less

1-5

<5

than $10,(XX)

$10,000 - $30,000 $30,000 - $50,000

mure than $50,000

Column

Total

16b

(multiples of 3

in

our example), then the flow on each arc must be integral

at

one of two
of this

consecutive integral values.

The formulation of

more general version


imbedded network

problem, corresponding

to tables

with more than two dimensions, will not be a network


structure

flow problem.

Nevertheless, these problems have an

(corresponding to 2-dimensional "cuts" in the table) that


algorithms to find rounded versions of the tables.

we

can exploit in divising

12

Complexity Analysis
There are three basic approaches for measuring the performance of an algorithm:

empirical analysis, worst-case analysis, and average-case analysis.


typically

Empirical analysis

measures the computational time of an algorithm using

statistical

sampling on
objective of

a distribution (or several distributions) of problem instances.

The major

empirical analysis

is to

estimate

how

algorithms behave in practice.

Worst-case analysis

aims

to

provide upper bounds on the number of steps that a given algorithm can take on
Therefore, this type of analysis provides performance guarantees.
is

any problem instance.

The

objective of average-case analysis

to estimate the expected

number

of steps taken
it

by

an algorithm.

Average-case analysis differs from empirical analysis because

provides

rigorous mathematical proofs of average-case performance, rather than statistical


estimates.

Each of these three performance measures has


appropriate for certain purposes.

its

relative merits,

and

is

Nevertheless, this chapter will focus primarily on

worst-case analysis, and only secondarily on empirical behavior.

Researchers have

designed

many

of the algorithms described in this chapter specifically to improve

worst-case complexity while simultaneously maintaining good empirical behavior.

Thus, for the algorithms


performance.

we

present, worst-case analysis

is

the primary measure of

Worst-Case Analysis
For worst-case analysis,

we bound

the running time of network algorithms in


(n),

terms of several basic problem parameters: the number of nodes


(m),

the

number

of arcs

and upper bounds

C and U on

the cost coefficients

and the arc

capacities.

Whenever
is

(or

U) appears

in the

complexity arulysis,

we assume

that each cost (or capacity)

integer valued.

As an example

of a worst-case result within this chapter,

we

will

prove

17

that the

number
is less

of steps for the label correcting algorithm to solve the shortest path

problem

than

pnm

steps for

some

sufficiently large constant p.

To avoid

the need to

compute or mention the constant

p, researchers typically

use a "big O" notation, replacing the expressions:


requires

"the label correcting algorithm

pmn

steps for

some constant

p" with the equivalent expression "the running


is

time of the label correcting algorithm

0(nm)." The 0(

notation avoids the need to

state a specific constant; instead, this notation indicates only the

dominant terms of the


all

running time. By dominant,


sufficiently large values of

we mean

the term that

would dominate
bounds are

other terms for

n and m.
if

Therefore, the time


is

called asymptotic

running times.

For example,

the actual running time


is

lOnm^ + 2'^'^n^m, then we

would

state that the

running time

O(nm^), assuming that


is

m ^ n.

Observe that the


for

running time indicates that the lOnm^ term


values of n and m, the
constant terms
2''^'^n'^m
this

dominant even though

most

practical

term would dominate.

Although ignoring the

may have

undesirable feature, researchers have widely adopted the

0(
1.

notation for several reasons:

Ignoring the constants greatly simplifies the analysis.


)

Consequently, the use of

the 0(

notation typically has permited analysts to avoid the prohibitively difficult

analysis required to

compute the leading constants, which,

in turn, has led to a

flourishing of research on the worst<ase performance of algorithms.

2.

Estimating the constants correctly


is

is

fundamentally

difficult.

The

leeist

value of

the constants

not determined solely by the algorithm;

it is

also highly sensitive to the

choice of the computer language, and even to the choice of the computer.

3.

For

all
all

of the algorithms that

we

present, the constant terms are relatively small

integers for

the terms in the complexity bound.

4.

For large practical problems, the constant factors do not contribute nearly as

much

to the

running time as do the factors involving

n,

m,

or U.

Counting Steps

The running time


of steps
it

of a network algorithm

is

determined by counting the number

performs.

The counting
for

of steps relies on a

number

of assumptions, most of

which are quite appropriate

most of today's computers.

18

Al.l

The computer
being executed

carries out instructions sequentially, with at


at a time.

most one instruction

A1.2

Each comparison and basic arithmetic operation counts as one

step.

By envoking

Al.l,

we

are adhering to a sequential

model

of computations;

we

will not discuss parallel implementations of

network flow dgorithms.


be counted are comparisons

Al .2

implicitly

assumes

that the only operations to

and

tirithmetic operations.

In fact, even

by counting

all

other computer operations, on


results for the

today's computers

we would
present.

obtain the

same asymptotic worst-case


it

algorithms that

we

Our

cissumption that each operation, be


in part

an addition or

division, takes equal time,

is justified

by the

fact that

0(
is

notation ignores

differences in running times of at most a constant factor,

which

the time difference

between an addition and a multiplication on

essentially all

modem

computers.

On
may

the other hand, the assumption that each arithmetic operation takes one step

lead us to underestimate the aisymptotic running time of arithmetic operations

involving very large numbers on real computers since, in practice, a computer must
store large

numbers

in several

words

of

its

memory.

Therefore, to perform each

operation on very large numbers, a computer must access a

number

of

words of data and


this

thus takes more than a constant

number

of steps.

To avoid

systematic

underestimation of the running time, in comparing two running times,

we

will typically

assume
for

that both

C and U
k.

are polynomially

bounded

in n,

i.e.,

= Oirr-) and

U = 0(n'^),
is

some constant

This assumption,
if

known

as the similarity assumption,

quite

/)

reasonable in practice. For example,

we were

to restrict costs to

be

less

than lOOn-^,

we

would allow

costs to be as large as 100,000,000,000 for networks with 1000 nodes.

Polynomial-Time Algorithms

An
the

algorithm

is

said to be a polynomial-time algorithm

if its

running time

is
is

boimded by

a polynomial function of the input length.

The

input length of a

problem

number
is

of bits needed to represent that problem.

For a network problem, the input

length

low order polynomial function of

n,

m, log

C and
to a

log

(e.g.,

it

is

0((n +

m)flog n + log

+ log U)). Consequently, researchers refer


if its

network algorithm as a

polynomial-time algorithm
n,

running time

is

bounded by

a polynomial function in

m, log C and log U.

For example, the running time of one of the polynomial-time

maximum

flow algorithms

we

consider

is

0(nm

+ n^ log U).

Other instances of

19

polynomial-tiine bounds are


said to be a strongly

O(n^m) and 0(n

log

n).

polynomial-time algorithm
is

is

polynomial-time algorithm
in

if its

running time

bounded by
or log U.

polynomial function

only n and m, and does not involve log


to,

The

maximum
algorithm.

flow algorithm alluded

therefore,

is

not

a strongly polynomial-time
is

The
if

interest in strongly

polynomial-time algorithms
all

primarily theoretical.

In particular,

we envoke

the similarity assumption,

polynomial-time algorithms

are strongly polynomial-time because log

Odog n) and

log

U=

CXlog

n).

An

algorithm

is

said to be an exponential-time algorithm

if its

running time grows


of exp)onential time
a

as a function that can not be polynomially bovmded.

Some examples

bounds are 0(nC), 0(2^), 0(n!) and 0(n^g


polynomial function of n and log
if

").

(Observe that

nC cannot be bounded by
is

C) We

say that an algorithm


n,

pseudopolynomial-time

its

running time

is

polynomially bounded in
is

m,

C and

U.

The

class of

pseudopolynomial-time algorithms
algorithms.

an important subclass of exponential-time

Some

instances of pseudopolynomial-time

bounds are 0(m + nC) and

0(mC).

For problems that satisfy the similarity assumption, pseudopolynomial-time

algorithms become polynomial-time algorithms, but the algorithms will not be attractive
if

C and U

are high degree

polynomiab

in n.

There are two major reasons for preferring polynomial-time algorithms to


exponential-time
algorithms.
First,

any polynomial-time algorithm

is

asymptotically

superior to any exponential-time algorithm.

Even
n
is

in

extreme cases

this is true.
this case,

For

example, n^'^OO

is

smaller than tP'^^^E^ ^

if

sufficiently large.

Qn

n must

be larger than 2"^^^'^^^.)


polynomial-time algorithms.
experience has

Figure 1.8 illustrates the asymptotic superiority of

The second reason

is

more pragmatic.

Much

practical

shown

that, as a rule,

polynomial-time algorithms perform better than

exponential time algorithms.


small degree.

Moreover, the polynomials in practice are typically of a

20

APPROXIMATE VALUES

21

and

m= A
I

We associate
that Uj; >

with each arc


(i, j)

(i, j)

e A, a cost

Cj;

and

a capacity

Uj:.

We

assume throughout
nodes
in a graph;

for each

A.

Frequently,

we

distinguish

two

special

the source s

and

sink

t.

An

arc

(i, j)

has two end points,


as the
i.

and
j

j.

The arc

(i,j)

is

incident to nodes

and

j.

We
j.

refer to

node

tail

jmd node
(i, j)

as the head of arc


aire

(i, j),

and say

that the arc

(i, j)

emanates from node


Tlie arc adjacency

The
of
j

arc

is

an outgoing

of

node

and an incoming

arc of

node
i,

list

node

i,

A(i), is

defined as the set of arcs emanating from node


of a

i.e.,

A(i)

{(i, j)

N}.

The degree

node

is

the

number

of incoming

and

outgoing arcs incident to that node.

A directed
(\2
r-1.
,

path in
,

G
if

= (N, A)

is

a sequence of distinct
(ij^,

nodes and arcs ip (ip

12^, 12,
1,
.

13), 13.-

,(

ij.i, if)

satisfying the property that

ij^+p

for each

k=

An

undirected path

is

defined similarly except that for any two consecutive nodes


either arc
(ij^, i\^+-[)

i^.

and

ij^^-j

on the path, the path contains


i2
,

or arc (ij^+i

i\^

We refer to

the nodes

i3

ij-.^

as the internal nodes of the path.


(ij. ,

A directed
is

cycle is a directed

path together with the arc

i|)

and an undirected

cycle

an imdirected path together

with the arc

(ij. , i)

or

(i^

ij.).

We
we

shall often use the terminology path to designate either a directed or

an

undirected path;

whichever

is

appropriate from context.

If

any ambiguity might

arise,

shall explicitly state directed or undirected path.


i|

For simplicity of notation,


. . .

we

shall

often refer to a path as a sequence of nodes

i2

-ij^

when

its

arcs are apparent

from the problem context. Alternatively, we

shall

sometimes

refer to a path as a set of

(sequence oO arcs without mention of the nodes.


representing cycles.

We

shall

use similar conventions for

graph

= (N, A)

is

called a bipartite graph


(i, j)

if its
i

node

set
j

N can be partitioned into


and A'

two subsets N| and N2 so

that for each arc

in A,

N| and
if

e N2.

graph G' =
is

(N', A') is a

subgraph of

G=

(N, A)
if

N'

CN

A.

graph

G' = (N', A')

a spanning subgraph of

= (N, A)

N' =

N and

A'

A.

Two

nodes

and
i

are said to be connected


j.

if

the graph contains at least one


if all

undirected path from


connected; othervs^se,

to
is

graph

is

said to be connected

pairs of nodes are


that the

it

disconnected.

In this chapter,

we always assume

graph

G
is

is

We refer to any set Q c A with the property that the graph G' = (N, A-Q) disconnected, and no superset of Q has this property, as a cutset of G. A cutset
connected.

22

partitions the graph into

two

sets of nodes,

X and N-X.

We

shall

alternatively represent

the cutset

Q as the
graph
is

node

partition (X, N-X).

acyclic

if it

contains no cycle.

tree is a

connected acyclic graph.

subtree of a tree

is

a connected

subgraph of

T.

tree

is

said to be a spanning

A tree of G if
and

T is a spanning subgraph
arcs not belonging to
1

of G. Arcs belonging to a spaiming tree


called nontree arcs.

T are called

tree arcs,

T are

A spanning tree of G = (N, A)


is

has exactly ntree has at

tree arcs.

A node in
nc des.

a tree with degree equal to one

called a leaf node.

Each

least

two

leaf

spanning

tree contains a

unique path between any two nodes. The addition of


cycle.

any nontree arc

to a

spanning tree creates exactly one

Removing any
two

arc in this

cycle again creates a spanning tree.

Removing any

tree-arc creates

subtrees.

Arcs
a

whose end points belong

to

two
If

different subtrees of a

spanning

tree created

by deleting

tree-arc constitute a cutset.

any arc belonging


tree.

to this cutset is

added

to the subtrees, the

resulting graph

is

again a spanning

In this chapter,

we assume

that logarithms

are of base 2 unless


log
b.

we

state

it

othervdse.

We

represent the logarithm of any

number b by

1.4

Network Representations
The complexity
of a

network algorithm depends not only on the algorithm, but


to represent the

also

upon

the

manner used

network within a computer and the storage


results.

scheme used

for maintaining

and updating the intermediate

The running time

of an algorithm (either worst<ase or empirical) can often be

improved by representing
In this section,

the network
discuss

more

cleverly

and by using improved data


of representing a network.

structures.

we

some popular ways


In Section
1.1,

we have

already described the node-arc incidence matrix

representation of a network.

This scheme requires

nm
this

words

to store a network, of
is

which only
space

2m words

have nonzero values. Clearly,


to represent a

network representation
is

not

efficient.

Another popular way


=

network

the node-node adjacency


I

matrix representation.
the element
I^:

This representation stores an n x n matrix


(i, j)

with the property that

1 if

arc

A, and

Ijj

otherwise.

The

arc costs

and

capacities are

23

(a)

A network example

arc

number
1

point

(tail,

head)

cost

cost

1-

2
3
1

2
3

2
3
1

4
5

4 2

6
7
8

4
1

4
2

(b)

The forward

star representation.

(c)

The reverse

star representation.

arc

number
1

(tail,

head)

cost

2
3

4
5

6
7
8

24

also stored in n x n matrices.

This representation

is

adequate for very dense networks,

but

is

not attractive for storing a sparse network.

The forward

star

and

reverse star representations are

probably the most popular ways

to

represent networks, both sparse and dei^se.


incidence
list

(These representations are also


literature.)
first

known

as

representation in the

computer science

The forward

star

representation

numbers

the arcs in a certain order:


2,

we

number

the arcs emanating

from node

1,

then the arcs emanating from node


arbitrarily.

and so

on.

Arcs emanating from the

same node can be numbered


the cost of arcs in this order.

We

then sequentially store the (taU, head) and

We

also maintain a pointer with each

node

i,

denoted by

point(i), that indicates the smallest


i.

number
i

in the arc

list

of an arc emanating from


-

node
1) in

Hence the outgoing


list.

arcs of

node
-

are stored at positions point(i) to (point(i+l)

the arc

If point(i)

> point(i+l)

1,

then node

has no outgoing

arc.

For consistency,

set point(l)

and point(n+l) = m+1.

Figure 1.9(b) specifies the forward star


1.9(a).

representation of the network given in Figure

The forward
outgoing arcs
at

star representation allows

us to determine efficiently the set of


set of

any node. To determine, simultaneously, the

incoming arcs

at

any

node

efficiently,

we need an

additional data structure

known

as the reverse star

representation.

Starting from a forward star representation,

we
n

can create a reverse star

representation as follows.
store the
(tail,

We

examine the nodes

to
j.

in order

and sequentially

head) and the cost of incoming arcs of node


i,

We also
i.

maintain a reverse
position in these

pointer with each node

denoted by

rpoint(i),

which denotes the

first

arrays that contains information about an incoming arc at node


consistency,

For the sake of

we
at

set rpoint(l) =

and rpoint(n+l) = m+1.

As

earlier,

we

store the

incoming arcs

node

at positions rpoint(i) to (rpoint(i+l) - 1).


1.9(c).

This data structure

gives us the representation shov^Ti in Figure

Observe

that

by storing both the forward and reverse

star representation S,

we

will maintain a significant duplicate information.

We

can avoid this duplication by


eircs.

storing arc
(3, 2) hcis
1.

numbers

ir\stead of

the

(tail,

head) and the cost of the

For example, arc


has arc number

arc

number

4 in the forward star representation.


(tail,

The

arc

(1, 2)

So instead of storing

head) and cost of arcs,

we

can simply store the arc numbers

and once we know the


from the forward
1.9(d) gives the

arc numbers,

we

can always retrieve the associated information


store
circ

star representation.

We

numbers

in

an m-array

trace.

Figure

complete trace array.

25

1.5

Search Algorithms
Search algorithnvs are fundamental graph techniques; different variants of search

lie at

the heart of

many network

algorithms.

In this section,

we

discuss

two

of the

most

commonly used

search techniques: breadth-first search and depth-first search.

Search algorithms attempt to find


property.
in a

all

nodes in a network that

satisfy a particular

For purposes of illustration,

let

us suppose that

we wish

to find all the

nodes

graph
s,

= (N, A) that are reachable through directed paths from a distinguished

node

called the source.


in

At every point
states:

in the

search procedure,

all

nodes

in the
to

network are

one of two

marked or unmarked. The marked nodes are


is

known

be reachable from the source, and the status of unmarked nodes

yet to be determined.
inadmissible

We call an arc
otherwise.

(i, j)

admissible

if

node

is

marked and node


is

is

unmarked, and

Initially,

only the source node

marked.

Subsequently, by examining

admissible arcs, the search algorithm will mark more nodes.

Whenever
i

the procedure

marks
of

new node by examining an


j

admissible arc

node

j,

i.e.,

predi])

i.

The algorithm

we say that node is a predecessor terminates when the graph contains no


(i, j)

admissible arcs. Tl e follovkdng algorithm summarizes the basic iterative steps.

26

algorithm

SEARCH;
nodes
s;

begin

unmark

all

in

N;

mark node
LIST
:= {s);

while LIST *

do

begin
select a
if

node
i

in LIST;
(i, j)

node

is

incident to an admissible arc

then

begin

mark node
pred(j) :=
i;

j;

add node
end
else delete

to LIST;

node

from LIST;

end;
end;

When
from
nodes.

this

algoirthm terminates,

it

has marked

all

nodes

in

that are reachable

s via a directed path.

The predecessor indices define

a tree consisting of

marked

We
structure

use the following data structure to identify admissible


is

arcs.

The same data

also used in the

maximum

flow and

minimum
i

cost flow algorithms


A(i) of arcs

discussed in later sections.

We

maintain with each node

the

list

emanating
(i, j)

from

it.

Arcs

in

each

list

can be arranged arbitrarily.

Each node has a current arc


Initially,

which
i

is

the current candidate for being examined next.


first

the current arc of node

is

the

arc in A(i).
is

The search algorithm examines


inadmissible,
it

this list sequentially


list

and

whenever the current arc


arc.

makes the next


list, it

arc in the arc

the ciirrent

When

the algorithm reaches the end of the arc


arc.

declares that the node has no

admissible

It is

easy to

show

that the search algorithm runs in

0(m +

n)

= 0(m)

time.

Each

iteration of the

while loop either finds an admissible arc or does

not.

In the former case,


it

the algorithm marks a

new node and adds

it

to LIST,

and

in the latter Ccise

deletes a

marked node from LIST. Since the algorithm marks any node at most once, it executes the while loop at most 2n times. Now consider the effort spent in identifying the

27

admissible arcs. For each node

i,

we

scan arcs in A(i)


arcs,

at

most once. Therefore, the search


in

algorithm examines a

total of

ie

X A(i) = m N

and thus terminates

0(m)

time.

The algorithm,
nodes
to LIST.

as described, does not specify the order for

examining and adding


If

Different rules give rise to different search techniques.


i.e.,

the set LIST

is

maintained as a queue,

nodes are always selected from the front and added


first-in, first-out

to the rear,

then the search algorithm selects the marked nodes in the

order.

This
s;

kind of search amounts to visiting the nodes in order of increasing distance from
therefore, this version of search
is

called a breadth-first search.


s,

It

marks nodes
s to
i

in the

nondecreasing order of their distance from


the

with the distance from


i.

meeisured as

minimum number

of arcs in a directed path from s to

Another popular method

is

to maintain the set

LIST as a

stack,

i.e.,

nodes are

always selected from the front and added

to the front;

in this instance, the search

algorithm selects the marked nodes in the

last-in, first-out order.

This algorithm
to

performs a deep probe, creating a path as long as possible, and backs up one node
initiate a

new probe when

it

can mark no

new nodes from

the tip of the path.

Hence,

this version of search is called a depth-first search.

L6

Developing Polynomial-Time Algorithms


Researchers frequently employ two important approaches to obtain polynomial

algorithms for network flow problems: the geometric improvement (or linear convergence)

approach, and the scaling approach.

In this section,
will

we

briefly outline the basic ideas


all

underlying these two approaches.

We

assume, as usual, that

data are integral

and

that algorithms maintain integer solutions at intermediate stages of computations.

Geometric Improvement Approach

The geometric improvement approach shows


polynomial time
if

that

an algorithm runs

in

at

every iteration

it

makes an improvement

proportioT\al to the
solutioiis.

difference between the objective function values of the current

and optimum

Let

be an upper bound on the difference in objective function values between any two
For most network problems,

feasible solutions.

is

a function of n,
in the

m, C, and U. For
cost flow

instance, in the

problem

maximum mCU.

flow problem

mU, and

minimum

28

Lemma 1.1. Suppose r^ is the objective function value of a minimization problem of some solution at the k-th iteration of an algorithm and 2* is the minimum objective function value. Further, suppose that the algorithm guarantees that
(2k_2k+l) ^ a(z^-z*)
(13)
for

(i.e., the improvement at iteration k+1 is at least a times the total possible improvement) some constant a xvith < a< 1. Then the algorithm terminates in O((log H)/a) iterations.

Proof. The quantity

(z*^

z*)

represents the total possible improvement in the objective

function value after the k-th iteration. Consider a consecutive sequence of


starting

2/a

iterations

from

iteration k.

If in

each iteration, the algorithm improves the objective

function value by at least

aCz*^

- z*)/2 units, then the algorithm would determine an

optimum

solution within these

2/a

iterations.

On

the other hand,

if

at

some

iteration,

the algorithm improves the objective function value by no

more than

aCz*^

- z*)/2

units,

then

(1.3)

implies that

a(z^ - z*)/2 ^ z^ -

z^-^^

^ aCz^ - z*),

and, therefore, the algorithm must have reduced the total possible improvement (z*^- z*) by a factor of 2 within these 2/a iterations. Since H is the maximum possible improvement and every objective function value is an integer, the algorithm must terminate wathin 0((log H)/a) iterations.

We
A

have stated

this result for

minimization versions of optimization problems.

similar result applies to maximization versions of optimization problems.

The geometric improvement approach might be summarized by


"network algorithms that have
algorithms."
a

the statement

geometric convergence rate are polynomial time

In order to develop polynomial time algorithms using this approach,


(i.e.,

we

can look for local improvement techniques that lead to large

fixed percentage)

improvements
for the

in the objective function.

The maximum augmenting path algorithm


for the
4.2

maximum flow problem and the maximum improvement algorithm minimum cost flow problem are two examples of this approach. (See Sections
5.3.)

and

Scaling Approach

Researchers have extensively used an approach called scaling to derive

polynomial-time algorithms for a wide variety of network and combinatorial


optimization problems.
In this discussion,

we

describe the simplest form of scaling

which we

call bit-scaling.

Section 5.11 presents an example of a bit-scaling algorithm for

29

the assignment

problem.

Sections 4

and

5,

using more refined versions of scaling,

describe polynomial-time algorithms for the

maximum

flow and

minimum

cost flow

problems.

Using the bit-scaling technique, we solve a problem P parametrically as a sequence of problems P^, P2, P3, Pj^ the problem P^ approximates data to the first
...
,
:

bit,

the problem P2 approximates data to the second

bit,

and each successive problem


.

is

better approximation until Pj^ = P. Further, for each k = 2,

K, the

optimum

solution
is

of

problem

Pj^^.-j

serves as the starting solution for problem

Pj^.

The
is

scaling technique

useful whenever reoptimization from a good starting solution


solving the problem from scratch.

more

efficient

than

For example, consider a network flow problem whose largest arc capacity has
value U. Let

K = Flog Ul and
would consider

suppose
if

that

we

represent each arc capacity as a

bit

binary

number, adding leading zeros

necessary to

make each

capacity

bits long.

Then the
its

problem

Pj^

the capacity of each arc as the k leading bits in

binary

representation.

Figure 1.10 illustrates an example of this type of scaling.

The manner

of defining arc capacities easily implies the following observation.


of

Observation. The capacity

an arc

in

P^

is

tivice that in Pf^^j

plus

or

1.

30

100

<=^

(a)

(b)

PI

P2

100

P3:

010

(c)

Figure

1.10.

Example of a

bit-scaling technique.

(a)

Network with

arc capacities. arc capacities.

(b)
(c)

Network with binary expansion of The problems Pj, P2, and P3.

31

The following algorithm encodes a generic version


algorithm BIT-SCALING;

of the bit-scaling technique.

begin
obtain an
for k
:

optimum
to

solution of P^;

= 2

K do
optimum
solution of Pj^.i to
Pj^;

begin
reoptimize using the
obtain an

optimum

solution of

end;
end; This approach

is

very robust; variants of

it

have led

to

improved algorithms

for

both the

maximum

flow and

minimum

cost flow problems.

This approach works well


(i)

for these applications, in part,

because of the following reasons,


of

The problem P^

is

generally easy to solve,

(ii)

The optimal solution

problem

Pj;_i is

an excellent starting

solution for problem Pj^ since Pj^.^ and Pj^ are quite similar.
solution of Pi^_i can be easily reoptimized to obtain an

Hence, the optimum


solution of
Pj^.
(iii)

optimum

For problems that satisfy the similarity assumption, the number of problems solved

is

OOog

n).

Thus
(i.e.,

for this

approach

to

work, reoptimization needs

to

be only a

little

more

efficient

by

a factor of log n) than optimization.

Consider, for example, the

maximum
and
is xj^

flow problem.

Let

vj^

denote the
vj^.

maximum

flow value for problem


Pj,,

Pj^

denote an arc flow corresponding to


its

In

the problem

the capacity of an arc


xj^.^

twice

capacity in Pj^.i plus

or

1.

If

we

multiply the

optimum flow
2vj^_'j

for Pj^.i

by

2,

we

obtain a feasible flow for

Pj^.

Moreover,

vj^

<

because multiplying the flow X]^_^ by 2 takes care of the


I's

doubling of the capacities and the additional

can increase the

maximum
increase the

flow value

by

at

most

m units

(if

we add

to the capacity of

any

arc,
it

then
is

we

maximum

flow from source to sink by

at

most

1).

In general,
claissical

easier to reoptimize such a

maximum
Section 4.1

flow problem.

For example, the

labeling algorithm as discussed in

would perform

the reoptimization in at

most

augmentations, taking

O(m^) time. Therefore, 0(m^ log U) time, whereas


time bound
is

the scaling version of the labeling algorithm runs in


the non-scaling version runs in
latter

O(nmU)

time.

The former Thus


this

polynomial and the

bound

is

only pseudopolynomial.

simple scaling algorithm improves the running time dramatically.

32

2.

BASIC PROPERTIES OF
As
a

NETWORK FLOWS
we
describe several basic

prelude to the

rest of this chapter, in this section

properties of network flows.

We

begin by showing

how network

flow problems can be

modeled
Section

in either of

two equivalent ways:

as flows on arcs as in our formulation in

1.1

or as flows on paths and cycles.

Then we

partially characterize optimal

solutions to network flow problems

and demonstrate

that these

problems always have

certain special types of optimal solutions (so<alled cycle free


solutions).

and spanning

tree

Consequently, in designing algorithms,

we need
Finally,

only consider these special

types of solutions.

We

next establish several important connections between network

flows and linear and integer programming.


transformations of network flow problems.

we

discuss a few useful

2.1

Flow Decomposition Properties and Optimality Conditions


It is

natural to view network flow problems in either of two ways:

as flows on

arcs or as flows on paths

and

cycles.

In the context of developing underlying theory,


its

models, or algorithms, each view has

own
to

advantages. Therefore, as the

first

step in

our discussion, we will find


alternate formulations.

it

worthwhile

develop several connections between these

In the arc formulation (1.1), the basic decision variables are flows

Xj:

on arcs
cycles

(i, j).

The path and


the network.
q,

cycle formulation starts with an enumeration of the paths


Its

P and

of

decision variables are h(p), the flow on path p,


for every directed path

and

f(q),

the flow
in

on cycle

which are defined

in

P and every directed cycle q

Q.

Notice that every set of path and cycle flows uniquely determines arc flows in a
natural way:

the flow

xj;

on arc

(i, j)

equals the

sum

of the flows h(p)

and

f(q) for all

paths p and cycles q that contain this arc.

We
j)

formalize this observation by defining

some new

notation:

5jj(p)
1 if

equals
(i, j)

if

arc

(i,

is

contained in path p and


is

otherwise;

similarly, 6jj(q) equals

arc

is

contained in cycle q and

otherwise.

Then

^i3=

I
p P

5ij(p)h(p)+

X
qe

hf<i^^^^^-

33

If

the flow vector x

is

expressed in this way,

we

say that the flow

is

represented
f is

eis

path

flows and cycle flows and that the path flow vector h and cycle flow vector
cycle flow representation of the flow.

a path

and

Can we
represent
it

reverse this process? That

is,

can

we decompose any

arc flow into

(i.e.,

as) path

and cycle flows?

The following

result provides

an affirmative

answer

to this question.
2.1:

Theorem

Flow Decomposition Property

(Directed Case).

Every directed path and

cycle flow

Conversely, every has a unique representation as nonnegative arc flows. nonnegative arc flow x can he represented as a directed path and cycle flow (though not necessarily uniquely) with the following two properties:

C2.1.

Every path with positive flow connects a supply node of x

to a

demand node
most

of x. cycles

C2.2. At most n+m paths and cycles have nonzero flow; out of have nonzero flow.
Proof.
In the light of our previous observations,

these, at

we need
that
ig is a

to establish

only the converse

assertions.

We

give an algorithmic proof to

show

any

feasible arc flow x can be

decomposed
Oq,

into path

and cycle
If

flows.
i^j

Suppose

supply node. Then some arc

i|) carries a

positive flow.

is

demand node

then

we

stop; otherwise the


(i^, 12)

mass

balance constraint (1.1b) of node


flow.

i^

implies that

some other

arc

carries positive

We

repeat this argument until either

we

encounter a

demand node
ig to

or

we

revisit a

previously examined node. Note that one of these cases will occur within n steps. In the

former case
ij^

we

obtain a directed path p from the supply

node

some demand node

consisting solely of arcs with positive flow,


If

and

in the latter case


[b(iQ), -b(ij^),
xj:

we

obtain a directed
(xj:
:

cycle q.

we

obtain a directed path,


b(ij^)

we
=

let

h(p) = inin

min

(i, j)

p)],

and redefine b(iQ) = b(iQ) - h(p),


p.
If

b(ijj)

+ h(p) and
:

Xj; -

h(p) for each arc


x^;

(i, j)

in

we

obtain a cycle q,
(i, j)

we

let f(q)

= min

{x^:

(i, j)

q) and redefine

Xj:

f(q) for

each arc

in q.

We
lecist

repeat this process with the redefined problem until the network contains no

supply node (and hence no demand node). Then

we

select a

transhipment node with at

one outgoing arc with positive flow as the starting node, and repeat the procedure,
in this Ceise

which
0.

must find a
is

cycle.

We

terminate

when

for the redefined

problem x =
by the

Clearly, the original flow

the

sum

of flows

on the paths and cycles

identified

procedure.

Now

observe that each time

we

identify
to zero;

path,

we

reduce the
identify

supply /demand of some node or the flow on some arc


a cycle,

and each time we

we reduce

the flow on

some

arc to zero.

Consequently, the path and cycle

34

representation of the given flow x contains at most (n +

m)

total

paths and cycles,

of

which there are


It

at

most

cycles.

is

possible to state the decomposition property in a

somewhat more general

form

that permits arc flows xj; to


is

be negative. In

this Ccise,

even though the underlying

network

directed, the paths

and

cycles can be undirected,


p,

and can contain

arcs with

negative flows.
final

Each undirected path

which has an orientation from

its initial to its

node, has forward arcs and backward arcs which are defined as arcs along and

opposite to the path's orientation.


h(p) on each forward arc

path flow will be defined


arc.

on p as

a flow with value

and

-h(p)

on each backward

We

define a cycle flow in the


5j;(p)

same way.
6j:(q) is still

In this

more general

setting,

our representation using the notation

and
-1 if

valid v^th the following provision:

we now

define

6j;(p)

and

S^jCq) to

be

arc

(i, j)

is

backward

arc of the path or cycle.

Theorem 2.2; Flow Decomposition Property (Undirected Case). Every path and cycle Conversely, every arc flow x can be flow has a unique representation as arc flows. represented as an (undirected) path and cycle flow (though not necessarily uniquely) with the following three properties:
C2.3.
C2.4.

Every path with positive flow connects a source node of x


For every path and
cycle,

to a sink

node of

x.

any arc with

positive flow occurs as a forward arc

and any

arc with negative flow occurs as a backward arc.

At most n+m paths and cycles have nonzero flow; out of C2.5. have nonzero flow.
Proof.

these, at

most

cycles

This proof
at

is

similar to that of
ij^_-j

Theorem

2.1.

The major modification


,

is

that

we

extend the path


(ij^
,

some node

by adding an arc

(ij^.'j

ij^)

with positive flow or an arc

ij^_|

with negative flow. The other steps can be modified accordingly.

The flow decomposition property has


one example,
it

number

of important consequences.

As

enables us to compare any two solutions of a network flow problem in a

particularly convenient

way and

to

show how we can

build

one solution from another

by a sequence

of simple operations.

We need
flow
f(q)

the concept of augmenting cycles with respect to a flow

x.

cycle q with

>

is

called

an augmenting
5jj(q) f(q)

cycle

with respect to a flow x


e q.

if

<

Xjj

<

Ujj,

for each arc

(i, j)

35

In other words, the flow remains feasible

if

some

positive

amount

of flow

(namely
cycle

f(q)) is

augmented around the cycle

q.

We

define the cost of an augmenting

q as

c(q)

V
(i, j)

Cj; 5jj(q).

The

cost of an

augmenting cycle represents the change

A
if

in cost of a feasible solution

we augment

along the cycle with one unit of flow. The


f(q) is c(q) f(q).

change

in flow cost for

augmenting around cycle q with flow

Suppose
< X < u and

that x

and y are any two solutions

to a

network flow problem,


-

i.e.,

Nx

b,

Ny

b,

0<y<u.
-

Then the

difference vector z = y

satisfies the

homogeneous equations Nz = Ny

Nx

0.

Consequently, flow decomposition implies

that z can be represented as cycle flows,


f(q-)),
...
,

i.e.,

we

can find
(i, j)

at

most

<

cycle flows f(q])/

f(qj.)

satisfying the property that for each arc

of A,

zjj

6ij(qi) f(qi)

5jj(q2) f(q2)

...

SjjCqr) fCq^.

Since y = x +

z,

for

any arc

(i, j)

we have
+
6ij(q2)

<

yjj

Xjj

5jj(q^) fCq^)

f(q2)

...

5jj(qr) f(qr)

<

Ujj.

Now
q-j,

by condition C2.4 of the flow decomposition property, arc


...
,

(i, j)

is

either a

forward arc on each cycle q^, q2,


q2,
.

q^

that contains

it

or a

backward arc on each cycle


x^;

qm

that contains

it.

Therefore, each term between

and the rightmost


Ujj.
is, if

inequality in this expression has the


for each cycle qj^
,

same
<

sign;

moreover,
(i, j)

<
qj^.

yjj

<

Consequently,

<

Xj;

6j:(qj(.) f(qj^^)

Uj; for

each arc

That

we add any
(i, j).

of

these cycle flows

qj^ to x,
,

the resulting solution remains feasible on each arc

Hence,

each cycle q^
that

q2

...

q,. is

an augmenting cycle with respect

to the

flow

x.

Further, note

(i, j)

(i, j)

(i, j)

(i, j)

(i, j)

k=l

(i,j)A

k=l

36

We

have thus established the following important


2.3:

result.

Theorem

Augmenting Cycle Property.

Let X

network flow problem. Then y equals x plus the with respect to x. Further, the cost of y equals the cost of x

any two feasible solutions of a flow on at most m augmenting nicies


and y
he

plus the cost of flow on the

augmenting

cycles.

The augmenting
characterizing the

cycle property permits us to formulate optimality conditions for

optimum

solution of the
x*
is

minimum

cost flow problem.

Suppose

that

is

any

feasible solution, that

an optimum solution of the

minimum

cost flow

problem, and that

x*.

The augmenting
into at
If

cycle property implies that the difference

vector X* - x can be

decomposed

most

m augmenting cycles and the sum

of the

costs of these cycles equals

cx* - ex.

ex* < cx

then one of these cycles must have a

negative cost.

Further,

if

every augmenting cycle in the decomposition of x* - x has a


0.

nonnegative

cost,

then cx* - cx >

Since x*

is

an optimum flow, cx* = cx and x


result.

is

also

an optimum flow.

We

have thus obtained the following

Theorem
it

2.4.

Optimality Conditions.

feasible flow

is

an optimum flow

if

and only

if

admits no negative cost augmenting cycle.

2J.

Cycle Free and Spanning Tree Solutions

We start

by assuming

that x is a feasible solution to the

network flow problem

minimize

cx

Nx = b and

^x<u

and

that

0.

Much

of the underlying theory of


2.1.

network flows stems from


In the example, arc flows

a simple

observation concerning the example in Figure


are given besides each arc.

and

costs

37

3,$4

3-e

<D
2+e

4,$3

i
2.1.

4+e

<!)
cycle.

Figure

Improving flow around a


being that
all

Let us

assume

for the time

arcs are uncapacitated.

The network

in

this figure contains

flow around an undirected cycle.

Note

that

adding a given amount


this

of flow 6 to all the arcs pointing in a clockwise direction


all

and subtracting

flow from
at

arcs pointing in the counterclockwise direction preserves the

mass balance
is

each
of the

node. Also, note that the per unit incremental cost for this flow change
cost of the clockwise arcs

the

sum

minus the sum

of the cost of counterclockvkdse arcs,

i.e..

Per unit change in cost = A = $2 + $1 + $3


Let us refer to this incremental cost negative, positive or zero cost cycle

$4

$3 = $

-1.

as the q/cle cost

and say
A.

that the cycle

is

depending upon the sign of

Consequently, to

minimize cost
nonnegativity of
that in the
cycle.

in
all

our example,
arc flows,
(at
i.e.,

we

set

6 as large as possible while preserving


4
-

3-6^0 and
we no

8 S

0,

or 6 <

3;

that

is,

we

set 6
all

3.

Note

new

solution

6 = 3),

longer have positive flow on

arcs in the

Similarly,

if

the cycle cost were positive

(i.e.,

we were

to

change C|2 from 2

to 4),

then
-2)

we would

decrease 6 as

much

as possible

(i.e.,

5 +

6^0, 2 + 6^0, and


on
at least

4 + 6 S 0, or 6

>
at

and again

find a lower cost solution with the flow

one arc in the cycle

value zero.
of
all

We

can restate

this observation in

another way:

to preserve nonnegativity

flows,

we must
on
6,

select 6 in the interval -2

<6 <

3.

Since the objective function


-2 at

depends

linearly

we

optimize

it

by

selecting 6

= 3 or 6 =

which point one arc

in

the cycle has a flow value of zero.

38

We
(i) If

can extend

this

observation in several ways:

the per unit cycle cost

A =

0,

we

are indifferent to

all

solutions in the interval -2 < 9 <

3 and therefore can again choose a solution as good as the original one but with the flow
of at least arc in the cycle at value zero.

(ii) If

we impose upper bounds on


is

the flow,
(i.e.,

e.g.,

such as 6 units on

all arcs,

then the

range of flows that preserves


flows)

feasibility
Ceise -2

mass balances, lower and upper bounds on


1,

again an interval, in this

<6<

and we can

find a solution as
6,

good

as the

original
that
is,

one by choosing 6 =
for

-2 or 6

1.

At these values of

the solution

is

cycle free,
is at its

some arc on the cycle, upper bound (x^2 = ^ ^t 6 = 1).

either the flow is zero (the lower

bound) or

Some
observations

additional notation will be helpful in encapsulating

and summarizing our

up

to this point.

Let us say that an arc

(i, j)

is

a p'ee arc with respect to a

given feasible flow x

if Xj; lies strictly


(i, j)

between the lower and upper bounds imposed


is restricted if its

upon

it.

We

will also say that arc

flow

xj;

equals either

its

lower or
if

upper bound.

In this terminology, a solution x has the "cycle free property"


entirely of free arcs.

the

network contains no cycle made up

In general, our prior observations apply to any cycle in a network.

Therefore,
at a

given any
time,

initial

flow

we

can apply our previous argument repeatedly, one cycle

and

establish the following


2.5:

fundamental

result:

Theorem

optimization

Cycle Free Property. problem


minimize
ex

If the

objective function value of the network

Nx

b,

<x <u

is

bounded from below on the

feasible

region

and the problem has

a feasible solution,

then at least one cycle free solution solves the problem.

Note

that the

lower bound assumption imposed upon the objective value

is

necessary to rule out situations in which the flow change variable 6 in our prior

argument can be made

arbitrarily large in a negative cost cycle, or arbitrarily small

(negative) in a positive cost cycle; for example, this condition rules out

any negative

cost

directed cycle with no upper

bounds on

its

arc flows.

39
useful to interpret the cycle free property in another way.

It is

Suppose

that the

network
nodes).

is

connected

(i.e.,

there

is

an undirected path connecting every two pairs of


is

Then, either a given cycle free solution x contains a free arc that

incident to

each node in the network, or

we

can add to the free arcs some restricted arcs so that the

resulting set S of arcs has the following three properties:

(i)
(ii)

S contains

all

the free arcs in the current solution,

S contaiT\s no undirected cycles, and

(iii)

No

superset of S satisfies properties

(i)

and
(i)

(ii).

We

will refer to

any

set

S of arcs satisfying

through

(iii) eis

a spanning tree of
a

the network

and any

feasible solution x for the

network together with


(At times

spanning

tree S

that contains all free arcs as a spanning tree solution.

we

will also refer to a

given cycle free solution x as a spanning tree solution, with the understanding that
restricted arcs

may

be needed to form the spanning tree

S.)

Figure
that
it

2.2. illustrates a

spanning
is)

tree

corresponding to a cycle free solution. Note


set of free arcs into a

may

be possible (and often


(e.g.,

to

complete the
wdth arc
(3,

spanning

tree

in several

ways

replace arc

(2, 4)

5) in

Figure

2.2(c)); therefore, a

given

cycle free solution can correspond to several spanning trees S.

We
If

will say that a

spanning tree solution x


this case, the

is

nondegenerate

if

the set of free arcs forms a spanning tree.


to the

In

spanning tree S corresponding


are not incident to)
all

flow x

is

unique.

the free arcs do

rot span

(i.e.,

the nodes, then any spanning tree corresponding to


arc's

this solution will contain at least

one arc whose flow equals the


vdll say that the

lower or upper

bound

of the arc.

In this case,

we

spanning

tree

is

degenerate.

40

(4,4)

(1,6)

(0,5)

(a)

An example network with

arc

flows and capacities represented as

(xj:, uj:

).

(b)

A cycle free solution.

<D

(c)

spanning

tree solution.

Figure

2.2.

Converting a cycle free solution to

spanning

tree solution.

41

When

restated in the terminology of spanning trees, the cycle free property


result in

becomes another fundamental

network flow theory.


If the objective

Theorem

2.6:

Spanning Tree Property.


problem
minimize
{ex:

function value of the network

optimization

Nx

b,

<x <

u]

is

bounded from below on the

feasible

region and the problem has a feasible solution

then at least one spanning tree solution solves the problem.

We
of the flow

might note

that the

spanning

tree property is valid for

concave cost versions


is

problem as

well,

i.e.,

those versions where the objective function

a concave
is

function of the flow vector


valid because
if

x.

This extended version of the spanning tree property


is

the incremental cost of a cycle

negative at

some

point, then the

incremental cost remains negative (by concavity) as

we augment

positive

amount

of

flow around the

cycle.

Hence,

we

can increase flow in a negative cost cycle until

at least

one arc reaches


2.3

its

lower or upper bound.

Networks, Linear and Integer Programming

The

cycle free property

and spanning

tree property

have many other important

consequences.

In particular, these

two properties imply

that

network flow theory bes

at

the cusp between

two

large

and important subfields of optimizationlinear and integer

programming.

This positioning may, to a large extent, account for the emergence of


a cornerstone of mathematical

network flow theory as


Triangularity Property

programming.

Before establishing our

first

results relating

network flows
that

to linear

and integer
S has
at

programming, we
least

first

make

few observations. Note


is,

any spanning

tree

one

(actually at

lecist

two) leaf nodes, that


if

node

that is incident to only

one arc

in the

spanning

tree.

Consequently,

we

rearrange the rows and columns of the


is

node-arc incidence matrix of S so that the leaf node

row

and
-1,

its

incident arc
lies

is

column

1,

then

row

has only a single nonzero entry, a +1 or a


If
is

which

on the
its

diagonal of the node-arc incidence matrix.


incident arc from S, the resulting network

we now remove

this lecif

node and

spanning tree on the remaining nodes.


1

Consequently, by rearranging
for the

all

but

row and column


that

of the node-arc incidence matrix

spanning

tree,

we

can

now assume

row

2 has

-t-1

or

-1

element on the

42

diagonal and zeros

to the right of the diagonal.

Continuing

in this

way

permits us to
n-1

rearrange the node-arc incidence matrix of the spanning tree so that

its first

rows

is

lower triangular. Figure

2.3

shows

the resulting lower triangular form (actually, one of

several possibilities) for the spanning tree in Figure 2.2(c).

nodes
5

L =

43

Now

further suppose that the


/

supply/demand vector b and lower and upper bound


Then
since every

vectors

and u have

all

integer components.

component

of
0,

yr-

equals
-1),

an arc lower or upper bound and


the right hand side

has integer components (each equal to


vector.

+1, or

Mx^
(2.1)

is

an integer

But this observation implies that the


diagonal element of

components
-1,

of x' are integral as well:

since the

first

equals +1 or

the

first

equation in
(2.1),

implies that x|

is integreil;

now

if

we move

x] to

the right of

the equality in
for X 2

the right

hand side remains


this
is

integral

and we can solve

from the second equation; continuing

forward substitution by successively

solving for one variable at a time

shows

that x^

integral.

This argument shows that for problems with integral data, every spanning tree
solution
is

integral.

Since the spanning tree property ensures that network flow


tree solutions,

problems always have spanning


fundamental
result.

we have

established the following

Theorem problem

2.8.

Integrality Property.

If the objective

value of the network optimization

minimize
is

ex:

Nx

b,

<x <u

the vectors
solution.

bounded from below on the feasible region, the problem has a feasible solution, and b, 1, and u are integer, then the problem has at least one integer optimum

Our

observation at the end of Section 2.2 shows that this integrality property

is

also valid in the

more general

situation in

which the objective function

is

concave.

Relationship to Linear Programming

The network flow problem with the


which, as the
leist

objective function ex

is

a linear program

result

shows, always has an integer solution. Network flow problems

are distinguished as the most important large class of problems with this prop>erty.

Linear programs, or generalizations with concave cost objective functions, ako


satisfy

another well-known property: they always have, in the parlance of convex


is,

emalysis, extreme point solutions; that

solutions x with the property that x cannot be


z, i.e.,

expressed

tis

weighted combination of two other feasible solutions y and

as x =

ay

(l-a)z for

some weight

< a <

1.

Since, as

we have

seen,

network flow problems

always have cycle free solutions,

we might

expect to discover that extreme point

44
solutions

and

cycle free solutions are closely related,

and indeed they are as shown by

the

next result.

For network flow problems, every cycle free solution is an extreme point and, conversely, every extreme point is a cycle free solution. Consequently, if the objective value of the network optimization problem
2.9.

Theorem

Extreme Point Property.

minimize
is

ex:

Nx

b,

<x <u

bounded from below on the

feasible

region

and the problem has a

feasible solution,

then the problem has an extreme point solution.

Proof. With the background developed already, this result


is

is

easy to establish.

First, if

not a cycle free solution, then

it

cannot be an extreme point, since by perturbing the


-6

flow by a small amount 6 and by a small amount

around a cycle with

free arcs, as in

our discussion of Figure

2.1,

we

define two feasible solutions y and z with the property


is

that X = (l/2)y + (l/2)z.

Conversely, suppose that x

not an extreme point and

is

represented as x = ay + (l-a)z with


these vectors for which y and z differ,
uij,

< a<
i.e.,

1.

Let x', y'


yij

and
zij

z' be the
ujj

components
zjj

of

/ij

<

<

xij

<

<

or

/jj

<

<
(i,

xij
j).

<

yjj

<

and
"

let

Nj
=
0'

denote the submatrix of

corresponding to these arcs


that the
cycle.

Then

NjCz^

>

which implies, by flow decomposition,


yjj

network contains an

imdirected cycle with

not equal to

Zij

for

any arc on the

But by definition of the


Therefore,

components
if

x^,

y^ and

z^, this cycle contains only free arcs in the solution x.


it

is

not an extreme point solution, then

is

not a cycle free solution.

In linear

programming, extreme points are usually represented algebraically as

basic solutions; for these special solutions, the

columns B of the constraint matrix of a


between
their

linear

program corresponding

to variables strictly

lower and upper bounds

are linearly independent.

We

can extend B to a basis of the constraint matrix by adding a


Just as cycle free solutions for

maximal number

of columns.

network flow problems

correspond to extreme points, spanning tree solutions correspond to basic solutions.

Theorem
is

2.10:

Basis Property.

Every spanning

tree solution to a
is

network flow problem

a basic solution and, conversely, every basic solution

a spanning tree solution.

Let us

now make one

final

connection between networks and linear and integer

programming namely, between


program
of the

basis

and the
that

integrality property.

Consider a linear

form Ax = b and suppose


x.

= [B,M] for some basis B and that x =

(x ,x^) is a

compatible partitioning of

Also suppose that

we

eliminate the redundant

row so

that

is

a nonsingular matrix.

Then

45
Bx^ = b - Mx^, or x^ = B-^(b
Mx^).

Also, by Cramer's rule from linear algebra,


of x' as

it

is

possible to find each

component

sums and

multiples of components of
if

b'

=b

Mx^ and

B, divided by det(B), the


-1,

determinant of B. Therefore,
vector whenever x^,
partitioning of
b,

the determinant of

B equals +1 or
of all integers.

then x^

is

an integer
if

and

are

composed

In particular,

the
b,
/

corresponds to a basic feasible solution x and the problem data A,

and u are

all

integers, then x^
if all

and consequently

x^

is

an integer.

Let us
-1,

call a

matrix
it

unimodular
unimodular

of
its

its

bases have determinants either +1 or

<md

call

totally
-1.

if all

of

square submatrices have determincmt equal to either 0,+l, or

How
Since bases of

are these notions related to network flows

and the

integrality property?

correspond

to

sparming

trees, the triangularity

property shows that the

determinant of any basis (excluding the redundant row now), equals the product of the
diagonal elements in the triangular representation of the basis, and therefore equals +1
or
-1.

Consequently, a node-arc incident matrix


let

is

unimodular. Even more,


If

it is

totally
0.

unimodular. For
Otherwise,
it

S be any square submatrix of N.

is

singular,
is

it

has determinant

must correspond

to a cycle free solution,

which

spanning tree on each


is

of its connected components.

But then,

it is

easy to see that the determinant of S


it

the

product of the determinants of the spanning trees and, therefore,


or
-1.

must be equal

to

4l

(An induction argument, using an expansion of determinants by minors, provides


this totally

an alternate proof of

unimodular property.)
The constraint matrix of
a

Theorem

Total Unimodularity Property. network flow problem is totally unimodular.


2.11:

minimum

cost

2.4

Network Transformations
Frequently, analysts use network transformations to simplify a network problem,

to

show equivalences

of different

network problems, or

to

put a network problem into a

standard form required by a computer code. In this subsection,

we

describe

some

of these

important transformations.
Tl.

(Removing Nonzero Lower Bounds).

If

an arc

(i, j)

has a positive lower boimd

l^y

then

we

can replace
Xjj,

Xy.

by

Xjj+

l^-

in the

problem formulation. As measured by the new


0.

variable

the flow

on arc

(i, j)

will

have a lower bound of

This transformation has a

46
simple network interpretation;

we

begin by sending

/j;

units of flow on the arc

and then

measure incremental flow above


b(i)

/jj.

b(j)

b(i)-/ij

b(i)

'Cij,Ujj)

CD
Figure
T2.

<D
2.4.

^
a positive
(i, j)

(Cij'Uij-V

CD
lower bound to zero.
Uj:,

<D
then

Transforming
If

{Removing

Capacities).

an arc

has a positive capacity

we

can remove

the capacity,
constraint
(i,

making the
j)

arc uncapacitated, using the following ideas.


x^:

The capacity
Sj;

can be written as
-1,

Sj;

Ujj, if

we

introduce a slack variable

>

0.

Multiplying both sides by

we

obtain

-Xjj - Sjj

-Ujj

(2.2)

This transformation

is

tantamount

to

turning the slack variable into an


for that node.
Sj:

additional node k with equation (2.2) as the

mass balance constraint

Observe

that the variable

xj;

now

appears in three mass balance constraints and


j,

in

only one. By subtracting

(2.2)

from the mass balance constraint of node

we

assure that

each of

Xj;

and

Sj;

appear

in exactly

two constraints-in one with the

positive sign

and

in

the other with the negative sign.

These algebraic manipulations correspond

to the

following

network transformation.

b(i)
(Cjj
,

b(j)

b(i)

-Uij
(Cjj
,

b(j)
oo)

Uij
(0,oo)

Ujj)

<T)
Xjj

<^
Figure
2.5.

O
Removing

^<
t I

Xjj,

X- j

X^j

Sjj

arc capacities.

In the

network context,

this

transformation implies the follov^dng.

If x^; is

a flow

on arc
is X.
V.

(i, j)

in the original
Xjj^

network, the corresponding flow in the transformed network


both the flows x and
x'

=
ik

Xjj

and

Uj;

- Xj:;

have the same


Xj:

cost.

Likewise, a flow

^k'

"

^" *^^

transformed network yields a flow of

Xjj^

of the

same

cost in the

47
original network.
x^j

Further, since
this

x^j^

Xjj^

u^;

and
is

x^j^.

and

x:j^

are both nonnegative,

x^<

Ujj.

Consequently,
Uj;

transformation

valid.

T3. (Arc Reversal). Let


arc flow
Ujj
if it is

represent the capacity of the arc


is

(i, j)

or an upper
in variable:

bound on the
replace
x^;

uncapacitated. This transformation

change
(i, j)

by
Cj:

X in the problem formulation.


(j,

Doing so replaces arc

with

its

associated cost

by the arc

i)

v^ath a cost

-Cj;.

Therefore, this transformation permits us to

remove

arcs

with negative

costs.

This transformation has the following network interpretation:


(i, j)

send

Ujj units of

flow on the arc and then replace arc

by arc

(j,

i)

vdth cost

-Cj;.

The

new flow

measures the amount of flow

we "remove" from

the "full capacity" flow of

b(i)

b(j)

b(i)-Ujj

b(i)

Ujj

CD

<D
Figure
2.6.

An example
arc (k,
i')

0<
of arc reversal.

two nodes
capacity,
(i, i')
i

T4.

(Node

Splitting).

This transformation splits each node


(k,
i)

into

and

i'

and

replaces each original arc


(i, j)

by an
cost

of the

same

cost

and

and each arc

by an arc
i.

(i', j)

of the

same

and

capacity.

We also

add

arcs

of cost zero for

each

Figure 2.7 illustrates the resulting network


all

when we

carry out the

node

splitting

transformation for

the nodes of a network.

48

(a)

(b)

Figure

2.7.

(a)

The

original network, (b)

The transformed network.

We
to

shall see the usefulness of this transformation in Section 5.11

when we use

it

reduce a shortest path problem with arbitrary arc lengths to an assignment problem.
is

This transformation

also

used

in practice for representing

node

activities

and node

data in the standard "arc flow" form of the network flow problem:
the cost or capacity for the throughput of

we

simply associate
arc
(i, i').

node

with the

new throughput

49
3.

SHORTEST PATHS
Shortest path problems are the most fundamental

and also the most commonly

encountered problems
shortest path

in the

study of transportation and communication networks. The

problem

arises

when

trying to determine the shortest, cheapest, or most


pairs of

rebable path between one or

many

nodes

in a network.

More

importantly,

algorithms for a wide variety of combinatorial optimization problems such as vehicle


routing and network design often
call for the solution of a large

number

of shortest path

problems as subroutines. Consequently, designing amd testing


shortest path

efficient

algorithms for the

problem has been a major area of research

in

network optimization.

Researchers have studied several different (directed) shortest path models.

The
(i)

major types of shortest path problems,

in increasing
all

order of solution difficulty, are

finding shortest paths from one node to

other nodes
all

when

arc lengths are

nonnegative;

(ii)

finding shortest paths from one node to


(iii)

other nodes for networks

with arbitrary arc lengths;


node; and
(iv)

finding

shortest paths from every

node

to every other
(e.g.,

finding various types of constrained shortest paths between nodes

shortest paths with turn penalties, shortest paths visiting specified nodes, the k-th
shortest path).

In this section,

we

discuss problem types


(i)

(i),

(ii)

and

(iii).

The algorithmic

approaches for solving problem types


setting

and

(ii)

Cem be classified into two groupslabel


to

and

label correcting.

The

label setting

methods are applicable

networks with

nonnegative arc lengths, whereas label correcting methods apply to networks with
negative arc lengths as well. Each approach assigns tentative distance labels (shortest

path distances) to nodes at each step. Label setting methods designate one or more labels
as permanent (optimum) at each iteration. Label correcting methods consider as temporary until the final step
label setting
all labels

when

they

all

become f>ermanent.

We

will

show

that

methods have the most

attractive worst-case performance; nevertheless,

practical experience has


efficient

shown
is

the label correcting methods to be modestly

more

Dijkstra's algorithm
first

the most popular label setting method. In this section,

we

discuss a simple implementation of this algorithm that achieves a time

bound of

0(n2).

We

then describe two more sophisticated implementations that achieve


in practice

improved running times

emd

in theory.

Next,

we

consider a generic version

of the label correcting method, outlining one special implementation of this general

approach that runs

in

polynomial time and another implementation that perfomns very

50
well in practice.
Finally,

we

discuss a

method

to solve the all pairs shortest path

problem.
Dijkstra's Algorithm

3.1

We consider a
(i, j)

network

G=

(N,A) with an arc length

Cj;

aissodated with each arc


i

e A. Let A(i) represent the set of arcs emanating from node


{

N,

and

let

max

Cjj

(i, j)

}.

In this section,

we assume
amd

that

aire

lengths are integer numbers, and

in this section as well as in Sections 3.2

3.3,

we

further

assume

that arc lengths are

nonnegative.

We

suppose

that

node

s is a specially

designated node, and assume

without any loss of generality that the network


other node.

contains a directed path from s to every


artificial arc (s,
j),

We

can ensure this condition by adding an

with a suitably

large arc length, for each


this section.

node

j.

We

invoke

this connectivity

assumption throughout

Dijkstra's algorithm finds shortest paths

from the source node


from node
s

s to all

other

nodes. The basic idea of the algorithm


of their distances from
s.

is

to fan out

and

label

nodes
is

in order

Each node

has a label, denoted by

d(i):

the label
i;

permanent
it

once

we know

that

it

represents the shortest distance from s to


give node
if (s, j)

otherwise

is

temporary.

Initially,

we

s a

permanent
>

label of zero,

and each other node

temporary

label equal to Cgj

A, and

otherwise. At each iteration, the label of a

node
are

is its

shortest distance

from the source node along a path whose internal nodes


selects a

all

permanently labeled. The algorithm


label,

node

with the

minimum
labels

temporary

makes

it

permanent, and scans

au-cs in A(i) to
it

update the distamce


all

of adjacent nodes.

The algorithm terminates when

has designated
relies

nodes as

permanently labeled. The correctness of the algorithm

on the key observation

we prove later) that it is always possible to minimum temporary label as permanent. The following
(which
basic implementation of Dijkstra's algorithm.

designate the node vdth the


algorithmic representation
is

51

algorithm DIJKSTRA;
begin

P:=(s); T: = N-{s);
d(s)
d(j)
: :

= =

and pred(s) =
:

0;

Cgj

and

pred(j)

if

(s,j)

and

d(j)

otherwise;

while P *
begin

do

(node selection)

let

T be

node
T:

for

which

d(i)

= min

{d(j)

T);

P: = Pu(i);
{distance update) for each
if
(i,j)

= T-{i};

A(i)

do
then
d(j)
:

d(j)

>

d(i)

Cjj

d(i)

Cjj

and

pred(j)

i;

end; end;

The algorithm
i

associates a predecessor index, denoted


to

by

pred(i),

with each node

N.

The algorithm updates these indices


(tentative) shortest path

ensure that
s to

pred(i) is the last

node

prior to

on the

from node

node

i.

At termination, these indices

allow us to trace back along a shortest path from each node to the source.

To

establish the validity of Dijkstra's algorithm,


in the algorithm, the

we

use an inductive argument.


sets,

At each point

nodes are partitioned into two

P and

T.

Assume

that the label of each

node
j

in

is

the length of a shortest path from the source, whereas

the label of each

node

in

is
j)

the length of a shortest path subject to the restriction that

each node in the path (except

belongs to

P.

Then

it

is

possible to transfer the

node

in

T
to

with the smallest label

d(i) to

for the following reason:


that
is

any path P from the source

node

must contain

a first

node k
i

in T.

However, node k must be


is at
i

at least as far

away from

the source as

node

since

its

label

least that of

node

i;

furthermore, the

segment of the path P between node k and node

has a nonnegative length because arc

lengths are nonnegative. This observation shows that the length of path

is at least d(i)

and hence
labeled
i

it is

valid to permanently label

node

i.

After the algorithm has permanently


in

node

i,

the temporary labels of

some nodes
>

T+
Cj:

(i)

might decrease, because

node could become an internal node in the must thus scan all of the arcs (i, j) in A(i); if
updates the labels of nodes in T (i).

tentative shortest paths to these nodes.


d(j)

We
+
Cj;

d(i)

then setting

d(j)

d(i)

The computational time


its

for this algorithm can

be

split into

the time required by

two

basic operatior\s--selecting nodes

and ujjdating
i

distances. In an iteration, the

algorithm requires 0(n) time to identify the node

with

minimum temporary

label

and

52
takes 0( A(i)
I
I

))

time to update the distance labels of adjacent nodes. Thus, overall, the

algorithm requires Oirr-) time for selecting nodes and CX

^
ie

A(i)
|

= 0(m)

time for

N
thus runs in O(n^)

updating distances. This implementation


time.

of Dijkstra's algorithm

Dijkstra's algorithm has

been a subject of much research.

Researchers have

attempted

to

reduce the node selection time without substantially increasing the time for

updating distances. Consequently, they have, using clever data structures, suggested
several

implementations of the algorithm.

These implementations have either


its

dramatically reduced the running time of the algorithm in practice or improved

worst case complexity. In the following discussion,


is

we

describe Oial's algorithm, which

currently comparable to the best label setting algorithm in practice.

Subsequently
the best

we
(A
all

describe an implementation using

R-heaps, which

is

nearly

known
most

implementation of Dijkstra's algorithm from the perspective of worst-case analysis.

more complex version

of R-heaps gives the best worst-case performance for

choices of the parameters n, m, and C.)

3^

Dial's

Implementation
in Dijkstra's

The bottleneck operation


the algorithm's performance,
all

algorithm

is

node

selection.

To improve

we must

ask the following question.

Instead of scanning

temporarily labeled nodes at each iteration to find the one with the

minimum
in a sorted

distance label, can

we reduce
in practice,

the computation time

by maintaining distances

fashion?

Ehal's algorithm tries to

accomplish this objective, and reduces the algorithm's


fact:

computation time

using the foUouing


that

FACT

3.1. The distance nondecreasing.

labels

Dijkstra's algorithm designates as permanent are

This fact follows from the observation that the algorithm permanently labels a

node

with

smallest temporary label

d(i),

and while scanning arcs

in A(i)

during the

distance update step, never decreases the distance label of any permanently labeled node
since arc lengths are nonnegative.
selection.

FACT

3.1

suggests the following scheme for node


0, 1, 2,
...
,

We

maintain nC+1 buckets numbered


label
is k.

nC. Bucket k stores each node

whose temporary distance


network and, hence, nC
is

Recall that

represents the largest arc length in the


all

an upper bound on the distance labels of

the nodes. In the


identify the
first

node

selection step,

we

scan the buckets in increasing order until


label of each

we
is

nonempty

bucket.

The distance

node

in this

bucket

minimum. One by

53
one,
arc

we

delete these rodes from the bucket,

making them permanent and scanning

their

lists to

update distance

labels of adjacent nodes.

We

then resume the scanning of

higher numbered buckets in increasing order to select the next nonempty bucket.

By

storing the content of these buckets carefully,

it is

possible to add, delete,

and

select the next

element of any bucket very


constant.

efficiently; in fact, in

0(1) time,

i.e.,
bls

a time

bounded by some
linked
list.

One implemention

uses a data structure knov\T

a doubly

In this data structure,

we

order the content of each bucket arbitrarily, storing


to its

two pointers

for each entry:

one pointer

immediate predecessor and one

to its

immediate successor. Doing so permits


the topmost
relabel

us,

by rearranging the

pointers, to select easily


a node.

node from the

list,

add

bottommost node, or delete


label,

Now,
it

as

we

nodes and decrease any node's temporary distance

we move

from a

higher index bucket to a lower index bucket; this transfer requires 0(1) time.

Consequently, this algorithm runs in


following
fact

0(m

+ nC) time and uses nC+1 buckets. The


of buckets to C+1.

allows us to reduce the


If d(i) is the

number

FACT

3.2.

distance label that the algorithm designates as permanent at the


d(j)

beginning of an iteration, then at the end of that iteration labeled node j in T.

<

d(i)

for each finitely

This fact follows by noting that


(ii)

(i)

d(k) < d(i) for eacl

k e P (by

FACT

3.1),

and

for each finitely labeled

node

in T,

d(j)

= d(k) +
Cj.:

cj^;

for

some k P

(by the property


all finite

of distance updates).

Hence,

d(j)

<

d(i)

<

d(i)

+ C.

In other words,

temporary labels are bracketed from below by


Consequently, C+1 buckets suffice
to store

d(i)

and from above by


finite

d(i)

+ C.

nodes with

temporary distance
in

labels.

We

need not store the nodes with


to a bucket

infinite

temporary distance labels


first

any of the

buckets-we can add them

when

they

receive a finite distance label.

Dial's algorithm uses

C+1 buckets numbered

0, 1, 2,

...

which can be viewed as

arranged

in a circle as in Figure 3.1. This


d(j) in

implementation stores a temporarily labeled

node

with distance label

the bucket d(j)

mod

(C+1).

Consequently, during the

entire execution of the algorithm, bucket


labels k, k+(C+l), k+2(C+l),

k stores temporary labeled nodes with distance


however, because of

and so

forth;

FACT

3.2, at

any point

in

time this bucket


also implies that

vvill
if

hold only nodes with the same distance labels. This storage scheme

bucket k contains a node with


...
,

minimum

distance label, then buckets

k+1, k+2,

...

C,

0, 1, 2,

k-1, store

nodes

in increeising values of the distance labels.

54

k-l
Figure
3.1.

Bucket arrangement in Dial's algorithm

Dial's algorithm

examines the buckets sequentially, in


bucket. In the next iteration,
left off earlier.
it

wrap around

fashion, to

identify the first

nonempty
where
it

reexamines the buckets

starting at the place

potential disadvantage of this scheme, as

compared

to the original algorithm, is that

C may

be very large, necessitating large

storage and increased computational time. In addition, the algorithm


as

may wrap around

many

as n-1 times, resulting in a large computation time.

The algorithm, however,

typically does not encounter these difficulties in practice. For

most applications,
is

is

not
n.

very large, and the number of passes through


Dial's algorithm,

all

of the buckets

much

less

than

however,
is

is

rot attractive theoretically. The


Rather,
in
it

algorithm runs in
is

0(m

+ nC) time which


if

not even polynomial time.

pseudopolynomial
if

time. For example,

= n', then the algorithm runs

O(n^) time, and

= 2" the

algorithm takes exponential time in the worst case.

The search
heis

for the theoretically fastest

implementations of Dijkstra's algorithm


In the

led researchers to develop several

new

data structures for sparse networks.

next section,

we
is

consider an implementation using a data structure called a


runs in

redistributive heap (R-heap) that

0(m +

n log nC) time.


the previous

The discussion
sections

of this

implementation
can skip
it

of a

more advanced nature than

and the reader

without any loss of continuity.

3.3.

R-Heap Implementation

Our

first

O(n^) implementation of Dijkstra's algorithm and then Dial's

implementation represent two extremes.

The

first

implementation considers

all

the

55
temporarily labeled nodes together
(in

one large bucket, so to speak) and searches

for a

node with

the smallest label.

Dial's algorithm separates

nodes by storing any two nodes

with different labels

in different buckets.

Could we improve upon these methods by


all,

adopting an intermediate approach, perhaps by storing many, but not


bucket?

labels in a

For example, instead of storing only nodes with a temporary label of k in the

k-th bucket,
different

we

could store temporary labels from 100k to lOOk+99 in bucket


that can be stored in a bucket
is

k.

The

temporary labels

make up

the range of the bucket;

the cardinality of the range

called its width.


its

For the preceding example, the range of

bucket k

is

[100k

..

lOOk+99] and

width

is

TOO.

Using widths of
factor of k.

size

k permits us

to

reduce the number of buckets needed by a


label,
if

But in order to find the smallest distance

we need
is

to search all of the

elements in the smallest index nonempty bucket. Indeed,

arbitrarily large,

we need
original

only

one bucket, and the resulting algorithm reduces

to

Dijkstra's

implementation.

Using a width of

TOO, say, for each bucket reduces the

number

of buckets, but

still

requires us to search through the lowest

numbered bucket

to find the

node with

minimum temporary
one
for the lowest

label.

If

we

could devise a variable width scheme, with a width of

numbered

bucket,

we

could conceivably retain the advantages of bo.h

the wide bucket and narrow bucket approaches.

The R-heap algorithm we consider next


In the version of
16,
...
,

uses variable length widths and changes the ranges dynamically.


redistributive heaps that
that the

we

present, the widths of the buckets are


is

1, 1, 2, 4, 8,

so

number

of buckets

needed
in

only

Odog

nC).

Moreover,
reallocate

we

dynamically modify

the ranges of

numbers stored

each bucket and

we

nodes with temporary

distance labels in a
is 1.

way

that stores the

minimum

distance label in a bucket

whose width

In this way, as in the previous algorithm,


to find the
is

we

avoid the need

to search the entire

bucket

minimum.

In fact, the

running time of

this version of the

R-heap

algorithm

0(m

+ n log nC).

We now
Flog

describe an R-heap in
1

more

detail.

For a given shortest path problem,


0, 1, 2,
...
,

the R-heap consists of

+ flog nCl buckets. The buckets are numbered as


is

nCl We
do not

represent the range of bucket k by range(k) which

a (possibly empty)
if

closed interval of integers.

We store a
will
it

temporary node

in

bucket k

d(i)

e range(k).
set

We

store

permanent nodes.

The nodes

in bucket

k are denoted by the

CONTENT(k). The algorithm


each time
it

change the ranges of the buckets dynamically, and


nodes
in the buckets.

changes the ranges,

redistributes the

56
Initially, the

buckets have the following ranges:

rarge(0) =

[0];
[1];
..

ranged) =

range(2) = [2

3);

rangeO) =

[4

..

7];

range(4) = [8

..

15];

range(K) = [2^-1

..

2^-1].

These ranges

will

change dynamically; however, the widths of the buckets


initial

will

not increase beyond their


distance label
is

widths.
in the

Suppose
range
[8
..

for
15].

example

that the initial

minimum
quickly

determined to be

We

could verify this


is

fact

by verifying

that buckets

through 3 are empty and bucket 4

nonempty. At
all

this point,

we
4.

could not identify the

minimum
is
..

distance label without searching

nodes

in

bucket
is

The following observation

helpful.

Since the
that

minimum

index nonempty bucket


label

the bucket
less

whose range

is [8

15],

we know

no temporary

v^l ever again be

than

8,

and hence buckets

to 3 v^ll

never be needed again.

Rather than leaving


is 8) to
..

these buckets idle,

we

can redistribute the range of bucket 4 (whose width


is 8)

the

previous buckets (whose combined width


[12.. 15].

resulting in the ranges


0,

[8], [9],

[10

11],

and

We

then set the range of bucket 4 to

and we
(0, 1, 2,

shift (or redistribute) its

temporarily labeled nodes into the appropriate buckets

and

3).

Thus, each of the

elements of bucket 4 moves to a lower indexed bucket.


Essentially,

we have

replaced the node selection step

(i.e.,

finding a node with

smallest temporary distance label) by a sequence of redistribution steps in which

we

shift
is

nodes constantly

to

lower indexed buckets. Roughly speaking, the redistribution time

0(n

log nC) time in total, since each

node can be

shifted at

most

+ flog nCl times.

Eventually, the

minimum temporary
it

label is in a bucket with

width one, and the

algorithm selects

in

an additional 0(1) time.


carry out these operations a bit differently.
it

Actually,

we would

Since

we

will

be

scanning
find the

all

of the elements of bucket 4 in the redistribute step,


label in the bucket.

makes sense
example
15],

to first

minimum temporary
label
is 11.

Suppose

for
..

that the

minimum

Then rather than


..

redistributing the range [8

we need

only
to 4

redistribute the subrange [11

15].

In this case the resulting ranges of buckets

57

would be [n],

[12], (13

..

14], [15], e.

Moreover,

at the

end of

this redistribution,

we
is 1.

are

guaranteed that the

minimum temporary

label is stored in bucket 0,

whose width

To

reiterate,

we do
is

not carry out the actual node selection step until the
If

minimum nonempty
bucket
k,

bucket has width one.


greater than
1,

the

minimum nonempty
to buckets

bucket

is

whose width

we

redistribute the range of bucket

k into buckets
to k-1.

to k-1,

and then we reassign the content of bucket k


time
is

The
is

redistribution

0(n log nC) and the running time

of

the

algorithm

0(m

+ n log nC).

We now
the figure, the

illustrate

R-heaps on the shortest path example given in Figure


arc indicates
its

3.2.

In

number beside each

length.

source

Figure 3.2

The

shortest path example.

For

this

problem, C=20 and

= flog 1201 =

7.

Figure 3.3 specifies the starting

solution of Dijkstra's algorithm and the initial R-heap.

Nodei:
Label
d(i):

12
13
[0]
[1]

4
15

20
4
[8 ..15]

nC=120
5
[16. .31]
{5}

Buckets:

12
[2 ..3]
(3)

3
[4 ..7]

6
[32 ..63]
[64
..

7
127]

Ranges:

CONTENT:

(2,4)

(6)

Figure 3.3

The

initial

R-heap.

To

select the

node with the smallest distance

label,

we

scan the buckets


is

0,

1,2,

...

to find the first

nonempty bucket.

In our example, bucket

nonempty. Since bucket


label. So, the

has width

1,

every node in this bucket has the same (minimum) distance

58
algorithm designates node 3 as permanent, deletes node 3 from the R-heap, and scans
the arc (3,5) to change the distance label of

node

from 20

to 9.
its

We

check whether the


is

new

distance label of node 5


5. It isn't.

is

contained in the range of

present bucket, which

bucket

Since

its

distance label has decreased, node 5 should


left,

move
bucket

to a lower
5, to

index bucket. So
identify the
first

we

sequentially scan the buckets from right to


9,

starting at bucket
is 4.

bucket whose range contains the number


5 to bucket
4.

which

Node

moves from bucket

Figure 3.4 shows the

new

R-heap.

Node

i:

59

CONTENT(O) =

(5),

CONTENTO)

0,

CONTENT(2) =

e,
{2.
.

CONTENTO) =
CONTENT(4) =

4),

0.

This redistribution necessarily empties


smallest distance label to bucket
0.

bucket 4

and moves the node with the

We

are

now
then

in a position to outline the general


j

algorithm and analyze


If

its

complexity. Suppose that


d(j) range(k),

CONTENT(k) and

that d(j) decreases.

the modified

we

sequentially scan lower

numbered buckets from

right to left

and

add

the

node

to the appropriate bucket.

Overall, this operation takes

The term

reflects the

number
it

of distance ujxlates,
to a

and the term

0(m + nK) time. nK arises because


the total

every time a node moves,


buckets, a

moves
most

lower indexed bucket; since there are K+1


Therefore, O(nK)
is

node can move

at

times.

bound on

node movements.
Next we consider the node
buckets from
left

selection step.

Node

selection begins

by scanning the
k.

to right to identify the first

nonempty bucket, say bucket


total. If
If

This

operation takes 0(K) time per iteration and O(nK) time in

k=0 or k=l, then any


then

node

in the selected

bucket has the

minimum

distance label.
0, 1,
...
,

k ^

2,

we
its

redistribute

the "useful" range of bucket k into the buckets


those buckets.
the bucket
is

k-1

and

reinsert

content to

If

the range of bucket k

is [/

..

u]

and the smallest distance


is Idjj^jp
..

label of a

node

in

djj^j^,

then the useful range of the bucket

u].

The algorithm
the
first

redistributes the useful range in the following manner:


1,

we

assign
2,

integer to bucket 0, the next integer to bucket


3,

the next two integers to bucket


htis

the next four integers to bucket

and so

on.

Since bucket k
1, 1, 2,
... ,

width <

2"^

and since the


width of

widths of the
2*^,

first

buckets can be as large as

2*^'^ for a total potential


0, 1,
...

we

can redistribute the useful range of bucket k over the buckets

k-1 in the

manner

described. This redistribution of ranges and the subsequent reinsertions of


labels to bucket

nodes empties bucket k and moves the nodes with the smallest distance
0.

Whenever we examine
it

node

in the

nonempty bucket k with the


at

smallest index,
all

we

move
can
time.

to a

lower indexed bucket; each node can move

most

times, so

the nodes
total

move

a total of at most

nK

times. Thus, the

node

selection steps take

O(nK)

Since

= [log nC"L the algorithm runs in

0(m

+ n log nC) time.

We now

summarize our discussion.

60

Theorem

3.1.

path problem in

0(m

The R-heap implementation + n log nC) time.

of Dijkstra's algorithm

solves the shortest

This algorithm requires

+ flog nCl buckets.

FACT

3.2 permits

us to reduce the

number

of buckets to

+ flog

CT

This refined implementation of the algorithm runs in


1.2),

0(m
this

+ n log C) time. For probelm that satisfy the similarity assumption (see Section

bound becomes 0(m+ n


it

log n). Using substantially

more

sophisticated data
),

structures,

is

possible to reduce this


all

bound

further to

0(m

+ n Vlog n

which

is a linear

time algorithm for

but the sparsest classes of shortest path problems.

3.4.

Label Correcting Algorithms


Label correcting algorithms, as the

name

implies, maintain tentative distance

labels for

nodes and correct the


all

labels at every iteration.

Unlike label setting algorithms,

these algorithms maintain

distance labels as temporary until the end,

when

they

all

become permanent simultaneously.

The

label correcting algorithms are conceptually

more general than

the label setting algorithms

and are applicable

to

more general To produce

situations, for example, to

networks containing negative length

arcs.

shortest paths, these algorithms typically require that the

network does not contain any

negative directed cycle,

i.e.,

a directed cycle

whose

arc lengths

sum

to a negative value.

Most

label correcting algorithms

have the capability

to detect the presence of negative

cycles.

Label correcting algorithms can be viewed as a procedure for solving the


following recursive equations:

d(s)
d(j)

0,

(3.1) (d(i)

= min

Cjj

N), for each

{s}.

(3.2)

As
j.

usual, d(j) denotes the length of a shortest path from the source

node

to

node

These equations are knov^m as Bellman's equations and represent necessary conditions
These conditions are also
sufficient
if

for optimality of the shortest path problem.

every

cycle in the network has a positive length.

We

will

prove an alternate version of these


label correcting algorithms.

conditions which

is

more

suitable

from the viewpoint of


be a set of labels.

Theorem
source

3.2

Let d(i) for

If d(s)

and

if in

addition the labels

satisfy the following

conditions,

then

they represent

the shortest

path lengths from the

node:

61
C3.1.
d(i)
d(j)
is

the length of
d(i)

some path from


(i,

the source node to node

i;

and

C32.

<

Cjj

for all

j)

e A.

Proof.

Since d(i)

is

the length of

some path from

the source to

node

i,

it

is

an upper

bound on

the shortest path length.

We show

that

if

the labels d(i) satisfy C3.2, then they

are also lower

bounds on the
-

shortest path lengths,

which implies the conclusion

of the

theorem.

Consider any directed path


i-j

P from

the source to

node

j.

Let

consist of
Ciii2/

nodes

i2

i3

'k

= <

Condition C3.2 implies that d(i2) ^ d(i^) + Ci^i2 = +


Cij^-iijc

d{i3) < d(i2) + Ci2i3'

d(ij^)

d(ij^.-j)

Adding

these inequalities yields d(j) =

d(ij^)

<

V
(i,j)

Cj;

Therefore

d(j)

is

a lower

bound on

the length of any directed path from

P
node
j,

the source to

including a shortest path from s to

j.

We
d(i) satisfy

note that

if

the network contains a negative cycle then


that the

no

set of labels d(i)

satisfies C3.2.

Suppose
C3.2.

network did contain a negative cycle


d(i)

W and some labels


(i,j)

Consequently,

d(j)

+ =

Cj:

for each

W. These

inequalities imply that


(i,j)

V
e

(d(i)

d(j)

Cjj)

T!,
(i,j)

^ii

^'

since the labels d(i) cancel

W
W
is

out in the summation.


cycle.

This conclusion contradicts our assumption that

a negative

Conditions C3.1 in Theorem 3.2 correspond to primal

feeisibility for

the linear

programming formulation
dual
feasibility.

of the shortest path problem.

Conditions C3.2 correspond to


label correcting algorithms as

From

this perspective,

we might view
and

methods

that

always maintain primal

feasibility

try to achieve dual feasibility.


first is

The

generic label correcting algorithm that

we

consider

a general procedure for

successively updating distance labels d(i) until they satisfy the conditions C3.2.

At any

point in the algorithm, the label d(i)

is

either indicating that


it is

we have

yet to discover

any path from the source

to

node

j,

or

the length of

some path from

the source to

node
d(j)

j.

The algorithm
+
Cjj,

>

d(i)

based upon the simple observation that whenever the current path from the source to node i, of length d(i), together with
is

the arc

(i,j)

is

a shorter path to

node

than the current path of length

d(j).

62
algorithm
begin
d(s)
d(j)
: :

LABEL CORRECTING;
=

and pred(s) =
:

0;

oo for

each

N - (s);
satisfies d(j)

while some arc


begin
d(j)
:

(i,j)

>

d(i)

Cj;

do

d(i)

Cjj;

pred(j)

i;

end;
end;

The correctness

of the label correcting algorithm follows


Cj;

from Theorem

3.2.

At

termination, the labels d(i) satisfy d(j) < d(i) +


the shortest path lengths.

for all

(i, j)

e A,
is

and hence represent


finite if there are

We now

note that this algorithm


Since
d(j) is

no

negative cost cycles and

if

the data are integral.


d(j) at

bounded from above by nC


all

and below by -nC, the algorithm updates


integral, the

most 2nC times. Thus when

data are
in

number

of distance updates is O(n^C),

and hence the algorithm runs

pseudopolynomial time.

A
arcs that

nice feature of this label correcting algorithm

is its flexibility:

we

can select the


finite

do not

satisfy

conditions C3.2 in any order and


of the

still

assure the

convergence.
restriction

One drawback
Indeed,

method, however,

is

that without a further

on the choice of

arcs, the label correcting


if

algorithm does not necessarily run

in

polynomial time.

we

start

with pathological instances of the problem and

make

a poor choice of arcs at every iteration, then the


n.

number

of steps can

grow

exponentially with

(Since the algorithm


of C.)

is

pseudopolynomial time, these instances


a polynomial time

do have exponentially large values


algorithm,

To obtain

bound

for the

we

can organize the computations carefully in the following manner.


in

Arrange the arcs

in

some

(possibly arbitrary) order.

Now make
d(j)

passes through A.

In each pass, scan arcs in


satisfies this condition,

in

order and check the condition


d(j)

>

d(i)

Cj:;

if

the arc
if

then update

d(i)

Cj:.

Terminate the algorithm


algorithm the modified

no

distance label changes during an entire pass.


correcting algorithm.

We

call this

label

Theorem
label

3.3

correcting algorithm

Wher: applied to a network containing no negative cycles, the modified requires 0(nm) time to determine shortest paths from the

source to every other node.

Proof.

We show

that the algorithm performs at

most n-1 passes through the arc

list.

Since each pass requires

0(1) computations for each arc, this conclusion imphes the

63

0(nm) bound.

Let

d''(j)

denote the length of the shortest path from the source


let D'^(j)

to
j

node

consisting of r or fewer arcs. Further,

represent the distance label of node


D''(j)

after r
,

passes through the arc


for

list.

We

claim, inductively, that

<
r.

d''(j)

for each

and

each

r
j

1,

...

n-1.

We perform

induction on the value of

Suppose

D^*^(j) < d''"Uj)


I^Cj)

for each

N.

The provisions
{

of the modified labeling algorithm

imply that

< min

{ly'^(j),

min
i*j

D''"^(i)

Cj; )).

Next note

that the shortest path to

node

containing no

more than
case
(i),

r arcs

either

(i)

has no more than r-1 arcs, or


in case
(ii),

(ii) it

contains exactly

r arcs.

In
dJi])

d^'Q)

d''"^(j),

and

d^(j)

min
i*j

{d''"^(i)

c^:].

Consequently,

min

(d''"^(j),

min

{d^"''(i)

Cj;))

> min {D^" "()),

min

(D''"''(i)

Cj;));

the inequality fol3o\*^

from the induction hypothesis.

Hence,

D^'Cj)

<

d'^(j)

for all

e N.

Finally,

we

note that
Therefore,

the shortest path from the source to any


after at

node

consists of at

most n-1

arcs.

most n-1 passes, the algorithm terminates v^th the shortest path

lengths.

The modified

label correcting algorithm is also capable of detecting the presence


If

of negative cycles in the network.

the algorithm does not update any distance label


it

during an entire pass, up to the (n-l)-th pass, then

has a set of labels

d(j) satisfying C3-2.

In this case, the algorithm terminates with the shortest path distances

and the network

does not contain any negative


distance labels in
all

cycle.

the n-1 passes,


in the n-th pass,

On the other hand, when we make one more pass.


more nodes
in

the algorithm modifies


If

the distance label of


(a

some node

changes

then the network contains a directed walk

path
i

together with a cycle that have one or

common) from node


all

to

of

length greater than n-1 arcs that has snnaller distance than

paths from the source

node

to

i.

This situation cannot occur ui\less the network contair\s a negative cost

cyde

Practical

Improvements
stated so far, the modified label correcting algorithm considers every arc of the
list.

As

network during every pass through the arc


arcs in the arc
list

It
aill

need not do

so.

Suppose we order the

by

their tail

nodes so that

arcs with the

same

tail

node appear
i

consecutively on the

list.

Thus, while scanning the arcs,

we

consider one node

at a

time, scanning arcs in A(i)

and

testing the optimality conditions.


list,

Now

suppose that

during one pass through the arc

the algorithm does not change the distance label of a


d(j)

node

i.

Then, during the next pass

d(i)

Cj;

for every

(i, j)

6 A(i)

and the

64
algorithm need not
maintain a
It

test these conditions.

To achieve

this savings, the


it

algorithm can

list

of

nodes whose distance

labels

have changed since


it

last

examined them.

scans this
list

list

in the first-in, first-out order to assure that

performs passes through


is

the arc

and, consequently, terminates in 0(nm) time. The following procedure


this further m.odification of the

a formal description of

modified label correcting

method.
algorithm
begin
d(s)
d(j)
:

MODIFIED LABEL CORRECTING;


=
=
:

and pred(s) =
:

0;
(s);

>

for each

N-

LIST =

(s);

while LIST*
begin

do

select the first

element

of LIST;

delete

from LIST;
(i, j)

for each

e A(i)

do
+
Cjj

if d(j)

>

d(i)

then

begin
d(j)
:

d(i)

C|j

pred(j)
if
j

i;

LIST then

add

to the

end of LIST;

end; end;
end;

Another modification of

this

algorithm sacrifices
its

its

polynomial time behavior

in

the worst case, but greatly improves

running time

in practice.

The modification
i

alters

the

manner
check

in

which the algorithm adds nodes


whether the
it

to LIST.

While adding a node


If

to LIST,
i

we

to see

has already appeeired in the LIST.

yes, then

we add

to

the beginning of LIST, otherwise

we add
If

it

to the end of LIST.


i

This heuristic rule has the

follovdng plausible justification.

the

node

has previously appeared on the LIST, then

some nodes may have

as a predecessor.

It is

advantageous

to

update the distances

for

these nodes immediately, rather than update

them from other nodes and then update

them again when we consider node


alone, the algorithm
is

i.

Empirical studies indicate that with this change

several times faster for

many

reasonable problem classes.


practice, the worst-case

Though

this

change makes the algorithm very attractive in

65

running time of the algorithm


algorithm source to
is

is

exponential.

Indeed, this version of the label correcting

the fastest algorithm in practice for finding the shortest path from a single

all

nodes

in

non-dense networks.

(For the problem of finding a shortest path

from
are

a single source

node

to a single sink, certain variants of the label setting

algorithm

more

efficient in practice.)

3.5.

All Pairs Shortest Path Algorithm

In certain applications of the shortest path problem,

we need we

to

determine

shortest path distances

between

all

pairs of nodes.
first

In this section
is

describe two
It

algorithms to solve this problem. The

algorithm

well suited for sparse graphs.

combines the modified


algorithm
is

label correcting algorithm

and

Dijkstra's algorithm.

The second

better suited for

dense graphs.

It is

based on dynamic programming.

If

the network has nonnegative arc lengths, then

we

can solve the

all

pairs

shortest path as the source

problem by applying

Dijkstra's algorithm

n times, cor\sidering each node

node

once.

If

the network contains arcs with negative arc lengths, then

we

can fist transform the network to one with nonnegative arc lengths as follows
a

Let s be

node from which

all

nodes

in the

network are reachable,

i.e.,

connected by directed

paths.

We

use the modified label correcting algorithm to compute shortest path


to all other nodes.

distances from s

The algorithm
Cu =
(i, j)

either terminates with the shortest In the former case,


for each
(i, j)

path distances
define the

d(j) or indicates

the presence of a negative cycle.


(i,

we
P

new

length of the arc


Cj;

j)

as

Cj;

d(i)

d(j)

e A.

Condition C3.2 implies that

for all

A.

Further, note that for any path

from node k

to

node

X
(i,j)P

^ii

^ii

"*"

^^^^ ~

'^^'^

since the intermediate

(i,j)eP

labels d(j) cancel out in the


all

summation. This transformation thus changes the length of

paths between a pair of nodes by a constant amount (depending on the pair) and
Since arc lengths

consequently preserves shortest paths.


transformation,

become nonnegative

after the

we

can apply Dijkstra's algorithm n-1 additional times to determine

shortest path distances

between

all

pairs of

nodes in the transformed network.


/

We

then

obtain the shortest path distance between nodes k and

in the original

network by

adding

d(/)

- d(k) to the corresponding shortest path distance in the transformed

network.

This approach requires

0(nm) time

to solve the first shortest path

problem,

and

if

the network contains no negative cost cycle, the

method

takes an extra

66

0(n

S(n,

m, C) time
is

to

compute

the remaining shortest path distances.

In the expression

S(n,m,C)
lengths.

the time needed to solve a shortest path problem with nonnegative arc

For the R-heap implementations of Dijkstra's algorithm

we

considered

previously, S(n,m,C) =

m+
to

n log nC.
solve the
all

Another way

pairs shortest path


is

problem

is

by dynamic
define the

programming. The approach we present


variables d^(i,
j)

known

as Floyd's algorithm.

We

as follows:

d'"(i, j)

"

the length of

a shortest path

from node

to

node
...
,

subject to the
i

condition that the path uses only the nodes


as internal nodes.

1, 2,

r-1 (and

and

j)

Let d(i,

j)

denote the actual shortest path distance. To compute


i

d''"*'^(i, j),

we

first
,

observe that a shortest path from node


either
(i)

to

node
r,

that passes

through the nodes

1, 2,
(ii)

...

does not pass through the node


r,

in

which case
=
d^(i, r)

d'^"''^(i, j)

d''(i, j),

or

does

pass through the node

in

which case

d^'*'^{i,

j)

d^ir,

j).

Thus we have

d^(i,j)

Cjj,

and
d^'+^Ci,
j)

= min
Cj;

(d^'U, jX d^Ci, r)

d^Cr,

j)).

We
over

assume

that

for all

node

pairs

(i,

j)

e A.
r,

It is

possible to solve the


pairs

previous equations recursively for increasing values of

and by varying the node


is

for a fixed value of

r.

The following procedure

a formal description of this

algorithm.

67
algorithm
begin
for
all

ALL PAIRS SHORTEST PATHS;


node
(i, j)

pairs
1

(i, j)

NxN
j)
:

do

d(i,

)).

<
j)
:

and =
i;

pred(i,

j)

0;

for each
for each

A
to

do

d(i,

Cj;

and

pred(i,

n do
(i, j)

for each
.

NxN
d(i, r)

do
+
d(r,
j)

-:

if d(i,

j)

>

then

<

>

begin
d(i,
j)
:

d(i, r) d(i,

+
i)

d(r,

j);

if

and

<

then the network contains a negative

cycle,

STOP;
pred(i,
j)
:

= pred(r,

j);

end; end;

Floyd's algorithm uses predecessor indices, predd,

j),

for each

node pair

(i,

p.

The

index pred(i,

j)

denotes the
j.

last

node prior

to

node

in the tentative shortest path

from
the

node

to

node

The algorithm maintains the property


i

that for each finite d(i,


j).

j),

netw;ork contains a path from node

to

node

of length d(i,

This path can be obtained

by tracing the predecessor

indices.

This algorithm performs n iterations, and in each iteration

it

performs 0(1)

computations for each node

pair.

Consequently,

it

runs in OCn-') time.

The algorithm
for

either terminates vdth the shortest path distances or stops


i.

when
<
0.

d(i,

i)

<

some node

In the latter case, for

some node
from node

r;*i, d(i, r)
i

d(r,

i)

Hence, the union of the


r to

tentative shortest paths

to

node

and from node

node

contains a

negative cycle. This cycle can be obtained by using the predecessor indices.
Floyd's algorithm
jilgorithm.

is

in

many

respects similar to the modified label correcting

This relationship becomes


3.4
If d(i, j) for

more transparent from


x

the followang theorem.

Theorem

(i,

j)

satisfy the following

conditions, then they

represent the shortest path distances:

(i)
(ii)

d(i, i)

for all

i;

d(i, j) is the
d(i, j)

length of some path from node

to node j;

(Hi)

<

d(i, r)

c^: for all

i,

r,

and

j.

Proof. For fixed

i,

this

theorem

is

a consequence of

Theorem

3.2.

68

4.

MAXIMUM FLOWS
An
important characteristic of a network
is its

capacity to carry flow. What, given

capacities

on the

arcs, is the

maximum

flow that can be sent between any two nodes?


tire

The resolution

of this question determines the "best" use of

capacities

and

establishes

a reference point against which to

compare other ways

of using the network.

Moreover,

the solution of the

maximum

flow problem with capacity data chosen judiciously

establishes other performance measures for a network.

For example, what


all

is

the

minimum number
join this pair of

of nodes

whose removal from the network destroys


what
is

paths joining

a particular pair of nodes? Or,

the

maximum number
reliability

of

node

disjoint paths that

nodes? These and similar


its

measures indicate the robustness of

the network to failure of

components.

In this section,

we

discuss several algorithms for computing the

maximum

flow

between two nodes


solving the

in a network.

We begin
The

by introducing

a basic labeling algorithm for

maximum

flow problem.

validity of these algorithms rests

upon

the

celebrated max-flow min-cut theorem of network flows.

This remarkable theorem has a

number

of surprising implications in

machine and vehicle scheduling, communication

systems planning and several other application domains.

We

then consider improved

versions of the basic labeling algorithm with better theoretical performance guarantees.
In particular,

we

describe preflow push algorithms that have recently emerged as the


for solving the

most powerful techniques

maximum

flow problem, both theoretically

and computationally.

We
Uj; for

consider a capacitated network


(i, j)

= GM, A) with a nonnegative


t

integer capacity

any arc

e A.

The source

and sink
(i, j)

are
(j,

two distinguished nodes


also in A.

of the
loss of

network.

We

assume

that for every arc

in A,

i) is

There

is

no

generality in

making

this

assumption since
all

we

allow zero capacity arcs.

We also
we
can

assume
set the

without any loss of generality that

arc capacities are finite (since

capacity of any uncapacitated arc equal to the

sum

of the capacities of
list

all

capacitated arcs).
{(i,

Let

U = max

(u^;

(i, j)

A).

As

earlier, the arc

adjacency
i.

defined as A(i) =

k)

(i,

k)

A) designates the arcs emanating from node

In the

maximum

flow problem,
t

we

wish

to find the

maximum

flow from the source node


is

s to the

sink node

that satisfies

the arc capacities. Formally, the problem

to

69

Maximize v
subject to
V, ifi
0,

(4.1a)

s,

y
{j
:

Xjj

{)
:

y
(j, i)

Xjj

\
^

ifi*s,t,foraUiG N,

(4.1b)

(i, j)

A)

A)
e A.

"V'

>

^'

<

Xj:

<

Ujj

for each

(i, j)

(4.1c)

It

is

possible to relax the integrality assumption on arc capacities for


is

some

algorithms, though this assumption

necessary for others.

Algorithms whose

complexity bounds involve

assume

integrality of data.

Note, however, that rational

arc capacities can always be transformed to integer arc capacities

by appropriately scaling

the data.

Thus, the integrality assumption


of residual network

is

not a restrictive assumption in practice.

The concept
flow
x,

is

crucial to the algorithms


(i, j)

we

consider.

Given a

the residual

capacity,

rj;

of

any arc
i

e
j

represents the
(i, j)

maximum
(j,

additional flow that can be sent from

node
(i)

to
u^:

node
-

using the arcs

and
of arc

i).

residual capacity has two components:


(ii)

x^;,

the

unused capacity
to increase

(i, j),

The and
j.

the current flow


rj;

x;j

on arc
x^:

(j,

i)

which can be cancelled

flow to node

Consequently,

Uj;

xij

We

call

the network consisting of the arcs with


x),

positive residual capacities the residual


represent
it

network (with respect to the flow

and

as G(x). Figure 4.1 illustrates an

example of a residual network.

4.1

Labeling Algorithm and the Max-Flow Min-Cut Theorem

One

of the simplest
is

and most
path

intuitive algorithms for solving the

maximum
The

flow problem

the augmenting

algorithm

due

to

Ford and Fulkerson.

algorithm proceeds by identifying directed paths from the source to the sink in the
residual network

and augmenting flows on these paths,

until the residual

network

contains no such path.

The following high-level (and

flexible) description of the

algorithm summarizes the basic iterative steps, without specifying any particular
algorithmic strategy for

how

to

determine augmenting paths.

70

algorithm
begin
x: =
0;

AUGMENTING PATH;

while there
begin

is

a path

P from

s to

in G(x)

do

A = min
:

(rjj

(i, j)

e P);

augment A
end;

units of flow along

P and update

G(x);

end;

For each
increases
r:j

(i,

j)

P,

augmenting A units of flow along P decreases


discuss this algorithm in

r^:

by A and
a

by

A.

We now

more

detail.

First,

we need

method
to

to identify a directed

path from the source to the sink in the residual network or

show

that the

network contains no such path.


finitely.

Second,

we need

to

show

that the

algorithm terminates

Finally,
last result

we must

establish that the algorithm termirtates

with a

maximum

flow.

The

follows from the proof of the max-flow min-cut

theorem.

directed path from the source to the sink in the residual network
path.

is

also called

an augmenting

The residual capacity


on the path. The
in arc
(i,
j)

of an

augmenting path

is

the

minimum
an

residual capacity of any arc


that

definition of the residual capacity implies


(i)

an additional flow of A
Xj;

of the residual network corresponds to


(ii)

increase in

by A
a

in the original

network, or
(i)

a decreeise in
(ii).

Xjj

by A

in the original
it

network, or

(iii)

convex combination of

and

For our purposes,


the flows only

is

easier to

work

directly with residual capacities

and

to

compute

when

the algorithm

terminates.

The labeling algorithm performs


directed path from s to
t.

a search of the residual

network

to find a

It

does so by fanning out from the source node

s to find a

directed tree containing nodes that are reachable from the source along a directed path in the residual network.

At any

step,

we

refer to the

nodes in the tree as

labeled

and those
its

not in the tree as unlabeled.

The algorithm

selects a labeled

node and scans

arc

adjacency

list (in

the residual network) to label

more

uiilabeled nodes.

Eventually, the

sink becomes labeled and the algorithm sends the

maximum

possible flow on the path

from

s to
it

t.

It

then erases the labels and repeats this process. The algorithm terminates
all

when

has scanned

labeled nodes

and the sink remains unlabeled. The following

algorithmic description specifies the steps of the labeling algorithm in detail. The

71

Network with

arc capacities.

Node

is

the source

and node

is

the sink.

(Arcs not

shown have

zero capacities.)

Network with

a flow

x.

The

residual network with residual arc capacities.

Figure 4.1 Example of a residua] network.

72

algorithm maintains a predecessor index,

pred(i), for

each labeled node

indicating the
to trace back

rode

that

caused node
a

to

be labeled.
to the source.

The predecessor indices allow us

along the path from

node

algorithm LABELING;
begin
loop
pred(j)
:

for each

N;

L: =

(s);

while L *
begin

and

t is

unlabeled do

select a

node
(i, j)

L;

for each
if

e A(i)

do
rj;

is

unlabeled and

>

then

begin
pred(j)
:

i;

mark
end
end;

as labeled

and add

this

node

to L;

if

is

labeled then

begin

use the predecessor labels to trace back to obtain the augmenting path P

from

s to
:

t;

A = min
:

(rj;

(i, j)

e P);

augment A
erase
all

units of flow along P;

labels

and go

to loop;

end
else quit the loop;

end; (loop)

end;

The
rjj

final residual capacities r

uj; - xj:

+
x:j

x:j,the

can be used to obtain the arc flows as follows. Since arc flows satisfy xj: - x:j = uj; - Fjj. Hence, if u^: > rj: we can set x^; =

Ujj

- r^;

and

0;

otherwise

we

set x^:

and

x:j

fj; - u^;.

73

In order to

show

that the algorithm obtains a

maximum

flow,

we

introduce

some
if

new

definitions

and

notation.

Recall from Section 1.3 that a set


is

subnetwork G' = (N,


cutset partitions set

- Q)

disconnected eind no superset of


subsets.

Q c A is a cutset the Q Yias this property. A


if

N
s.

into

two

cutset is called am s-t cutset

the source and

the sink nodes are contained in different subsets of nodes S cind S =

N - S:
an

is

the set of

nodes connected
t

to

Conversely, any partition of the node set as S and S with s e S and

S defines an
S).
j

s-t cutset.

Consequently,
j

we
(S,

alternatively designate

s-t

cutset as
i

(S,

An
is

arc

(i, j)

with

e S cind

is

called a forward arc,


S).

and an

arc

(i, j)

with

and S

called a backward arc in the cutset

Let X be a flow vector satisfying the flow conservation


(4.1).

and capacity constraints of

For

this

flow vector

X,

let

be the amount of flow leaving the source.


net flow across an
s-t

We

refer

to v as the value of the flow.

The flow x determines the

cutset (S,

S) as

Fx<S< S)=
i

X
G S
j

X_Xij
e

I_ X
e

Xij.

(4.2)

e S

Def ne

the capacity C(S, S) of an

s-t

cutset

(S,

S)

is

defined as

C(S, S) =

X X ie
S je

"ij

^'^^^

S
cutset equals the value of the flow
(4.1

We
in

claim that the flow across any

s-t

and does

not exceed the cutset capacity. Adding the flow conservation constraints

b) for nodes
j

S and noting
-Xjj in

that

when nodes
i,

and

both belong to

S, x^j in

equation for node

Cemcels

equation for node

we

obtain

^=1
ie S
Substituting
x^;

I.'^ij

I_
i S

X
je S

''ij

Fx^S, S).

(4.4)

j S
in the first

<

u^;

summation and

xj:

in the

second summation

shows

that

Fx(S,

S)<

Z_

"ij

^ C<S,

S).

(4.5)

i S J6 S

74

This result

is

the

weak duahty property


Like most

of the

maximum
it

flow problem when


the "easy" half of the

viewed as

a linear program.

weak

duality results,

is

duahty theory. The more substantive strong duaUty property


an equality
for

cisserts that (4.5)


S).

holds as

some
is

choice of

and some choice

of an

s-t

cutset (S,

This strong

duality property

the

max-flow min-cut theorem.


The maximum value of flow from
s

Theorem
equals the

4.1.

(Max-Flow Min-Cut Theorem) minimum capacity of all s-t cuts.

to

Proof.
value.

Let x denote the a

maximum

flow vector and v denote the

maximum

flow

(Linear

programming

theory, or our subsequent algorithmic developments,


eis

guarantee that the problem always has a maximvmn flow as long


capacity.) Define

some

cutset has finite

to

be the

set of labeled
initial

nodes
flow

in the residual
x.

network G(x) when we


S.

apply the labeling algorithm with the

Let

S=

N-

Clearly, since x

is

maximum flow, s e S and S, we obtain (4.4). Note that


=
xjj

S.

Adding
in

the flow conservation equations for nodes in


S,

nodes

S cannot be labeled from the nodes in


(S,
S).

hence

rj:

for each

forward arc
x;,

(i, j)

in the cutset
xj;

Since

rj:

U|;

Xj:

Xjj,

the conditions
S)

<

Ujj

and

imply that

Uj; for

each forward arc in the cutset

(S,

and

x^;

for each

backward arc

in the cutset.

Making

these substitutions in (4.4) yields

V = Fx(S, S) =
i

^
e S
j

]
S

Ujj

= C(S,

S)

(4.6)

But

we have

observed earlier that v


(S,

is

a lower

bound on the capacity


s-t

of

any

s-t cutset.

Coi^equently, the cutset


the

S) is a

minimum

capacity

cutset

and

its

capacity equals

maximum

flow value

v.

We

thus have established the theorem.

The proof

of this theorem not only establishes the max-flow min-cut property,

but the same argument shows that

when

the labeling algorithm terminates,


vector)

it

has at

hemd both the maximum flow value (and a maximum flow


capacity
s-t

and

minimum

cutset.

But does
at

it

terminate finitely?

Each labeling
eirc

iteration of the

algorithm scans any node

most once, inspecting each

in A(i).

Consequently, the
If all

labeling iteration scans each arc at most once


capacities are integral
(s,

<md requires 0(m) computations.

arc

and bounded by

a finite

number U, then

the capacity of the cutset


at least

N - {s})

is at

most nU. Since the labeling algorithm increases the flow value by
iteration,
it

one unit

in

any
is

terminates within

nU

iterations.

This bound on the


if

number
is

of iterations

not entirely satisfactory for large values of U;

= 2", the bound

75

exponential in the

number

of nodes.
if

Moreover, the algorithm can indeed perform that

many

iterations.

In addition,

the capacities are irrational, the algorithm

may

not

terminate:

although the successive flow values converge, they

may

not converge to the


select the

maximum

flow value.

Thus

if

the

method

is

to

be effective,

we must

augmenting paths

carefully.

Several refinements of the algorithms, including those

we

consider in Section 4.2 - 4.4


if

overcome

this difficulty

and obtain an optimum flow even

the capacities are irrational; moreover, the max-flow min-cut theorem (and our proof

of

Theorem

4.1)

is

true even

if

the data are irrational.

A
iteration,

second drawback of the labeling algorithm


the

is

its

"forget fulness".

At each

algorithm generates node labels that contain information about


to other nodes.

augmenting paths from the source


described erases the labels

The implementation we have

when

it

proceeds from one iteration to the next, even though


Erasing the labels

much

of this information

may be

valid in the next residual network.


Ideally,

therefore destroys potentially useful information.


it

we

should retain a label

when

can be used profitably in later computations.

4.2

Decreasing the

Number
the

of Augmentations

The bound
not
satisfactory

of

nU on
a

number

of augmentations in the labeling algorithm

is

from

theoretical

perspective.

Furthermore, without further


take fiCnU) augmentations, as the

modifications, the augmenting path algorithm

may

example given

in Figure 4.2 illustrates.

Flow decomposition shows


should be able
X
is

that, in principle,
thein

augmenting path algorithms

to find a

maximum
is

flow in no more
initial

augmentations. For suppose

an optimum flow and y


it

any

flow (possibly zero). By the flow decomposition

property,

is

possible to obtain x from y by a sequence of at most


s to
t

augmentations on
If

augmenting paths from

plus flows around augmenting cycles.

we

define
x'

x'

as

the flow vector obtained from y by applying only the augmenting paths, then

also

is

maximum
it

flow (flows around cycles do not change flow value). This result shows that

is,

in theory, possible to find a

maximum

flow using

at

most

augmentations.
to

Unfortunately, to apply this flow decomposition argument,

we need

know

maximum
theoretical

flow.

No

algorithm developed in the literature comes close to achieving this


it is

bound.

Nevertheless,

possible to improve considerably

on the bound

of

0(nU) augmentations

of the basic labeling algorithm.

76

(a)

10

\l

10^,0

(b)

10^,1

10^,1

(0
Figiire 4.2

A pathological example for the labeling


arc capacities.
s-a-b-t.

algorithm.

(a)

The input network with

(b)

After aug^nenting along the path


After augmenting along the path

Arc flow

is

indicated beside the arc capacity.

(c)

s-b-a-t.
is

After 2 xlO^ augmentations, alternately

along s-a-b-t and

s-b-a-t, the

flow

maximum.

77

One

natural specialization of the augmenting path algorithm

is

to

augment flow

along a "shortest path" from the source to the sink, defined as a path consisting of the
least

number

of arcs.

If

we augment
same or

flow along a shortest path, then the length of any


increases.

shortest path either stays the

Moreover, within

m augmentations, the
in the

length of the shortest path

is

guaranteed

to increase.

(We

will

prove these results

next section.)

Since no path contains


is at

more than

n-1 arcs, this rule guarantees that the

number

of augmentations

most (n-l)m.
a path of

An
the

alternative

is

to

augment flow along

maximum

residual capacity.

This specialization also leads to improved complexity. Let v be any flow value and v* be

maximum

flow value.

By flow decomposition, the network contains


to (v*
-

at

most

augmenting paths whose residual capacities sum

v).

Thus the maximum

capacity augmenting path has residual capacity at least (v*-v)/m.

Now
(v*

consider a
v.

sequence of
least
less,

2m

consecutive

maximum
have

capacity augmentations, starting with flow


-

At
or

one of these augmentations must augment the flow by an amount


for

v)/2m

otherwise

we

will

maximum

flow.

Thus

after

augmentations, the algorithm would reduce the capacity of a

2m or fewer maximum capacity


most

augmenting path by
the capacity

a factor of at least two.


at least
1

Since this capacity

is initially at

U and

must be

until the flow is

maximum,

after

capacity augmentations, the flow must be

maximum.

(Note

0(m log U) maximum that we are essentially

repeating the argument used to establish the geometric improvement approach


discussed in Section
1.6.)

In the following section,

we

consider another algorithm for reducing the

number

of augmentations.

4.3

Shortest

Augmenting Path Algorithm


would be
to successively
If

natural approach to augmenting along shortest paths


first

look for shortest paths by performing a breadth


the labeling algorithm maintains the set

search in the residual network.

of labeled nodes as a queue, then


it

by

examining the labeled nodes


in the residual network.

in a first-in, first-out order,

would obtain

a shortest path
in the

Each of these

iterations

would take 0(m) steps both

worst

case and in practice, and (by our subsequent observations) the resulting computation

time would be O(nm^).

Unfortunately, this computation time


fact that the

is

excessive.

We

can

improve

this

running time by exploiting the

minimum

distance from any

78

node

to the sink

node

is

monotonically nondecreasing over

all

augmentations.

By

fully exploiting this property,

we

can reduce the average time per augmentation to 0(n).

The Algorithm
The concept
of distance labels
w^ill

prove

to

be an important construct

in the
4.5.

maximum

flow algorithms that

we

discuss in this section

and

in Sections 4.4
Tj: is

and

A
if it

distance function

-*

Z"*"

with respect to the residual capacities

a fimction from
is

the set of nodes to the nonnegative integers.


satisfies the

We say

that a distance function

valid

follovdng two conditions:

C4.1
C4-2.

d(t) d(i)

= <

0;

d(j)

for every arc

(i, j)

A with r^; > 0.


node
is
i

We
condition.

refer to d(i) as the distance label of


It

and condition C4.2 as the

validit}/

is

easy to demonstrate that


i

d(i)

a lower

boimd on
i

the length of the


i2

shortest directed path from

to

in the residual

network. Let

i^

i3

...

-\ -

be any path of length k in the residual network from node i to t. Then, from C4.2 we have d(i) = d(i|) < d(i2) + 1, d(i2) 2 d(i3) + 1, ... d(ij^) < d(t) + 1 = 1. These inequalities
,

imply that

d(i)

< k for any path of length k in the residual network and, hence, any

shortest path from

node

to

contains at

leaist d(i)

arcs.
i

If
t

for each

node

i,

the distance

label d(i) equals the length of the shortest path

from

to

in the residual

network, then
a valid

we

call the

distance labels exact.

For example, in Figure

4.1(c),

d =

(0, 0, 0, 0) is

distance label, though d =

(3, 1, 2, 0)

represents the exact distance label.

We now
admissible
if it

define
satisfies

some
d(i)

additional notation.

An

arc

(i, j)

in the residual

network

is
t

d(j)

1.

Other arcs are inadmissible.

path from

s to

consisting entirely of admissible arcs

is

an admissible

path.

The algorithm we describe

next repeatedly augments flow along admissible paths. For any admissible path of length
k, d(s)

k.

Since d(s)

is

a lower

bound on

the length of

any path from the source

to the

sink, the algorithm

augments flows along

shortest paths in the residual network.

Thus,

we

refer to the algorithm as the shortest augmenting path algorithm.

Whenever we augment along


path
is

a path, each of the distance labels for nodes in the


in the

exact.

However,
it

for other

nodes

network

it is

not necessary to maintain

exact distances;

suffices to

have valid distances, which are lower bounds on the exact


to

distances. There

is

no particular urgency

compute these distances


i

exactly.

By allowing
flexibility

the distance label of


in the algorithm,

node

to

be

less

than the distance from


cost.

to

t,

we

maintain

without incuring any significant

79

We can

compute

the initial distance labels by performing a

backward breadth

first

search of the residual network, starting at the sink node.

The algorithm generates an


It

admissible path by adding admissible

circs,
i',

one

at a time, as follows.

maintains a path

from the source node


admissible arcs.
indices,
i.e.,

to

some node
path a

called the current node, consisting entirely of

We
=

call this
i

partial admissible path

and

store

it

using predecessor
of the

pred(j)

for each arc

(i, j)

on the path. The algorithm performs one


retreat.

two steps

at the current
(i*, j*)

node:

advance or

The advance step


it

identifies

some
and

admissible arc
designates
j*

emanating from node


current node.
If

i*,

adds

to the partial admissible path,


i*,

as the

new

no admissible arc emanates from node

then
i*

the algorithm performs the retreat step.

This step increeises the distance label of node


it

so that at least one admissible arc emanates from


operation).

(we
i*)

refer to this step as a relabel


i*

Increasing d(i*)

makes

the arc (predd*),

inadmissible (assuming

s).

Consequently,

we

delete (pred(i*),

i*)

from the

partial admissible path

and node

pred(i*)

becomes the new current node.


admissible path
(i.e.,

Whenever
t),

the partial admissible path becomes an

contains node

the algorithm

makes

maximum

possible

augmentation on

this

path and begins again with the source as the current node.

The

algorithm terminates

when

d(s)

S n, indicating that the network contains no

augmenting path from the source


algorithm
begin

to the sink.

We

next describe the algorithm formally.

SHORTEST AUGMENTING PATH;


0;
first

X =
:

perform backward breadth

search of the residual network

from node
1*
:

to obtain the distance labels d(i);

s;

while
begin

d(s)

< n do

if i*

has an admissible arc then

ADVANCE(i*)
=

else
if i*

RETREAT(i*);
=
t

then

AUGMENT and set i

s;

end; end;

procedure ADVANCE(i);
begin
let (i*, j*)

be an admissible arc in =
i*

A(i*);

pred(j')

and

i*

j*;

end;

80

procedure RETREAT(i');
begin
d(i*)
if !
:

= min
s

d(j)

(i, j)

A(i*)

and

^-

>

);

?t

then

i*

pred(i*);

end;

procedure
begin

AUGMENT;

using predecessor indices identify an augmenting path P from the source to the
sink;

A = min
:

{rjj

(i, j)

P);

augment A
end;

units of flow along path P;

node.

We use the following data structure to select an admissible arc We maintain the list A(i) of arcs emanating from each node
Each node
i

emanating from
Arcs in each

i.

list

can be arranged arbitrarily, but the order, once decided, remains unchanged throughout
the algorithm.

has a current-arc

(i, j)

which
i

is

the current candidate for the


first

next advance step.

Initially,
list

the current-arc of node


sequentially
list

is

the

arc in

its
is

arc

list.

The

algorithm examines this


it

and whenever the current arc

inadmissible,

makes

the next arc in the arc


it

the current arc.

When
i

the algorithm has examined

all

arcs in A(i),

updates the distance label of node


arc in
its

and the current arc once again

becomes the
implicitly

first

arc

list.

In our subsequent discussion

we

shall

always

assume

that the algorithms select admissible arcs using this technique.

Correctness of the Algorithm

We
maximum

first

show

that the shortest

augmentation algorithm correctly solves the

flow problem. The shortest augmenting path algorithm maintains valid distance
labels at

Lemma

4.1.

each step.

Moreover, each relabel step

strictly increases the distance label of a node.

Proof.

We show

that the algorithm maintains valid distance labels at every step

by

performing induction on the number of augment and relabel steps.


algorithm constructs valid distance
function
is

Initially, the

labels.

Assume, inductively,

that the distance

valid prior to a step,

i.e.,

satisfies the validity


(i)

condition C4.2.

We

need

to

check whether these conditions remain valid


residual graph changes),

after

an augment step (when the

and

(ii)

after a relabel step.

81

(i)

flow augmentation on arc

(i, j)

might delete

this arc

from the residual

network, but this modification


distance function for this arc.
additional arc
d(i)
(j,

to the residual

network does not


(i,

affect the validity of the

i)

with

rjj

>

might, however, create an and, therefore, also create an additional condition d(j) <
j)

Augmentation on arc

that

needs to be
d(i)

satisfied.
1

The distance

labels satisfy this validity condition,

though, since

d(j)

by the admissibility property of the augmenting path.


a relabel step at
if

(ii)

The algorithm performs


list A(i).

node
is

when

the current arc reaches

the end of arc

Observe that

an arc

(i, j)

inadmissible at

some

stage, then

it

remains inadmissible until

d(i) increases

because of our inductive hypothesis that


the current arc reaches the end of the arc
1

distance labels are nondecreasing. Thus,


list

when

A(i),

then no arc
1
:

(i, j)

e A(i) satisfies d(i) = d(j) +


rj;

and

rj;

>

0.

Hence,

d(i)

<

min{d(j) +

(i, j)

A(i)

and

>

0)

d'(i),

thereby establishing the second part of the

lemma.
Finally, the choice for

changing

d(i)

ensures that the condition

d(i)

<

d(j)

remains valid for

all

(i,

j)

in the residual network; in addition, since d(i) increases, the


for all arcs Gc,
i)

conditions dOc) < d(i) +

remain valid

in the residual network.

Theorem
flow.

4.2.

The shortest augmenting path algorithm correctly computes a

maximum

Proof.

The algorithm terminates when

d(s)

n.

Since
t,

d(s)

is

a lower

bound on

the

length of the shortest augmenting path from s to

this condition implies that the

network contains no augmenting path from the source

to the sink,

which

is

the

termination criterion for the generic augmenting path algorithm.

At termination of the algorithm, we can obtain a minimum


For

s-t

cutset as follows.

< k <

n, let

a^ denote
for

the

number

of nodes with distance label equal to k.

Note

that Oj^,

must be zero
e N: d(i) > k*)
S,

Let S =

{i

some k* < n - 1 since Oj^ ^n-1. (Recall that d(s) ^ n.) = k and S = N - S. When d(s; ^ n and the algorithm terminates, s e
sets
1

S and

and both the

S and S are nonempty. Consider the


(i, j)

s-t

cutset (S, S).

By

construction, d(i) > d(j) +


rj:

for all

(S,

S).

The

validity condition C4.2 implies that


s-t

for each

(i, j)

(S,

S).

Hence,

(S,

S)

is

minimum

cutset

and the current flow

is

maximum.

82

Complexity of the Algorithm

We
Lemma
number
Proof.

next

show

that the algorithm

computes

maximvun flow

in

O(n^m)

time.

4.2. (a)

Each distance
is

label increases at

most n times.

Consequently, the total


is

of relabel steps

at most

n^

(b)

The number of augment steps

at

most nrnfl.

Each relabel step

at

node

increeises d(i)
d(i)

by

at least one.

After the algorithm has

relabeled
selects

node
i

at

most n times,

n.

From

this point on, the

algorithm never

node

again during an advance step since for every node k in the current path,

d(k) < d(s) < n.


of relabel steps
is

Thus the algorithm

relabels a

node

at

most n times and the

total

number

bounded by

n'^.

Each augment step saturates


zero.

at least

one

arc,

i.e.,

decreases

its

residual capacity to

Suppose

that the arc

(i, j)

becomes saturated
sent

at

some

iteration (at
is

which
from

d(i)
j

=
i

d(j)

1).

Then no more flow can be


d'(j)

on
1

(i, j)

until flow

sent back

to

(at

which point

d'(i)
,

d(i)

d(j)

2).

Hence, between two consecutive

saturations of arc

(i, j)

d(j)

increases by at least 2 units. Cortsequently,


total

any

arc

(i, j)

can

become saturated
than nm/2.

at

most n/2 times and the

number

of arc saturations is

no more

Theorem
Proof.

4.3.

The shortest augmenting path algorithm runs

in

O(n^m)

time.

The algorithm performs 0(nm) flow augmentations and each augmentation takes
in

0(n) time, resulting

O(n^m)

total effort in the

augmentation

steps.

Each advance step

increases the length of the partial admissible path by one,


its

and each

retreat step decrecises

length by one;

since each partial admissible path has length at

most

n, the

algorithm

requires at most 0(n^ +


retreat (relabel) steps,

n^m) advance

steps.

The

first

term comes from the number of


of augmentations,

and the second term from the number


the previous lemma.

which

are

bounded by nm/2 by
For each node
i,

the algorithm performs the relabel operation 0(n) times, each


I

execution requiring 0( A(i)

time.

The

total

time spent in

all relabel

operations

is

V
i

A(i)

= 0(nm).

Finally,

we

consider the time spent in identifying admissible

N
The time taken
to identify the admissible arc of

arcs.

node
I

is

0(1) plus the time sf)ent in

scanning arcs in

A(i).

After having performed


list

A(i)
i.

such scannings, the algorithm


total

reaches the end of the arc

and

relabels

node

Thus the

time spent in

all

83

scannings

is

0(

V
i

nlA(i)l) = 0(nm).

The combination

of these time

bounds

establishes the theorem.

The proof of Theorem

4.3 also suggests

an alternative temnination condition


criteria

for
is

the shortest augmenting path algorithm.


satisfactory for a worst-case analysis, but

The termination

of d(s) ^ n

may

not be efficient in practice.

Researchers

have observed empirically


major portion of which
is

that the algorithm

spends too much time

in relabeling, a

done

after

it

has already found the

algorithm can be improved by detecting the presence of a

maximum flow. The minimum cutset prior to


this array

performing these relabeling operations.

We

can do so by maintaining the number of

nodes

i.e., ex.

aj^

with distance label equal to

k, for

^ k <

n.

The algorithm updates


it

after every relabel operation

and terminates whenever

first

finds a gap in the


{

array,
(S,

for

some

k* <

n.

As we have seen

earlier, if

S =

d(s)

>

k*),

then

S)

denotes a

minimum

cutset.

The idea of augmenting flows along


easy to implement in practice.

shortest paths

is

intuitively appealing

and

The resulting algorithms


is tight, i.e.,

identify at

most 0(nm)

augmenting paths and

this

bound

on particular examples these algorithms


to

perform f2(nm) augmentations.


shortest

The only way


is

improve the running time of the


fewer computations per
,

augmenting path algorithm


The use

to

perform

augmentation.

of a sophisticated data structure, called dynamic trees

reduces

the average time for each augmentation from 0(n) to

OGog

n).

This implementation of

the

maximum

flow algorithm runs in


difficult

0(nm

log n) time

and obtaining further


These

improvements appears quite


implementations
interest,

except in very dense networks.

Vkith sophisticated data structures

appear to be primarily of theoretical

however, because maintaining the data structures requires substantial overhead

that tends to increase rather than reduce the computationjd times in practice.

detailed

discussion of dynamic trees

is

beyond the scope of

this chapter.

Potential Functions

and an Alternate Proof of

Lemma

4.2(b)

A
functions.

powerful method for proving computational time bounds

is

to use potential

Potential function techniques are general purpose techniques for proving the

complexity of an algorithm by analyzing the effects of different steps on an appropriately


defined function.

The use

of potential functions enables us to define an "accounting"

relationship between the occurrences of various steps of an algorithm that can be used to

84

obtain a

bound on

the steps that might be difficult to obtain using other arguments.

Rather than formally introducing potential functions,

we

illustrate the

technique by

showing
is

that the

number

of augmentations in the shortest

augmenting path algorithm

0(nm).

Suppose

in the shortest

augmenting path algorithm we kept track of the number


Let F(k) denote the

of admissible arcs in the residual network.


arcs at the

number

of admissible
eis

end

of the k-th step; for the purpose of this argument,


relabel operation.

we

count a step either

an augmentation or as a
terminates.

Let the algorithm perform


0.

steps before

it

Clearly, F(0) <

m and
many

F(K) ^

Each augmentation decreases the residual

capacity of at least one arc to zero and hence reduces F by at least one unit.
relabeling of

Each

node

creates as

cis

A(i)

new

admissible arcs, and increases F by the


all

same amount. This


relabels

increase in F

is at

most

nm

over

relabelings, since the algorithm

any node

at

most n times

(as a

consequence of

Lemma
its

4.1)

and

V
i

A(i)

nm.

Since the

initial

value of F

is at

most
is

more than

terminal value, the total

decrease in F due to
is at

all

augmentations

+ nm. Thus the number of augmentations

most

m + nm
was

= 0(nm).
representative of the potential function argument.
of augmentations.

This argument
objective
to

is fairly

Our

bound

the

number

We

did so by defining a potential

function that decreases whenever the algorithm performs an augmentation.


potential increases only

The

when

the algorithm relabels distances,

and thus we can bound


In general,

the

number
the

of augmentations using

bounds on the number

of relabels.

we
of

bound

number

of steps of one type in terms of

knovm

boiands on the

number

steps of other types.

4.4

Freflow-Push Algorithms

Augmenting path algorithms send flow by augmenting along


step further
arc.

a path.

This basic

decomposes

into the

more elementary operation

of sending flow along an

Thus sending a flow

of

A A

units along a path of k arcs


units along an arc of the path.

decomposes

into

k basic
of

operations of sending a flow of


these basic operations as a push.

We shall refer to each

path augmentation has one advantage over a single push:


at all

it

maintains

conservation of flow

nodes.

In fact, the push-based algorithms such as those

we

develop in

this

and the following

sections necessarily violate conservation of flow.

85

Rather, these algorithms permit the flow into a

node

to

exceed the flow out of

this

node.

We

will refer to

any such flows as preflows.


(i)

The two basic operations


arc,

of the generic
(ii)

preflow-push methods are

pushing the flow on an admissible

and

updating a

distance label, as in the augmenting path algorithm described in the last section.
define the distance labels and admissible arcs as in the previous section.)

(We

Preflow-push algorithms have several advantages over augmentation based


algorithms.
First,

they are

more general and more

flexible.

Second, they can push flow


for

closer to the sink before identifying

augmenting paths. Third, they are better suited

distributed or parallel computation.

Fourth, the best preflow-push algorithms currently

outperform the best augmenting path algorithms in theory as well as in practice.

The Generic Algorithm

A preflow
of (4.1b):

is

a function x:

A R

that satisfies (4.1c)

and the following

relaxation

y
{j:(j,i)

Xjj

'^ij

SO

,foralli N-{s,

t).

A)

(j:(i,j)

A)
a

The preflow-push algorithms maintain


a given preflow x,

preflow at each intermediate stage. For


i

we

define the excess for each node

N-

{s, t}

as

e(>=
{)
:

Z
(j, i)

''ji

(j
:

A)

X'^ij (i, j) A)

We

refer to a

node with positive excess as an active node.

We

adopt the

convention that the source and sink nodes are never active.
algorithms perform
all

The preflow-push
iteration of the
le<ist

operations using only local information.

At each

algorithm (except
active node,
i.e.,

its initialization

and
t)

its

termination), the network contains at


e(i)

one

node

N - {s,

with
its

>

0.

The goal of each

iterative step is to

choose some active node and to send

excess closer to the sink, closeness being

measured with respect


algorithms,

to the current distance labels.

As
If

in the shortest aug;menting

path

we send
to

flow only on admissible arcs.


labels,

the
it

method cannot send excess


increases the distance label

from

this

node

nodes with smaller distance


it

then

of the

node so

that

creates at least one

new

admissible arc. The algorithm terminates

when

the network contains

no active nodes.

The preflow-push algorithm uses

the

following subroutines:

86

procedure PREPROCESS;
begin
x: =
0;

perform a backward breadth

first-search of the residual

network,

stairting at

node

t,

to determine initial distance labels d(i);


Xgj
:

Ugj for each arc

(s, j)

e A(s)

and

d(s)

n;

end;

procedure PUSH/RELABEL(i);
begin
if

the network contains an admissible arc

(i, j)

then

push 5 = min{e(i),
:

r^:)

units of flow from


1
:

node
Tj:

to

node

else replace d(i)

by min

{d(j)

(i, j)

e A(i) and

>

0};

end;

push

of 5 units
e(j)

from node

to

node

decreases both

e(i)

and

r^:

by 6 units and
(i, j)

increases both
saturating
if

and

r;,

by

5 units.

We

say that a push of 6 units of flow on arc

is

5 =

rj;

and nonsaturating otherwise.

We

refer to the process of increasing

the distance label of a node as a relabel operation.


to create at least

The piirpose

of the relabel operation

is

one admissible arc on which the algorithm can perform further pushes.

The following generic version of the preflow-push algorithm combines the


subroutines just described.

algorithm
begin

PREFLOW-PUSH;

PREPROCESS;
while the network contains an
begin
select

active

node do

an active node

i;

PUSH/RELABEL(i);
end; end;

It

might be instructive

to visualize the generic

preflow-push algorithm in terms

of a physical network; arcs represent flexible water pipes, nodes represent joints,

and the

distance function measures

how

far

nodes are above the ground; and


to the sink.

in this

network,

we v^h

to

send water from the source

In addition,

we

visualize flow in an

87

admissible arc as water flowing downhill.

Initially,

we move
at a

the source

node upward,

and water flows

to its neighbors.

In general,

water flows downhill towards the sink;

however, occasionally flow becomes trapped locally


neighbors.

node

that has

no downhill

At

this point,

we move

the

node upward, and again water flows downhill

towards the

sink.

Eventually, no flow than can reach the sink.

As we continue

to

move

nodes upwards, the remaining excess flow eventually flows back towards the source.

The algorithm terminates when


source.

all

the water flows either into the sink or into the

Figure 4.3 illustrates the push/relabel steps applied to the example given in
Figure
4.1(a).

Figure 4.3(a) specifies the preflow determined by the preprocess step.

Suppose the

select step
1,

examines node

2.

Since arc

(2,

4)

has residual capacity r24 =


of value 6

and

d(2) = d(4) +

the algorithm performs a (saturating)


of

push

= min

{2, 1}

units.

The push reduces the excess


network and arc
node,
it

node 2

to

1.

Arc

(2, 4) is

deleted from the residual


is still

(4, 2) is

added

to the residual network.

Since node 2
(2, 3)

an active

can be selected again for further pushes. The arc

and

(2, 1)

have positive

residual capacities, but they

do not

satisfy the distance condition.

Hence, the algorithm

performs a relabel operation and gives node 2 a

new

distance d'(2) =

min

{d(3)

1,

d(l)+l} = min{2,5) =

2.

The preprocessing
node adjacent
to

step accomplishes several important tasks.

First,

it

gives each

node

s a

positive excess, so that the algorithm can begin

by selecting
all

some node with


incident to node

positive excess.
s,

Second, since the preprocessing step saturates


is

arcs

none of these arcs

admissible and setting d(s) = n will satisfy the


is

validity condition C4.2.

Third, since d(s) = n


t,

a lower

bound on

the length of
t.

any

shortest path from s to

the residual network contains no path from s to

Since

distances in d are nondecre<ising,

we

are also guaranteed that in subsequent iterations


t,

the residual network will never contain a directed path from s to


will be

and so there never

any need

to

push flow from

s again.

In the push/relabel(i) step,

we
is

identify

an admissible arc

in A(i)

using the same

data structure

we used

in the shortest
(i, j)

augmenting path algorithm.


the current candidate for the
list.

We

maintain vrith

each node

a current arc

which

push operation.

We

choose the current arc by sequentially scanning the arc


scanning the arc
times.
lists

We

have seen

earlier that

takes

0(nm)

total time, if the

algorithm relabels each node 0(n)

88
d(3) =

e3=4

d(l) = 4

d(4)

d(2) =

e,= 2
The
residual network after the preprocessing step.

(a)

d(3) =

d(l)

=4

d(4)

d(2)

l 1

6^ =

(b)

After the execution of step PUSH(2).

89
d(3)

d(l) = 4

d(4) =

d(2) = 2

(c)

After the execution of step RELABEL(2).

Figure 4.3

An

illustration of

push and relabel

steps.

Assuming

that the generic

preflow-push algorithm terminates,

we

can easily
resides

show

that

it

finds a

maximum

flow.

The algorithm terminates when the excess


is

either at the source or at the sink implying that the current preflow
r, the residual

a flow. Since d(s) =

network contains no path from the source

to the sink.

This condition
total

is

the termination criterion of the augmenting path algorithm,


arcs directed into the sink
is

and thus the

flow on

the

maximum

flow value.

Complexity of the Algorithm

We now
important
times.

analyze the complexity of the algorithm.


that distance labels are

We
4.1,

begin by establishing one

result:
first

always valid and do not increase too

many

The

of these conclusions follows

from

Lemma

because as in the shortest

augmenting path algorithm, the preflow-push algorithm pushes flow only on


admissible arcs and relabels a node orily

when no

admissible arc emanates from

it.

The

second conclusion follows from the following lemma.

Lemma
is

43.

connected to

At any stage of the preflow-push algorithm, each node i with positive excess node s by a directed path from i to s in the residual network.

Proof.

By

the flow decomposition theory,

any preflow x can be decomposed with respect


(i)

to the original
(ii)

network

into nonnegative flows along

paths from the source s to


Let
i

t,

paths from

s to active

nodes, and

(iii)

the flows around directed cycles.

be an

90

active

node

relative to the preflou' x in G.


x,

Then

there
t

must be

a path

P from

s to

in the

flow decomposition of

since paths from s to


i.

and flows around cycles do not


P

contribute to the excess at node

Then

the residual network contains the reversal of

O' with the orientation of each arc reversed),

and hence

a directed path

from

to

s.

This

lemma imples
set.

that during a relabel step, the algorithm

does not minimize

over an empty

Lemma
Proof.

4.4.

For each node

e N,

dii)

<

2n.

The

last

time the algorithm relabeled node

i,

it

had a positive

excess,
i

and hence
s.

the residual network contained a path of length at most n-1 from node
fact that d(s)

to

node

The

= n and condition C4.2 imply that


(a)

d(i)

< d(s) + n -

<

2n.

Lemma
number

4.5.

Each distance
is

label increases at
.

most 2n times.

Consequently, the total


is

of relabel steps

at

most 2n^

(b)

The number

of saturating pushes

at

most

nm.
Proof. The proof
is ver>'

much

similar to that of

Lemma

4.2.

Lemma
Proof.

4.6.

The number

of nonsaturating pushes is

O(n^m).
Let
III

We

prove the lemma using an argument based on potential functions.


Cor^ider the potential function F =
.

denote the

set of active nodes.

V
i
I

d(i).

Since

<

n,

and

d(i)

< 2n for

all

e
is

I,

the initial value of

(after the

preprocessing step)
step,

is at

most

2n^. At termination, F
cases

zero.

During the push/ relabel (i)

one of the following two

must apply:
1.

Case

The

<ilgorithm

is

unable to find an admissible arc along which

it

can push flow.

In this case the distance label of

node

increases by e ^

units. This operation increases

by

at

most

e units.

Since the total increase in d(i) throughout the running time of the
i

algorithm for each node


distance labels
is

is

bounded by
2n''.

2n, the total increase in

F due

to increases in

bounded by
is

Case

2.

The algorithm

able to identify an arc on which

it

can push flow, and so


(i,
j)

it

performs a saturating or a nonsaturating push.


create a

saturating push on arc

might
1,

new

excess at node
d(j),

j,

thereby increasing the

number

of active nodes by

and

increasing F by

which may be as much as 2n per saturating push, and hence 2n'^m


Next note that a nonsaturating push on arc
(i, j)

over

all

saturating pushes.

does not

91

increase III.

The nonsaturatirg push

will decrease

F by

d(i) since

becomes

inactive,

but

it

simultaneously increases F by
If

d(j)

d(i)

1 if

the push causes

node

to

become
The net

active.

node
F

was

active before the push, then

decrejises

by an amount

d(i).

decreeise in

is at least 1

unit per norxsaturating push.

We
maximum
at

summarize these
possible increase in

facts.

The

initial

value of F

is

at

most 2n^ and the

is Irr-

+ 2n^m. Each nonsaturating push decreases F by

one unit and F always remains nonnegative. Hence, the nortsaturating pushes can occur

most 2n^ + 2n^ + 2n^m = O(n^m) times, proving the lemma.


Finally,

we

indicate

how

the algorithm keeps track of active nodes for the


It

push/relabel steps. The algorithm maintains a set S of active nodes.


that

adds

to

S nodes

become

active following a

push and are not already

in S,

and deletes from S nodes

that

become

inactive following a nonsaturating push.


lists)

Several data structures (for

example, doubly linked


delete, or select elements

are available for storing S so that the algorithm can add,


it

from
in

in

0(1) time. Consequently,

it is

easy to implement the

preflow-push algorithm
theorem:

O(n'^m) time.

We

have thus established the following

Theorem

1.4

The generic preflow-push algorithm runs

in

O(n'^m) time.

Specialization of the Generic Algorithm

The running time

of the generic preflow-push algorithm

is

comparable

to the

bound

of the shortest

augmenting path algorithm.

However, the preflow-push


and
its

algorithm has several nice features, in particular,


further improvements.

its flexibility

potential for

By specifying

different rules for selecting

nodes for push/relabel


For

operations,

we

can derive

many
max

different algorithms
select
{d(i)

from the generic version.

example, suppose that


push/relabel step.

we always

an active node with the highest distance label for


:

Let h* =

e(i)

>

0,

e N) at

some point
h*-l,

of the algorithm.
in

Then nodes with distance h* push flow


turn,

to

nodes with distance

and these nodes,


is

push flow

to

nodes with distance

h*-2,

and so on.
Note
all

If a
if

node

relabeled then

excess

moves up and then gradually comes


cor\secutive

dov^n.

that

the algorithm relabels no

node during n

node examinations, then

excess reaches the sink

node and

the algorithm terminates.

Since the algorithm requires O(n^) relabel operations,

we

immediately obtain a bound of O(n^) on the number of node examinations. Each node examination entails
at

most one nonsaturating push.

Consequently, this algorithm

performs O(n^) nonsaturating pushes.

92

variable level which

is

an upper bound on the highest index


lists

r for

which LlST(r)

is

nonempty.

We

can store these

as

doubly linked

lists

so that adding, deleting, or

selecting an element takes 0(1) time.


starting at LIST(level)

We

identify the highest indexed


lists.

nonempty

list

and sequentially scanning the lower indexed


needed
is

We

leave

it

as

an exercise

to

show

that the overall effort

to scan the lists is

bounded by n plus
is

the total increase in the distance labels which

O(n^).

The following theorem

now

evident.

Theorem

4.5

The preflcnv-push algorithm


O(n^)
time.

that

always pushes flow from an active node

ipith the

highest distance label runs in

U
preflow push algorithm
is

The O(n^) bound


and can be improved.

for the highest label

straightforward,

Researchers have

shown using more

clever analysis that the


)

highest label preflow push algorithm in fact runs in 0(n^ Vrn

time.

We
to

will next

describe

another implementation of the generic preflow-push algorithm

that

dramatically reduces the


Recall that

number

of nonsaturating pushes, from

O(n^m)

0(n^ log U).


refer to this

represents the largest arc capacity in the network.


it

We

algorithm as the excess-scaling algorithm since

is

bcised

on scaling the node excesses.

4.5

Excess-Scaling

Algorithm
at

The generic preflow-push algorithm allows flows


violate

each intermediate step

to

mass balance equations.

attempts to satisfy the meiss balance equations.


active node)
is

By pushing flows from active nodes, the algorithm The function ej^g^ ~ ^^'^ ^^^'^ i is an
:

one measure of the

infeasibility of a preflow.

Note, though, that during


Cj^^g^,

the execution of the generic algorithm,

we would
0.

observe no particular pattern in


In this section,

except that e^^g^^ eventually decreases to vtdue

we

develop an excess-

scaling technique that systematically reduces Cjj^^ to 0.

The excess-scaling algorithm is based on the following ideas. Let A denote an upper bound on ejj^g^ we refer to this bound as the excess-dominator The excess-scaling
.

algorithm pushes flow from nodes whose excess

is

A/2 S

^jj^ax^^-

"^^

choice assures

that during nonsaturating pushes the algorithm sends relatively large excess closer to the

sink.

Pushes carrying small amounts of flow are of

little

benefit

and can cause

bottlenecks that retards the algorithm's progress.

The algorithm

also does not allow the

maximum

excess to increase beyond A.

This algorithmic strategy

may prove

to

be useful for the following reason.

Suppose

93

The algorithm

also does not allow the

maximum

excess to increase beyond A.

This algorithmic strategy

may prove

to

be useful for the following reason.


j,

Suppose
likely that

several nodes send flow to a single

node

creating a very large excess.

It is

node
Vkdll

could not

send the accumulated flow closer to the sink, and thus the algorithm

need

to increase its distance

and return much of


is

its

excess back toward the source.


effort.

Thus, pushing too

much

flow to any node

likely to

be a wasted

The

excess-scaling algorithm has the follouang algorithmic description.

algorithm EXCESS-SCALING;
begin

PREPROCESS; K:=2riogUl.
for k
:

K down

to

do

begin (A-scaling phase)

A: = 2^
while the network contains
a

node

with

e(i)

> A/2 do

perform push/relabel(i) while ensuring that no node excess


exceeds A;

end;

end;

The algorithm performs a number of


dominator A decreasing from phase
certain value of

scaling phases with the value of the excess-

to phase.

We

refer to a specific scaling

phase with a

A as

the /^-scaling phase.

Initially,

A=

2'

^6

^ when
'

the logarithm has

base

2.

Thus,

< A < 2U. Ehjring the A-scaling phase, A/2 < Cj^g^ < A and ejj^^^
the phase.

may

vary up and

down during

When
Ul +
1

Cjj^g^

< A/2, a

new

scaling phise begins.

After the algorithm has peformed flog

scaling phases, ejy,ax decreases to value

and we obtain
The

the

maximum

flow.

excess-scaling algorithm uses the

same step push/relabel(i) as

in the generic

preflow-push algorithm, but with one slight difference:

instead of pushing
units.

6 =

min

{e(i), Tj;}

units of flow,

it

pushes 6 = min

{e(i), Ij;,

- e(j)}

This change will


the

ensure that the algorithm permits no excess to exceed A.

The algorithm uses

following node selection rule to guarantee that no node excess exceeds A.


Selection Rule. Among all nodes with excess of distance label (breaking ties arbitrarily).

more than A/2,

select a

node with

minimum

94

Lemma
C43.
C4.4.

4.7.

The algorithm

satisfies the

following two conditions:

Each nonsaturating push sends

at least

A/2 units of flow.

No

excess ever exceeds A.

Proof. For every push on arc

(i, j),

we have

e(i)

> A/2 and


excess

e(j) is

< A/2, since node

is

node with smallest distance


=
d(i)

label
(i, j)

among nodes whose


admissible.

<

d(i)

since arc

is

Hence, by sending min

more than A/2, and d(j) {e(i), r^;, A - e(j)) >

min

{A/2,

ijj)

units of flow,
of flow.

we

ensure that in a nonsaturating push the Jilgorithm sends


e(j).

at leaist

A/2 vmits excess at node


e(j)

Further, the push operation increases only

Let
Tj;,

e'(j)
-

be the
e(j))

after
All

the push.

Then

e'(j)

e(j)

+ min

{e(i),

<

A-

e(j)

<A

node excesses thus remain

less

than or equal to A.

Lemma

4.8.

The excess-scaling algorithm performs O(n^) nonsaturating pushes per and

scaling phase

0(n^

log

U) pushes

in total.

Proof. Consider the potential function F =

^
ie

e(i)

d(i)/A.

Using

this potential function

N
Since the algorithm has
first.

we

will establish the first assertion of the


is is

lemma.

Odog U)
at

scaling phases, the second assertion

a consequence of the

The
e(i) is

initial

value of F

the beginning of the A-scaling phase


d(i) is

bounded by 2n^ because


step,

bounded by A and

bounded by

2n.

During the push/relabeKi)

one of the following two cases

must apply:
Case
1.

The algorithm

is

unable to find an admissible arc along which

it

can push flow.

In this case the distance label of

node

increases
e(i)

by

units.
i,

This relabeling operation


the
totcil

increases F by at most e units because

<

A.

Since for each

increaise in d(i)
4.4),

throughout the running of the algorithm


increase in F

is

bounded by 2n (by Lemma


is

the total

due

to the relabeling of

nodes

bounded by 2n^
is at

in the A-scaling
all

phase

(actually, the increase in

F due

to

node

relabelings

most

2n'^

over

scaling phases).

Case

2.

The algorithm

is

able to identify an arc on which

it

can push flow and so


Ccise,

it

performs either a saturating or a nonsaturating push.


nonsaturating push on arc
since d(j) = d(i)
- 1,
(i, j)

In either

F decreases.
i

A
and

sends

at leaist

A/2

tmits of flow
at least

from node
1/2
units.

to

node

after this operation

F decreaases by
is at

Since the

initial

value of F

at the

beginning of a A-scaling phase

most 2n^ and the increases


1),

in

during

this scaling
is

phase sum to
8rr.

at

most 2n^ (from Case

the

number

of nonsaturating

pushes

bounded by

95

This

lemma

implies a

bound

of

0(nm
all

+ n^ log U)

for the excess-scaling

algorithm since

we have

already seen that

other operations

such

as saturating

pushes, relabel operations and finding admissible arcs


point,

require

0(nm)

time.

Up

to this

we have
if

ignored the method needed to identify a node with the


excess

minimum

distance label
easy,

among nodes with

more than A/2. Making


in the

this identification is

we

use a scheme similar

to the

one used
label.

preflow-push method in Section


lists

4.4 to find a
e(i)

node with the highest distance


d(i)

We
is

maintain the

LIST(r) =

{i

> A/2 and

r),

and a variable

level

which

a lower

bound on

the smallest index


list

for

which LlST(r)

is

nonempty.

We

identify the lowest indexed

nonempty

starting

at LIST(level)

and sequentially scanning the higher indexed


that the overall effort

lists.

We
is

leave as an

exercise to

show

needed

to scan the lists

is

bounded by the number


not a bottleneck

of pushes performed by the algorithm plus

0(n log U) and, hence,

operation.
result.

With

this observation,

we

can summarize our discussion by the following

Theorem
time.

4.6

The preflow-push algorithm with excess-scaling runs

in

0(nm + n^

log

U)

Networks with Lower Bounds on Flows

To conclude this section, we show how to solve maximum flow problems vdth nonnegative lower bounds on flows. Let /j; ^ denote the lower bound for flow on any
eu'C (i,
j)

e A.

Although the

maximum

flow problem v^th zero lower bounds always


infecisible.

has a feasible solution, the problem wiih nonnegative lower bounds could be

We

can, however, determine the feeisibUlity of this

problem with zero lower bounds as follows.


choice gives us a pseudoflow with
e(i)

We

problem by solving a maximum flow set x^: = /j: for each arc (i, j) e A. This
i

representing the excess or deficit of any node

N.

(We

refer the reader to Section 5.4 for the definition of a

pseudoflow with both


a

excesses and deficits).

We
e(i)

introduce a super source, node


0,

s*,

and

super sink,

node

t*.

For each node

with

>

we add an
t*)

arc

(s*,i)

with capacity

e(i),

and

for each

node

with

e(i)

<

0,

we add an
s* to
t*.

arc

(i,

with capacity

-e(i).

We

then solve a
v*

problem from

Let

x* denote the

maximum
v* =
{i:

flow and
e(i)

maximum flow denote the maximum


is

flow value in the transformed network.

If

\
e(i)

then the original problem

>

0)
is

feasible

and choosing the flow on each


is

arc

(i, j)

as

x^;

/jj

a feasible flow;

otherwise,

the problem

infeasible.

96

Once we have found


=
(ujj

a feasible flow,
initially
first

we

apply any of the

maximum

flow
as

algorithms with only one change:


rj;

define the residual capacity of an arc

(i, j)

Xjj)

(xjj

/jj).

The

and second tenns


on arc

in this expression denote,


(i, j)

respectively, the residual capacity for incre<ising flow

cmd

for decreasing flow

on arc

(j,

i).

It is

possible to establish the optimality

of the solution generated by the

algorithm by generalizing the max-flow min-cut theorem to accomodate situations with

lower bounds. These observations show that

it

is

possible to solve the

problem with nonnegative lower bounds by two applications of the


cilgorithms

maximum maximum

flow

flow

we have

already discussed.

97

5.

MINIMUM COST FLOWS


In this section,

we

consider algorithmic approaches for the

minimum

cost flow

problem.

We

consider the following node-arc formulation of the problem.

Minimize

2^

Cj; x;:
'

{5.1a)

(i,j)A^
subject to

{j

(i, j)

X X) X::

(j

(j, i)

X^!k) =
''ii

t)(>)'

for

a"

>

e N,

(5.1b)

<

xjj

<

Ujj,

for each

(i, j)

A.

(5.1c)

We assume
nonnegative.
Let

that the

lower bounds
(

/j;

on arc flows are

all

zero and that arc costs are


[

C
}

=
).

max

Cj;

(i, j)

and

max

max

lb(i)l

ie N},

max

ujj

(i, j)

The transformations Tl and T3


loss of generality.

in Section 2.4

imply that these

assumptions do not impose any

We

remind the reader of our blanket


capacity) are integral.

assumption that

all

data

(cost,

supply/demand and
problem

We

also

assume

that the

minimum

cost flow

satisfies the

following two conditions.

A5.1.

Feasibility Assumption.

We assume

that

X
ieN

^(^^

and

that

the

minimum

cost

flow problem has a feasible solution.

We
maximum
t*.

can ascertain the

feasibility of the

minimum

cost flow

problem by solving a

flow problem as follows. Introduce a super source node


i

s*,

and a super and

sink

node
i

For each node


b(i)

with
arc

b(i)
(i,

>

0,

add an

arc

(s*, i)

with capacity

b(i),

for each

node

with

<

0,

add an
If

t*)

with capacity

-b(i).

Now solve a maximum

flow problem
cost

from

s* to

t*.

the

maximum

flow value equals


{i
:

T
b(D >

b(i) 0)

then the

minimum

flow problem
A5.2.

is feasible;

otherwise,

it is

infeasible.

Connectedness Assumption.
(i.e.,

directed path

We assume that the network G contains an uncapacitated each arc in the path has infinite capacity) between every pair of nodes.
this condition,
if

We
(j,

impose
j

necessary, by adding artificial arcs

(1, j)

and

1) for

each

and assigning

a large cost

and a very large capacity

to each of these

98

arcs.

No

such arc would appear in a

minimum

cost solution unless the

problem

contains no feasible solution without

artificial arcs.

CXir algorithms rely on the concept of residual networks.

The

residual network
(i, j)

G(x) corresponding to a flow x


arcs
i)
(i, j)

is

defined as follows:
Cj:

We replace each arc


r^;

by two
arc
(j,

and

(j, i).

The arc

(i, j)

has cost
rjj

and
x^;.

residual capacity

u^j - x^;,

and the

has cost

-Cj:

and residual capacity

The

residual network consists only of arcs

with positive residual capacity.

The concept
example,
if

of residual networks poses

some
(i,

notational difficulties.
j)

For

the original network contains both the arcs


i

and

(j,

i),

then the residual


j

network may contain two arcs from node


i

to

node and/or two


j

arcs

from node

to

node

with possibly different


to

costs.

Our

notation for arcs assumes that at most one arc joins


easily treat this

one node

any other node. By using more complex notation, we can


case.

more general
parallel arcs

However, rather than changing our notation, we


(or,

will tissume that

never arise

by inserting

extra

nodes on

parallel arcs,

we

can produce a

network without any Observe


that

parallel arcs).

any directed cycle

in the residual

network G(x)

is

an augmenting

cycle with respect to the flow x

and vice-versa

(see Section 2.1 for the definition of

augmenting

cycle).

This equivalence implies the following alternate statement of

Theorem
Theorem

2.4.

5.1.

feasible flow

is

an optimum flow

if

and only

if

the residual network G(x)

contains no negative cost directed cycle.

5.1.

Duality and Optimality Conditions

As we have seen
programming dual

in Section 1.2,

due

to its special structure, the

minimum
The

cost

flow problem has a number of important theoretical properties.


of this problem inherits

linear

many

of these properties.

Moreover, the

minimum

cost flow

problem and

its

dual have, from a linear programming point of


In this section,

view, rather simple complementary slackness conditions.


state the linear

we

formally

programming dual problem and derive the complementary slackness

conditions.

99

We
each arc
generality.
in (5.1b).

consider the
j)

minimum
is

cost flow

problem
that this

(5.1)

assuming

that

Uj;

>

for

(i,

A.

It

possible to

show
7t(i)

assumption imposes no

loss of
i

We

associate a dual variable

with the mass balance corwtraint of node


is

Since one of the constraints in (5.1b)

redundant,
,

we
that

can

set

one of these dual


0.
j)

variables to an arbitrary value.


associate a dual variable
6jj

We,

therefore

assume

7c(l)

=
(i,

Further,
in (5.1c).

we
The

with the upper bound constraint of arc

dual problem to

(5.1) is:

Maximize

X
ie

t)(') '^(i^

~
(i,j)

X
e

"ij ^i\
^

(5 2a)

'

subject to

7c(i)

7c(j)

6ij

<

Cjj

for all

(i, j)

e A,

(5.2b)

5jjS

0,

foraU

(i,j)e

A,

(5.2c)

and

Ji(i)

are unrestricted.

The complementary slackness conditions


Xjj

for this primal-dual pair are:

>

=>

7i(i)

n(j)

5jj

Cjj

(5.3)

6jj

>

Xjj

Ujj.

(5.4)

These conditions are equivalent


Xj:

to the

following optimality conditions:


(5.5)

=*

7c(i)

7t(j)

<

Cjj

0<xjj <u^j=*
= Ujj=>

Jt(i)-

Jt(j)

Cjj,

(5.6)

Xij

n(i)

n{])

^ qj
<
Xj:

(5.7)

To see

this equivalence,

suppose that

<

Uj: for

some

arc

(i, j).

The condition

(5.3)

implies that
7t(i)-7t(j)

-5jj =

Cjj,

(5.8)

Since
(5.6).

Xj:

<

Uj;
Xj;

(5.4)
Uj:

implies that

6jj

0;

substituting this result in (5.8) yields


(5.3)

Whenever

>

for

some

arc

(i, j),

implies that

n(i)

n(j)

5jj

Cjj

100

Substituting

5jj

in this
6jj

equation gives

(5.7).

Finally,

if

xj:

<

uj;

for

some

arc

(i, j)

then

(5.4)

imples that

and substituting

this result in (5.2b) gives (5.5).

We
(5.5)

define the reduced cost of an arc

(i, j)

as

Cj;

Cj:

Ji(i)

+
is

n(j).

The conditions
if it

(5.7)

imply

that a pair

x,

of flows and

node

potentials

optimal

satisfies

the follov^ing conditions:

C5.1 C5.2

X
If

is feasible. Cjj Cjj


Cjj

> = <

0, 0, 0,

then
then

Xjj

0.

C5.3
C5.4

If
If

<
x^:

Xj;

<

Ujj.

then

U|j.

Observe
however,

that the condition C5.3 follows


it

from the conditions C5.1, C5.2 and C5.4;


These conditions, when stated
in

we

retain

for the sake of completeness.


to:

terms of the residual network, simplify


C5.5 C5.6
(Primal feasibility) x
(E>ual feasibility)
Cj;

is

feasible.

for each arc

(i, j)

in the residual

network G(x).

Note
note that
if

that the condition C5.6


Cj;

>

and

Xj;

>

subsumes for some arc


(j, i)

C5.2, C5.3,
(i,
j)

and

C5.4.

To
<

see this result,

in the original
Cjj.

network, then the


0,

residual network
C5.6.

would contain

arc

with
Cj;

Cjj

= Xjj

But then
for

Cjj

contradicting

similar contradiction arises

if

<

and

<

Uj;

some

(i, j)

in A.

It is

easy to establish the equivalence between these optimality conditions and the

condition stated in
satisf)'ing

Theorem

5.1.

Consider any pair

x,

n of flows and node potentials

C5.5 and C5.6. Let

W be any

directed cycle in the residual network. Condition

C5.6 implies that

X
(i,j)

C:;
'^

S 0. Further

S
(i,j)e

q: =
''

(i,j)

XW
C;;

I
(i,j)

(-Jt(i)

Jt(j))

(i,

-t^ Cjj

Hence, the residual network contains no negative cost

cycle,

i)eW
To see
the converse, suppose that x
is

feasible

and C(x) does not contain

negative cycle.

Then
The

in the residual
Cj:,

respect to the arc lengths

are well defined.

network the shortest distances from node 1, with Let d(i) denote the shortest distance from

node

to

node

i.

shortest path optimality condition C3.2 implies that d(j) < d(i) + q;

101

for aU

(i, j)

in G(x).

Let n =
x,
71

d.

Then

< q; +

d(i)

d(j)

Cj; - Jt(i)

7t(j)

Cj;

for all

(i, j)

in G(x).

Hence, the pair

satisfies

C5.5 and C5.6.

5^

Relationship to Shortest Path and

Maximum Flow Problems

The minimum

cost

flow problem generalizes both the shortest path and

maximum

flow problems.

The

shortest path

problem from node

s to all
,

other nodes

can be formulated as a minimum cost flow problem by setting b(l) = (n - 1) b(i) = -1 for all 1 * s, and Uj; = for each (i, j) e A (in fact, setting Uj: equal to any integer greater
than (n 1)

will suffice

if

we wish
s to

to

maintain
t

finite capacities).

Similarly, the

maximum
=

flow problem from node

node

can be transformed to the


s)

minimum

cost

flow problem by introducing an additional arc

(t,

with
Cj:

c^g

= -1 and u^^ =
for each arc

(in fact,

Uj^

max

{u|;

(i, j)

e A) would suffice), and setting

(i, j)

A. Thus,

algorithms for the

minimum

cost flow

problem solve both the shortest path and

maximum

flow problems as special cases.

Conversely, algorithms for the shortest path and


great use in solving the

minimum

cost flow problen..

maximum flow problems are of Indeed, many of the algorithms


use shortest path

minimum and/or maximum


for the

cost flow

problem either

explicitly or implicitly

flow algorithms as subroutines.


led to

Consequently, improved algorithms


for the

for these

two problems have

improved algorithms

minimum

cost flow
for

problem.
the

This relationship will be


cost flow problem.

more transparent when we discuss algorithms


have already shov^m
in Section 5.1

minimum

We

how

to obtain

an optimum dual solution from an optimum primal solution by solving a single


shortest path problem.

We now show how

to obtain

an optimal primal solution from

an optimal dual solution by solving a single maximum flow problem.


Suppose
that
7t

is

an optimal dual solution and

c is the vector of

reduced

costs.

We

define the cost-residual network G* = (N, A*) as follows.


as the nodes in G.
1^;*,

same supply /demand


well as a lower

Any

arc

(i, j)

The nodes in G* have the A* has an upper bound u^:* as

bound

defined as follows:

102

(i)
(ii)

For each For each

(i, j)

in

(i, j)

(iii)

For each

(i,

j)

A with Cj; > 0, A* contains an arc in A with Cj; < 0, A* contains an arc in A with c,; = 0, A* contains an

(i, j)

with

u^:*

1j:

0.

(i, j)

with u^* =
(i,

1^:*

=Uj;.

arc

j)

with

Uj;*

uj;

and

hf =

0-

The lower and upper bounds on arcs in the cost-residual network G* are defined so that any flow in G* satisfies the optimality conditions C5.2-C5.4. If Cj; > for some
(i, j)

6 A, then condition C5.2 dictates that

xj:

in the

optimum
(i, j)

flow.

Similarly,

if

Cjj

<

for

some

(i, j)

A, then C5.4 implies the flow on arc


flow.
If
cjj

must be

at the arc's

upper bound

in the

optimum

0,

then any flow value will satisfy the

condition C5.3.
.

Now
network

the problem

is

reduced to finding a feasible flow in the cost-residual

that satisfies the lower

and upper bound

restrictions of arcs and, at the

same

time, meets the

supply/demand

constraints of the nodes.

We

first

eliminate the lower


this

bounds of arcs

as described in Section 2.4


in

and then transform

problem

to a

maximum
cost

flow problem as described

assumption A5.1. Let x* denote the


x*+/*
is

flow in the transformed network.

Then

an optimum solution of the

maximum minimum

problem

in G.

5.3.

Negative Cycle Algorithm


Operations researchers, computer
scientists, electrical

engineers and

many

others

have extensively studied the minimum cost flow problem and have proposed a number
of different algorithms to solve this problem.

Notable examples are the negative cycle,

successive shortest path, primal-dual, out-of-kilter, primal simplex and scaling-based


algorithms.
In this

and the following


cost flow

sections,

we

discuss most of these important

algorithms for the them.

minimum

problem and point out relationships between

We

first

consider the negative cycle algorithm.


cycle algorithm maintains a primal feasible solution
It

The negative
to attain

x and strives

dual

feasibility.

does so by identifying negative cost directed cycles in the


in these cycles.

residual network G(x)

and augmenting flows

The algorithm terminates

when
when

the residual network contains no negative cost cycles.


the algorithm terminates,
it

Theorem

5.1

implies that

has found a

minimum

cost flow.

103

algorithm

NEGATIVE CYCLE;

begin
establish a feasible flow x in the network;

while C(x) contains a negative cycle do begin


use some algorithm
5
:

to identify a negative cycle

W;

= min

[t^

(i, j)

e W);

augment
end;
end;

6 units of flow along the cycle

W and update G(x);

A
cycle
3.4,
is

feasible flow in the

network can be found by solving a

maximum

flow problem

as explained just after assumption A5.1.

One

algorithm for identifying a negative cost

the label correcting algorithm for the shortest path problem, described in Section
to identify a negative cycle.

which requires 0(nm) time


at least

Every iteration reduces the


initial

flow cost by
zero
is

one

unit.

Since

mCU

is

an upper bound on an
cost, the

flow cost and

a lower

bound on

the

optimum flow

algorithm terminates after at most

O(mCU)

iterations

and requires O(nm^CU) time

in total.

This algorithm can be improved in the following three ways (which


irizpV summarize)

we

briefly

(i)

Identifying a negative cost cycle in effort


(to

much

less

than 0(nm) time.


It

The simplex

algorithm
solution

be discussed

later)

nearly achieves this objective.


it

maintains a tree

and node

potentials that enable

to identify a negative cost cycle in

0(m)

effort.

However, due

to degeneracy, the

simplex algorithm cannot necessarily send a positive

amoimt
(ii)

of flow along this cycle.

Identifying a negative cost cycle with

maximum improvement
due

in the objective

function value.

The improvement
is

in the objective function

to the

augmentation
x* be

along a cycle

(i, j)

IW
m

(min
^

(rjj

(i, j)

e W)).

Let x be

some flow and

an

optimum

flow.

The augmenting

cycle theorem

(Theorem

2.3) implies that x* equals

plus the flow on at most


in cost

augmenting cycles with respect

to x.

Further,

improvements
to ex -ex*.
objective

due

to

flow augmentations on these augmenting cycles

sum

Consequently,

at least

one augmenting cycle with respect


Hence,
if

to x

must decrease the

function by at least

(ex -cx*)/m.

the algorithm always

augments flow along a

104

cycle with

obtain

maximum improvement, then Lemma 1.1 implies an optimum flow within 0(m log mCU) iterations.
cycle
is

that the

method would

Finding a
of this

maximum

improvement

a difficult problem, but a

modest variation

approach yields

a polynomial time algorithm for the

minimum

cost flow problem.

(iii)

Identifying a negative cost cycle vdth


ais its

minimum mean
it

cost.

We define

the mean cost


cycle is a

of a cycle
cycle

cost divided

by the number of arcs


It is

contains.

minimum mean

whose mean

cost

is

as small as possible.
time.

possible to identify a

minimum mean
that
if

cycle in

0(nm)

or 0(Vri

m log nC)

Recently, researchers have

shown

the

negative cycle algorithm always augments the flow along a

minimum mean
is

cycle, then

from one iteration


moreover,
the
its

to the next, the

minimum mean
(negative) cycle
1.1

cycle value

nondecreasing;
iterations.

absolute value decreases by a factor of l-(l/n) within

Since

mean

cost of the

minimum mean
-1/n,

is

bounded from below by -C and

bounded from above by

Lemma

implies that this algorithm will terminate in

0(nm

log nC) iterations.

5.4.

Successive

Shortest

Path

Algorithm

The negative

cycle algorithm maintains primal feasibility of the solution at every


feaisibility.

step and attempts to achieve dual

In contrast, the successive shortest path

algorithm maintains dual feasibility of the solution at every step and strives to attain
primal
feasibility.
It

maintains a solution x that satisfies the normegativity and capacity

constraints, but violates the

supply/demand

constraints of the nodes.


j

At each

step, the

algorithm selects a node

with extra supply and a node

with unfulfilled demand and

sends flow from


terminates

to

along a shortest path in the residual network.


all

The algorithm

when

the current solution satisfies

the

supply/demand
the capacity
i

constraints.

A pseudoflow is a function x A - R satisfying only


:

<md normegativity

constraints.

For any pseudoflow

x,

we

define the imbalance of node

as

e(i)

b(i)

+
{j:

(j, i)

X A]
''ii

{j: (i,j)

X a1
e(i)

''ii'

for all

e N.

If e(i)
-e(i) is

>

for

some node

i,

then

e(i) is

called the excess


is

of

node
Let S

i,

if e(i)

<

0,

then

called the deficit.

node

vdth

called balanced.

and T denote the

105

sets of excess

and

deficit

nodes respectively.

The residual network corresponding

to a

pseudoflow

is

defined in the same

way

that

we

define the residual network for a flow.

The successive shortest path algorithm successively augments flow along shortest paths computed with respect to the reduced costs Cj;. Observe that for any directed path

P from

node k

to a

node

/, (i,

fe P

C;;
''

=
(i,

Y fe

C:; - nil)

+ n(k).

Hence, the node

?'>

potentials change

all

path lengths between a specific pair of nodes by a constant amount,


Cj; is

and the
Cjj.

shortest path with respect to

the

same

bls

the shortest path with respect to

The correctness

of the successive shortest path algorithm rests

on the following

result.
5.1. Suppose a pseudoflow x satisfies the dual feasibility condition C5.6 unth respect to the node potentials it. Furthermore, suppose that x' is obtained from x by sending flow along a shortest path from a node k to a node I in Gix). Then x' also satisfies the dual feasibility conditions with respect to some node potentials.

Lemma

Proof.
jt,

Since x satisfies the dual feasibility conditions with respect to the node potentials
Cj:

we have
to

for all

(i, j)

in G(x).

Let d(v) denote the shortest path distances from


Cj;.

node k

any node v

in G(x) with respect to the arc lengths

We

claim that x also


Jt'

satisfies the

dual feasibility conditions with re;pect to the potentials


(i.e.,

= 7t-d.

The

shortest path optimality conditions

C3.2) imply that

d(j)<d(i)+
Substituting

cjj

for all

(i, j)

in G(x).

Cj:

=
-

Cj;

Jt(i)

n(j) in

these conditions

and using

7t'(i)

7t(i)

d(i) yields

qj"

Cjj

7:'(i)

n'(j)

0,

for all

(i, j)

in G(x).

Hence, x
every arc
every arc

satisfies
(i, j)
(i, j)

C5.6 with respect to the node potentials


to

n'.
/,

Next note that

Cj;'

=
Cjj

for

on the shortest path P from node k

node

since d(j) = d(i) +

for

P and

Cj:

c^;

;c(i)

Jt(j).

We
in

are

now
its

in a position to

prove the lemma.

Augmenting flow along any


=

arc

maiintains the dual feasibility condition C5.6 for this arc.

Augmenting flow on an
Cj:

arc
(i, j)

(i, j)

may add
,

reversal
arc

(j,

i)

to the residual

network. But since

for each arc

Cjj

0,

and so

(j, i)

also satisfies C5.6.

The node

potentials play a very important role in this algorithm.

Besides using

them

to

prove the correctness of the algorithm,

we

use them to ensure that the arc

106

lengths are nonnegative, thus enabling us to solve the shortest path subproblems
efficiently.

more

The following formal statement


of this method.

of the successive shortest path algorithm

summarizes the steps


algorithm

SUCCESSIVE SHORTEST PATH;


and
=

begin
X
:

7t

0;
e(i)

compute imbalances
while S ^

and

initialize the sets

S and T;

do

begin
select a

node k

e S

and

node /

T;
d(j)

determine shortest path distances

from node k

to all
Cj;;

other nodes in G(x) with respect to the reduced costs


let

P denote
:

a shortest

path from k to

1;

ujxJaten
6
:

= 7t-d;
e(k), -e(/),

= min

min

rj:

(i, j)

];

augment 6
update
end; end;
X,

units of flow along the path P;


T;

S and

To
satisfies

initialize the algorithm,

we

set x

0,

which

is

a feasible pseudoflow

and
arc

C5.6 with respect to the node potentials n =


Also,
if

since,

by assumption,

all

lengths are nonnegative.

5*0,

then

T*

because the

sum

of excesses always

equals the

sum

of deficits.

Further, the connectedness assumption implies that the

residual network G(x) contains a directed path from


this

node k

to

node

/.

Each iteration of

algorithm solves a shortest path problem with nonnegative arc lengths and reduces

the supply of

some node by
Cj:

at least

one

unit.

Consequently,

if

is

an upper bound on
iterations.

the largest supply of any node, the algorithm terminates in at most


the arc lengths

nU

Since

are nonnegative, the shortest path problem at each iteration can be

solved using Dijkstra's algorithm.

So the overall complexity of


is

this

algorithm

is

0(nU S(n, m, O), where

S(n,

m, C)

the time taken by Dijkstra's algorithm.


to

Currently,
is

the best strongly polynomial -time

bound

implement

Dijkstra's algorithm
is

CXm + n

log n) and the best (weakly) polynomial time

bound
is

0(min {m

log log C,

m
it

+
is

nVlogC

).

The successive
n,

shortest path algorithm


largest

pseudopolynomial time since


is,

polynomial in

and the

supply U.

The algorithm

however, f>olynomial

107

time for the assignment problem, a special case of the

minimum

cost flow

problem

for

which

1.

In Section 5.7,

we

will

develop a polynomial time algorithm for the

minimum

cost

flow problem using the successive shortest path algorithm in

conjunction with scaling.

5.5.

Primal-Dual and Out-of-Kilter Algorithms

The

primal-dual algorithm

is

very similar to the successive shortest path problem,


it

except that instead of sending flow on only one path during an iteration,

might send

flow along

many

paths.

To explain

the primal-dual algorithm,

we

transform the

minimum

cost flow

problem

into a single-source

and single-sink problem (possibly by


At every
iteration, the

adding nodes and arcs as

in the

assumption A5.1).

primal-dual

algorithm solves a shortest path problem from the source to update the node potentials
(i.e.,

as before, each

7:(j)

becomes

7t(j) -

d(j))

and then solves a

maximum

flow problem to

send the
reduced

maximum

possible flow from the source to the sink using only arcs with zero
that the excess of

cost.

The algorithm guarantees

some node

strictly

decreases at

each iteration, and also assures that the node potential of the sink
latter

strictly decreases.

The
flow

observation follows from the fact that after

we have

solved the

maximum

problem, the network contains no path from the source to the sink in the residual

network consisting
iteration d(t)

entirely of arcs with zero

reduced

costs; coi^equently, in the next

1.

These observations give a bound of min {nU, nC} on the number of

iterations since the

magnitude

of each

node

potential

is

bounded by nC. This bound

is

better than that of the successive shortest path algorithm, but, of course, the algorithm

incurs the additional expense of solving a

maximum

flow problem

at

each iteration.

Thus, the algorithm has an overall complexity of 0(min (nU S(n, m, C),

nC M(n, m,

U)),

where

S(n,

m, C) and M(n, m, U) respectively denote the solution times of

shortest p>ath

and maximum flow algorithms.

The successive

shortest path

and primal-dual algorithnw maintain a solution

that satisfies the dual feasibility conditions violates the

and the flow bound


iteratively

constraints, but that

mass balance

constraints.

These algorithnns

modify the flow and

potentials so that the flow at each step


constraints.

comes

closer to satisfying the

mass balance

However, we could
The

just

as well have violated other constraints at

intermediate steps.

out-of-kilter algorithm satisfies

only the mass balance cortstraints

and may
idea
is

violate the dual feasibility conditions

to drive the flow

on an arc

(i, j)

to Uj;

and the flow bound restrictior. The basic if Cj; > 0, Cj: < 0, drive the flow to zero if
=
0.

and

to permit

any flow between

and

Uj: if

Cj:

The

kilter

number, represented by

k^:.

108

kjj,

of an arc

(i, j)

is

defined

cis

the

minimum

increase or decrease in the flow necessary to

satisfy its
j)

flow bound constraint and dual

feasibility condition.

For example, for an arc


I

(i,

with
is

Cjj

>

0, k^j

x^j

and

for

an arc

(i, j)

with

c^j

<

0, k^;

u^;

x^:

An

arc with

k^:

said to be in-kilter.

At each
it

iteration, the out-of- kilter

algorithm reduces the kilter

number number

of at least one arc;


of an arc
(i, j)

terminates

when

all

arcs are in-kilter.

Suppose the

kilter

would decrease by increasing flow on P from node


in the cycle
j

the arc.

Then the algorithm


network and

would obtain
augment
this

a shortest path

to

node
{(i, j)).

in the residual

at least
is

one unit of flow


similar to, but

The proof

of the correctness of

algorithm

more

detailed than, that of the successive shortest path

algorithm.

5.6.

Network Simplex Algorithm

The network simplex algorithm


specialization
of

for the

minimum

cost flow

problem
for

is

the

bounded variable primal simplex algorithm


cost flow

linear

programming. The special structure of the minimum


benefits, particularly, streamlining of the simplex

problem

offers several

computations and eliminating the


tree structure of the basis (see

need

to explicitly maintain the

simplex tableau.

The

Section 2.3) permits the algorithm to achieve these efficiencies.


the last

The advances made

in

two decades

for maintaining

and upxiating the

tree structure efficiently

have

substantially

improved the speed

of the algorithm.

Through extensive empirical

testing,

researchers have also improved the performance of the simplex algorithm by

developing various heuristic rules for identifying entering variables.


version of the primal network simplex algorithm
its
is

Though no

known

to

run in polynomial time,

best implementations are empirically comparable to or better than other

minimum

cost flow algorithms.

In this section,

we

describe the network simplex algorithm in detail.

We

first

define the concept of a basis structure and describe a data structure to store and to

manipulate the

basis,

which

is

a spanning tree.
structure.

and node

potentials for

any basis

We then show how to compute arc flows We next discuss how to perform various
to

simplex operations such as the selection of entering arcs, leaving arcs and pivots using
the tree data structiire. Finally,

we show how

guarantee the finiteness of the network

simplex algorithm.

109

The network simplex algorithm maintains

a basic feasible solution at


is

each stage
U); B,

basic solution of the

minimum
The

cost flow
set

problem

defined by a triple
i.e.,

(B, L,

and
tree,

U p>artition
and L and

the arc set A.

B denotes the

set of basic arcs,

arcs of a spanrung

U
by

respectively denote the sets of nonbasic arcs at their lower

and upper
U) is j) g U,

bounds.

We

refer to the triple (B, L,


if

U) as

a basis structure.
(i, j)

A basis
xj:

structure (B, L,
u^: for

called feasible

setting

Xj;

for each

e L,

and

setting
(5.1c).

each

(i,

the problem has a feasible solution satisfying (5.1b) and


(B, L,

A
+

feasible basis structure

U)

is

called an

optimum

basis structure

if it is
Cj;

possible to obtain a set of node

potentials n so that the reduced costs defined

by

Cj;

nii)

n(j) satisfy

the following

optimality conditions:

Cjj

= S <

for each

(i, j)

e B,
L,

(5.9)

Cij

for each
for each

(i, j)

(5.10)
,

Cjj

(i, j)

U.
/

(5.11)

These optimality conditions have a nice economic interpretation.


little later

We

shall see a

that

if

nil) = 0, then equations (5.9)


1

tree path in

B from node

to

node

j.

Then,

imply that -7t(j) denotes the length of the cj; = Cj; - jc(i) + 7t(j) for a nonbeisic arc (i, p in

L denotes

the change in the cost of flow achieved by sending one unit of flow through

the tree path from

node

to

node
j

i,

through the arc

(i, j),

and then returning the flow


(5.10) implies that this

along the tree path from node


circulation of flow
is

to

node

1.

The condition

not profitable for any nonbasic arc in L. The condition (5.11) has a

similar interpretation.

The network simplex algorithm maintains


iteration

a feasible basis structure at each


until
it

and successively improves the basis structure

becomes an optimum

basic structure.

The following algorithmic description

specifies the essential steps of the

procedure.

110

algorithm

NETWORK

SIMPLEX;

begin
determine an
initial btisic feasible

flow x and the corresponding

basis structure (B, L, U);

compute node

potentials for this basis structure;


violates the optimality conditions

while some arc


begin
select

do

an entering arc
(k,
/)

(k, /)

violating the optimality conditions;


baisis

add arc

to the

spanning tree corresponding to the


in this cycle;

forming a cycle

and augment the maximum possible flow


determine the leaving arc
(p, q);

perform a basis exchange and update node potentials;


end;
end;
In the following discussion,

we

describe the various steps performed by the

network simplex algorithm


Obtaining an
Initial

in greater detail.

Basis Structure

Our connectedness assumption A5.2 provides one way


basic feasible solution.

of obtaining an initial

We
(j,

have assumed that for every node

{!),

the network

contains arcs

(1,

j)

and

1)

with sufficiently large costs and capacities. The


-b(j) if b(j)

initial basis

includes the arc


set

(1, j)

with flow

and arc
set

(j,

1)

with flow

b(j) if b(j)

>

0.

The
this

consists of the remaining arcs,

jmd the
as

U is

empty. The node potentials for

basis are easily

computed using

(5.9),

we

will see later.

Maintaining the Tree Structure

The

specialized network simplex algorithm

is

possible because of the spanning

tree property of the beisis.

The algorithm requires

the tree to be represented so that the

simplex algorithm can perform operations efficiently and update the representation
quickly

when

the basis changes.

We

next describe one such tree representation.

root.

We consider the tree We assume that node

as "hanging"

from a specially designated node, called the


tree.

1 is

the root node. See Figxire 5.1 for an example of the

We associate

three indices with each

node

in the tree:

a predecessor index, pred(i); a depth


i

index, depthd); and a thread index, thread(i). Each

node

has a unique path connecting

it

Ill

to the root.

The predecessor index


stores the

stores the

first

node

in that

path (other than node

i)

and the depth index


indices are zero.

number

of arcs in the path.

For the root node these

The Figure

5.1

shows an example

of these indices.

Note

that

by

iteratively using the predecessor indices,

we

can enumerate the path from any node to

the root node.


pred(i).
its

We

say that pred(i)


of a

is

the predecessor of

node
i

and

is

a successor of

node

The descendants
and so

node

consist of the

node

itself, its

successors, successors of

successors,

on.

For example, the node

set (5, 6, 7, 8, 9)
is

contair the descendents


In Figure 5.1,

of

node

5 in Figure 5.1.

node with no successors

called a leaf node.

nodes

4, 7, 8,

and 9 are

leaf nodes.

The thread
threads
its

indices define a traversal of the tree, a sequence of nodes that walks or


the

way through

nodes of the

tree, starting at

the root

and

visiting

nodes

in a

"top to bottom" and

"left to right"

order,

and then

finally returning to the root.

The

thread indices can be formed by performing a depth

first

search of the tree as described in

Section 1.5 and setting the thread of a node to be the node encountered after the
itself

node

in

this

depth

first

search.

For our example, this sequence would read


For each node
i,

1-2-5-6-8-9-7-3-4-1 (see the dotted lines in Figure 5.1).

thread (i) specifies

the next node in the traversal visited after node

i.

This traversal satisfies the following


in the

two

properties;

(i)

the predecessor of each

node appears

sequence before the node


in the traversal.

itself;

and

(ii)

the descendants of any

node are consecutive elements

The thread

indices provide a particularly convenient


i:

means

for visiting (or finding) all


i,

descendants of a node
visited until the

We
5,

simply follow the thread from node

recording the nodes

depth of the visited node becomes


at

at least as large as

node

i.

For

example, starting

node
5,

we

visit

nodes
3.

6,

8, 9,

and 7

in order,

which are the


5,

descendants of node

and then
left

visit

node

Since node 3's depth equals that of node

we know

that

we have

the "descendant tree" lying below

node

5.

As we

will see,

finding the descendant tree of a node efficiently adds sigiuficantly to the efficiency of the

simplex method.

The simplex method has two


given basis structure; and
(ii)

basic steps:

(i)

determining the node

p>otentials of a

computing the arc flows for a given basis


efficiently

structure.

We

now

describe

how

to

perform these steps

using the tree indices.

Computing Node

Potentials

and Flows for a Given Basis Structure

We

first

consider the problem of computing node potentials n for a given basis

structure (B, L, U).

We

assume

that n(l)

0.

Note

that the value of

one node potential

112

can be set arbitrarily since one constraint in (5.1b) is redundant. We compute the remaining node potentials using the conditions that Cj: = for each arc (i, j) in B. These
conditions can alternatively be stated as

113

n(j)

Ji(i)

Cjj,

for every arc

(i, j)

e B.

(5.12)

The basic idea


indices to

is

to start at

node

and fan out along the

tree arcs using the thread

compute other node


visits

potentials.
j,

The

traversal assures that

whenever

this
its

fanning out procedure


predecessor, say node
indices allow us to
i;

node

it

has already evaluated the potential of

hence, the procedure can


all

comput
in

7t(j)

using

(5.12).

The thread

compute

node potentials

0(n) time using the following

method.
procedure
begin
7t(l):

COMPUTE POTENTIALS;
=
0;

j:

= thread(l);
j

while

do

begin
i
:

pred(j);

if

(i, j)

then

;:(])

7t(i)

Cj;; Cjj;

if

(j, i)

A then

7t(j)

7t(i)

= thread (j);

end; end;

similar procedure will permit us to

compute flows on

basic arcs for a given


start at the leaf

basis structure (B, L, U).

We

proceed, however, in the reverse order:


indices, while

node and move

in

toward the root using the predecessor

computing flows
this task.

on arcs encountered along the way. The following procedure accomplishes

114

procedure
begin
e(i)
:

COMPUTE FLOWS;
=
b(i) for

aU

N;

let

T be

the basis tree;


(i, j)
:

for each

U do
subtract Uj; from
e(i)

set X|j

u^j,

and add

u^: to e(j);

while T*{1) do

begin
select a leaf
i
:

node

in the subtree T;

pred(j);

if

(i, j)

T then
=
e(j);

Xj;

-e(j);

else

Xjj

add

e(j)

to e(i);
j

delete

node

and the

arc incident to

it

from

T;

end; end;

One way
thread indices.

of identifying leaf nodes in

is

to select

nodes

in the reverse order of the


all

simple procedure completes

this task in

0(n) time: push

the nodes

into a stack in order of their appearance

on the thread, and then take them out from the

top one at a time.


descendants.

Note

that in the thread traversal, each

node appears
after

prior to

its
its

Hence, the reverse thread traversal examines each node

examining

descendants.

Now
additional

consider the steps of the method.

The

arcs in the set

must carry flow


node

equal to their capacity. Thus,

we

set x^;

U|j for these arcs.

This assignment creates an


at
j.

demand

of Uj; units at
Xj:

node

and makes the same amount available


initial

This effect of setting


nodes.

u^:

explains the

adjustments in the supply/demand of

The manner

for up>dating e(j) implies that each e(j) represents the


j.

sum

of the

adjusted supply /demand of nodes in the subtree hanging from node


is

Since this subtree

connected to the

rest of the tree

only by the arc

(i, j)

(or

(j,

i)),

this arc

must carry

-e(j)

(or

e(j))

units of flow to satisfy the adjusted supply /demand of nodes in the subtree.

The procedure Compute Flows


in

essentially solves the

system of equations Bx =

b,

which B represents the columns


Since B
is

in the node-arc incidence matrix

corresponding to
2.6 in Section
is

the spanning tree T.


2.3),
it

a lower triangular matrix (see

Theorem

is

possible to solve these equations by forward substitution, which

precisely

115

what the algorithm does.


of equations n

Similarly, the procedure


substitution.

Compute

Potentials solves the system

B =

by back

Entering

Arc
types of arcs are eligible to enter the basis:
a negative
is

Two
bound with

aiiy

nonbasic arc

at its

lower
a

reduced cost or any nonbasic arc


eligible to enter the basis.

at its

upper bound with

positive reduced cost,


(5.11).

These arcs violate condition

(5.10) or

The method used

for selecting

an entering arc among these

eligible arcs has a

inajor effect
selects
I

on the performance of the simplex algorithm.

An
i.e.,

implementation that

an arc that violates the optimality condition the most,

has the largest value of

Cjj

among such

arcs,

might require the fewest number of iterations in practice, but

must examine each

arc at each iteration,


list

which

is

very time<onsuming.

On

the other

hand, examining the arc


optimality condition
large

cyclically

and selecting the

first arc that violates

the

would quickly

find the entering arc, but

might require a
of the

relatively

number

of iterations

due

to the
list

poor arc choice.

One

most successful

implementations uses a candidate

approach that strikes an

effective

compromise

between these two

strategies.

This approach also offers sufficient flexibility for fine

tuning to special problem classes.

The algorithm maintains

a candidate

list

of arcs violating the optimality

conditions, selecting arcs in a two-phase procedure coristing of major iterations and

minor

iterations.

In a

major

iteration,

we

construct the candidate

list.

We

examine arcs

emanating from nodes, one node


emanating from node
i

at a time,

adding

to the candidate list the arcs

(if

any) that violate the optimality condition.


...

We

repeat this
list

selection process for nodes i+1, i+2,

until either

we have examined

all

nodes or the

has reached

its

maximum

allowable

size.

The next major

iteration begins with the

node

where the previous major


nodes
cyclically as
it

iteration ended.

In other words, the algorithm examines


to the candidate
list.

adds arcs emanating from them

Once
minor

the algorithm has formed the candidate

list

in a

major

iteration,

it

performs
list

iterations,

scanning

all

candidate arcs and choosing a nonbasic arc from this

that violates the optimality condition the

most

to enter the basis. that

As we scan

the arcs,

we

ufxiate the candidate

list

by removing those arcs

no longer

violate the optimality


limit

conditions.

Once
minor

the

list

becomes empty or we have reached a specified


be performed
at

on the
list

number

of

iterations to
iteration.

each major iteration,

we

rebuild the

with another major

116

Leaving Arc

Suppose we
basis

select the arc (k,

1)

as the entering arc.

The addition
is

of this arc to the


to as the

B forms

exactly one (undirected) cycle

W, which

sometimes referred
(k, /) if (k, /)

pivot cycle.

We

define the orientation of


(k, /) if Oc,

opposite to the orientation of


sets of arcs in

/)

W as the same as that of L, and e U. Let W and W respectively, denote the


,

around

W along and opposite to the cycle's orientation. Sending additional flow the pivot cycle W in the direction of orientation strictly decreases the cost of
its

the current solution.


cycle

We
(i, j)

change the flow as much as possible

until

one of the arcs

in the

W reaches
5j:

its

lower or upper bound;


e

this arc leaves the basis.

The maximum flow


is

change

on an arc

W that satisfies the flow bound constraints


,

|Uj:

X|:

if (i, j)

W,

^j=[Xi;,

if(i,j)eW.
e

We
W.
If P(i)

send 6 = min

{5jj

(i, j)

W)

units of flow

around W, and
is

select

an arc

(p, q)

with 5pQ = 6 as the leaving

arc.

The

crucial operation in this step


in the basis

to identify the cycle

denotes the unique path

from any node


- (P(k)

to the root

node, then

this cycle consists of the arcs {(((k,

/)}

P(k)

P(/))

P(/))).
P(/).

In other words,

consists of the arc

(k,

/)

and the

disjoint portions of P(k)

and

Using predecessor

indices alone permits us to identify the cycle

W as
/

follows.

Start at

node k and using


all

predecessor indices trace the path from this node to the root and label
this path.

the nodes in

Repeat the same operation for node

until

we

encounter a node already


is

labeled, say

node w. Node w, which we might


/.

refer to as the apex,

the

first

common
P(/)

ancestor of nodes k and


to

The

cycle
/).

W contains the portions of the path P(k) and


This method
is efficient,

up
It

node w, along with the

arc (k,

but

it

can be improved.

has the drawback of backtracking along some arcs that are not in
the portion of the path P(k) lying between the apex

W, namely,

those in

and the

root.

The simultaneous

use of depth and predecessor indices, as indicated in the following procedure, eliminates
this extra

work.

117
*
'

procedure IDENTIFY CYCLE;


,

begin
i
:

= k and
i

/;

while

^ j do

begin
if

depth(i) > depth(j) then


if

pred(i)
j
:

else

depth(j)

> depth(i) then


j
:

= pred(j)

else

= pred(i) and

pred(j);

end;

w
end;

i;

A
/.

simple modification of

this

procedure permits
first

it

to determine the flow 6 that

can be augmented along

W as

it

determines the

common
W,

ancestor

of

nodes k and

Using predecessor indices

to again traverse the cycle

the algorithm can then update


in the

flows on arcs.
typically

The

entire flow

change operation takes CKn) time

worstose, but

examines only a small subset of the nodes.

Basis

Exchange
In the terminology of the simplex

method, a basis exchange


it is

is

a pivot operation.

If

6 = 0, then the pivot


if

is

said to be degenerate; otherwise


its

nondegenerate.

basis

is

called degenerate

flow on some basic arc equals

lower or upper bound, and

nondegenerate otherwise.
basis.

Observe

that a degenerate pivot occurs only in a degenerate

Each time the method exchanges an entering arc

(k, /) for

a leaving arc (p, q),

it

must update the basis structure. If the leaving arc is the same as the entering arc, which would happen when 6 = uj^j the basis does not change. In this instance, the arc (k,J)
,

merely moves from the


the entering arc, then

set

to the set

U, or vice versa.

If

the leaving arc differs from

becomes

more extensive chmges are needed. In this instamce, the arc (p, q) nonbasic arc at its lower or upper bound depending upon whether Xpg = or
Oc,
/)

Xpg = Upg. Adding


that is again a

and deleting
tree.

(p, q)

from the previous basis yields a

new

basis

spanning

The node

potentials also

change and can be updated as

follows.

The deletion
Note

of the arc (p, q) from the previous b<isis partitions the set of nodes
,

into

two subtrees one, T^ containing the


that the subtree

root node,

and the

other, T2, not containing


q.

the root node.

T2 hangs from node p or node

The

arc (k,

/)

has

118

one endpoint
Cjj - 7t(i)

in

T-j

and the other

in T2.

As

is

easy to verify, the conditions n(l) =

0,

and

7t(j)

for all arcs in the

new

basis imply that the potentials of

nodes

in the

subtree T^ remain unchanged, and the potentials of nodes in the subtree T2 change by a

constant amount.
-

If

k e T^ and

e T2,

then

all

the

node potentials
Cjj.

in

T2 change by

Cj^/

if

e T|

and k T2, they change by the eimount


indices,

The following method, using

the thread

and depth

updates the node potentials quickly.

procedure
begin
if

UPDATE POTENTIALS;
: :

q e T2 then y = q else y =
:

p;

if k e T| then change =
7t(y)

Cjj else

change = Cjj
:

7t(y)

+ change;

= thread(y);

while depth(z) < depth(y) do

begin
7c(z)
:

7:(z)

+ change;

= thread (z);

end;
end;

The

final step in the basis

exchange

is

to ujxiate various indices.

This step

is

rather involved and

we

refer the reader to the reference material cited in Section 6.4 for
it is

the details.
time.

We

do

note, however, that

possible to update the tree indices in 0(n)

Termination

The network simplex algorithm,


to another until
(5.11).
It is
it

as just described,

moves from one

basis structure

obtains a basis structure that satisfies the optimality conditions (5.9)-

easy to
is

show

that the algorithm terminates in a finite

number

of steps

if

each

pivot operation

nondegenerate.

Recall that

cj^/

represents the net decrease in the


(in

cost per unit flow sent


0),

around the cycle W. During a nondegenerate pivot


is

which 6 >

the

new

basis structure has a cost that

61

cy

units lower than the previous basis

structiire.

Since there are a finite

number

of basis structures

and every

basis structure

has a unique associated

cost, the

network simplex algorithm

will terminate finitely

assunung nondegeneracy. Degenerate

pivots, however, pose theoretical difficulties that

we address next.

119

Strongly Feasible Bases

The network simplex algorithm does not


of iterations unless

necessarily terminate in a finite

number

we impose an
an

additional restriction on the choice of entering and

leaving arcs. Researchers have constructed very small network examples for which poor

choices lead to cycling,

i.e.,

infinite repetitive
is

sequence of degenerate pivots.

Degeneracy

in

network problems

not only a theoretical issue, but also a practical one.


in

Computational studies have shown that as many as 90% of the pivot operations

common
runs

networks can be degenerate. As

we show

next,

by maintaining a

special type of

basis, called a strongly feasible basis, the


feister in

simplex algorithm terminates

finitely;

moreover,

it

practice as well.

Let (B, L, U) be a basis structure of the


data.

minimum

cost flow

problem with

integral

As

earlier,

we

conceive of a basis tree as a tree hanging from the root node. The

tree arcs either are

upward pointing (towards the root) or are downward pointing (away from
(B, L,

the root).
positive

We

say that a basis structure


of flow from

U)

is

strongly feasible

if

we

can send a

amount

any node

in the tree

to the root along arcs in the tree

without violating any of the flow bounds.


feasible basis.
its

See Figure 5.2 for an example of a strongly

Observe

that this definition implies that

no upward pointing
at its

eirc

can be at

upper bound and no downward pointing arc can be

lower bound.
for avoiding cycling in the

The

perturbation technique

is

well-known method

simplex algorithm for linear programming.


hand-side vector so that every
convert an

This technique slightly pertvirbs the right-

fecisible basis is

nondegenerate and so that

it

is

easy to

optimum

solution of the perturbed problem to an

optimum

solution of the

original problem.

We show

that a particular perturbation technique for the

network

simplex method
basis technique.

is

equivalent to the combinatorial rule knov^Ti as the strongly feasible

The minimum cost flow problem can be perturbed by changing the supply/demand vector b to b+E We say that e = (Ej, , t^) is a feasible perturbation
.

... ,

if it

satisfies the

following conditions:

(i)

Ej

> n

for all

2, 3,

...

n;

(ii)
i

1
= 2

ti

<

1;

ard

120

r
(iii)

El

^^

= 2
is Cj
,

One
E|

possible choice for a feasible perturbation


).

= 1/n
with

for

2,

...

n (and thus

= -{n - l)/n

Another choice

is Ej

= a* for

2,

...

n,

o chosen

as a very small
justification

positive number.

The perturbation changes the flow on


for the

basic arcs.

The

procedure

we gave

Compute-Flows,

earlier in this section, implies that

perturbation of b by e changes the flow on basic arcs in the following maimer:

1.

If

(i, j)

is

downward

pointing arc of tree

B and

D(j) is the set of descendants of

node
Ei,

j,

then the perturbation decreases the flow in arc


the resulting flow

(i, j)

by

kD(j)
1,
is

Ew-

Since

<

keD(j)

<

nonintegral and thus nonzero.

2.

If

(i, j)

is

an upward pointing

arc of tree

B and
in arc

D(i)

is

the set of descendants of

node
El.

i,

then the perturbation increases the flow


the resulting flow
5.2.

(i, j)

by
k

El.-

Since

<

<

rXi)

k CKi)

1,

is

nonintegral and thus nonzero.


(B, L.

Theorem

For any basis structure

U) of

the

minimum

cost flow problem, the following

statements are equivalent:


(i)

(B, L,

U)

is

strongly feasible. pointing arc of the basis bound.


is

(ii)

No upward
the basis
(B, L,
is

at its

upper bound and no downward pointing arc of

at its lower

(iii)

U)
L,

is

feasible if

we

replace b

by b+e, for any feasible perturbation e


replace
b

(iv)

(B,

U)

is

feasible
...
,

if

we

by

b+e,

for

the

perturbation

e = (-(n-l)/n, 2/n, 1/n,

1/n).

Proof,

(i)

(ii).

Suppose an upward pointing arc

(i, j)

is

at its

upper bound. Then node


basis.

cannot send any flow to the root, violating the definition of a strongly feasible
the

For

same
=^

reason,

no dov^mward pointing arc can be


that
(ii) is

at its

lower bound.

(ii)

(iii).

Suppose

true.

As noted
strictly

earlier,

perturbation increases the flow on

an upward pointing arc by an amount

between
than
its

and

1.

Since the flow on an

upward pointing

arc

is

integral

and

strictly less

(integral) upp>er

bound, the

perturbed solution remains feasible.


perturbed the problem,

Similar reasoning

shows

that after

we have

downward

pointing arcs also remain

feeisible.

121

(iii)

=>

(iv).

Follows directly because e = (-(n-l)/n, 1/n, 1/n,

...

1/n)

is

a feasible

perturbation.

(iv)

=*

(i).

Consider the feasible basis structure

(B, L,

U) of the perturbed problem. Each

arc in the basis

B has a
If

positive nonintegral flow.


the p>erturbation

Consider the same basis tree for the


replace

original problem.

we remove

(i.e.,

b +

by

b),

flows on the
the
U|:

downward
upward

pointing arcs increase, flows on the

resulting flows are integral.


for
pxjinting arcs,

Consequently,
(B, L,

x^:

upward pointing arcs decreaise, and > for downward pointing arcs, x^; <

and

U)

is

strongly feasible for the origiruil problem.

This theorem shows that maintaining a strongly feasible basis

is

equivalent to

applying the ordinary simplex algorithm to the perturbed problem. This result implies
that both

approaches obtain exactly the same sequence of basis structures

if

they use the


that

same

rule to select the entering arcs.

As

a corollary, this equivalence

shows

any

implementation of the simplex algorithm that maintains a strongly feasible basis


performs
at

most

nmCU

pivots.
( -

To

establish this result, cortsider the perturbed


...
,

problem

with the perturbation e =

(n-l)/n, 1/n, 1/n,

1/n).

With

this perturbation, the flow


leeist

on every arc

is a

multiple of 1/n. Consequently, every pivot operation augments at


at least

1/n units of flow and therefore decreases the objective function value by
units.

1/n

Since

mCU

is is

an upper bound on the objective function value of the starting


a lower

solution

and zero

bound on

the

minimum

objective function value, the

algorithm will terminate in at most


of

nmCU

iterations.

Therefore, any implementation


feasible

the

simplex

algorithm

that

maintains a

strongly

basis

runs

in

pseudopolynomial time.

We can
e.

thus maintain strong feasibility by f>erturbing b by a suitable perturbation


is

However, there

no need

to actually

perform the perturbation.


is

Instead,

we

can

maintain strong feasibility using a "combinatorial rule" that


the original simplex

equivalent to applying

method

after

we have imposed

the perturbation.

Even though

this

rule permits degenerate pivots,

it is

guaranteed to converge.

Figure 5.2 will illustrate

our discussion of

this

method.

Combinatorial Version of Perturbation

The network simplex algorithm


described earlier to construct the

starts

with a strongly feasible basis. The method

initial basis

always gives such a

basis.

The algorithm

selects the leaving arc in a degenerate pivot carefully so that the next basis is also

122

feasible.
first

Suppose

that the entering arc (k,


/.

/) is

at its

lower bound and the apex

w
/).

is

the

common
tree.

ancestor of nodes k and

Let

W be the cycle formed by adding arc


same
as that of arc
(k,
i.e.,
it

(k, /) to

the basis

We define
5jj

the orientation of the cycle as the

After
in the
If

updating the flow, the algorithm


cycle

identifies the blocking arcs,


is

those arcs

(i, j)

W that satisfy

5.

If

the blocking arc


arc,

unique, then

leaves the basis.

the
i.e.,

cycle contains

more than one blocking

then the next basis will be degenerate;

some

basic arcs will be at their lower or

upper bounds.

In this case, the algorithm selects

the leaving arc in accordance with the following rule:

Combinatorial Pivot Rule.


method,
pivot cycle

select the leaving arc as the last blocking arc,

W along

its

introducing an arc into the basis for the network simplex say arc (p, q), encountered in traversing the orientation starting at the apex w.

When

We next
do
so,

show

that this rule guarantees that the next basis

is

strongly feasible. To

we show

that in this basis every

node

in the cycle

W can send positive flow to the


W between the
let
its

root node.

Notice that since the previous basis was strongly feasible, every node could
to the root

send positive flow

node. Let

W^

be the segment of the cycle


orientation.

apex

w and arc
-

(p, q),

when we

traverse the cycle along

Further,

W2 =
for

W|

{(p, q)).

Define the orientation of segments

W^ and W2 to
W, no
arc in

be compatable vdth

the orientation of

W. See

Figure 5.2 for an illustration of the segments


the last blocking arc in

W|
is

and

W2

our example.

Since arc

(p, q) is

W2

blocking and

every node contained in the segment


orientation of

W2

and

via

node w.
If

W2 can send positive flow to the root along the Now consider nodes contained in the segment W^.

We

distinguish

two

cases.

the current pivot


of

augmented
segment
via

a positive

amount

was a nondegenerate pivot, then the pivot flow along the arcs in Wj; hence, every node in the
to the orientation of

W^

can augment flow back to the root opposite


If

W^

and
in

node w.

the current pivot

was

a degenerate pivot, then

W^

must be contained

the segment of
feasibility,

between node

and node
/

k,

because by the property of strong

every node on the path from node

to

node

w can send a

positive

amount

of

flow to the root before the pivot and, thus, no arc on

this

path can be a blocking arc in a

degenerate pivot.

Now
must

observe that before the pivot, every node in


therefore, since the pivot does not

W^

could send

positive flow to the root and,

change flow values,

every node in

W^

be able to send positive flow to the root after the pivot as well.
is

This conclusion completes the proof that the next basis

strongly feasible.

We now

study the

effect of the basis


(k,
/)

degenerate pivot. Since arc


arc belongs to the path

enters the basis


to

change on node potentials during a at its lower bound, cj^j < 0. The leaving
lies in

from node k

node w. Hence, node k

the subtree

T2 and

123

the potentials of

all

nodes

in

T2 change by the amount - c^j >

0.

Consequently,

this

degenerate pivot

strictly increases the

sum

of all

node potentials (which by our prior


potentials
is

assumptions
the

is

integral).

Since the

sum

of all

node

bounded from below,

number
So

of successive degenerate pivots

is finite.

far

we have assumed

that the entering arc is at its

lower bound.

If

the entering

arc (k,

/)

is at its

upper bound, then we define the orientation of the cycle


(k,
/).

W as opposite to
its

the orientation of arc

The

criteria to select the

leaving arc remaii\s unchanged-the

leaving arc
starting at

is

the

Icist

blocking arc encountered in traversing

along

orientation

node w.
in

In this case,

node

is

contained in the subtree T2 and, thus, after the


Cj^^j
;

pivot

all

nodes

T2 again increase by the amount of the

consequently, the pivot again

increases the

sum

node

potentials.

Complexity Results

The strongly

feasible basis technique implies

some

nice theoretical results about


i.e.,

the network simplex algorithm implemented using Dantzig's pivot rule,


the arc that most violates the optimality conditions (that
is,

pivoting in

the arc

(k,

/)

with the largest


This technique

value of

Cj^j

among

all

arcs that violate the optimality conditions).

also yields polynomial lime simplex algorithms for the shortest path

and assignment

problems.

We

have already shown that any version of the network simplex algorithm

that

maintairis a strongly feasible basis performs

O(nmCU)

pivots.

Using Dantzig's pivot rule


to

and geometric improvement arguments, we can reduce the number of pivots

0(nmU

log H), with

defined as
e

mCU. As
...

earlier,
,

we

consider the perturbed


z*^

problem with perturbation


function value

= (-(n-l)/n, 1/n, 1/n,

1/n). Let

denote the objective

of the perturbed

minimum

cost flow

problem
(B, L,

at the k-th iteration of the

simplex algorithm, x denote the current flow, and


structure.

U) denote the current

basis

Let
arc.

A >
If

denote the

maximum

violation of the optimality condition of

any

nonbasic

the algorithm next pivots in a nonbasic arc corresponding to the

maximum
Hence,

violation, then the objective function value decreases

by

at least

A/n

units.

^k.^k+l^^/n

(513)

We now

need an upper bound on the


It is

total

possible
that

improvement

in the

objective function after the k-th iteration.

easy to

show

124

ap>exw

(3,4)

(2,2)

0,5)

(0,5)

Entering arc

Figure

5.2.

strongly feasible basis.


(x^:, Ujj).

The figure shows the flows and


is (9, 10);

capacities

represented as

The entering

arc

the blocking arcs are

(2, 3)

and

(7, 5);

and the leaving

arc

is (7, 5).

This pivot

is

a degenerate pivot.

The segments W^ and

W2

are as shown.

125

(i,j)e

'

'

(i,j)

A^

ieN

Since the rightmost term in this expression

is

a constant for fixed values of the

node

potentials, the total

improvement with respect

to the objective function

C:: x;'

(i,j)A^
is

equal

to

the

total

improvement
Further,
the

with

respect

to in

the
the

objective
objective

function

c;; x;;.
''

total

improvement

(i,j)A'^
function

Cj; Xj; is

bounded by

the total
.'"

improvement

in the following relaxed

(i, j)

'

'

problem:

minimize
subject to

X
{i,j)6

C;; x;;,

(514a)

1]

<

xjj

<

Ujj,

for all

(i, j)

A.

(5.14b)

For a given basis structure (B, L, U), we construct an optimum solution of (5.14) by setting Xj; = u^ for all arcs (i, j) L vdth Cj: < 0, by setting xj: = for all arcs (i, j) e U

with

Cjj

>

0,

and by leaving

the flow on the basic arcs unchanged. This readjustment of


at

flow decreases the objective function by

most mAU.

We have

thus

shown

that

z^-z^mAU.
Combining
(5.13)

(5.15)

and

(5.15)

we

obtain

nmu
By Lemma
1.1, if

mCU,

the network simplex algorithm terminates in


follows.

0(nmU

log

W)

iterations.
5.3.

We

summarize our discussion as

Theorem

The network simplex algorithm that maintains a strongly

feasible basis

and uses

Dantzig's pivot rule performs

0(nmU

log

H)

pivots.

126

This result gives polynomial time bounds for the shortest path and assignment

problems since both can be formulated as

minimum

cost flow

problems with

= n and

respectively.
to

In fact,

it

is

possible to modify the algorithm

and use the previous


in

arguments
pivots

show
in

that the simplex algorithm solves these

problems

0(n^ log C)

and runs

0(nm

log C) total time.

These results can be found in the references

cited in Section 6.4.

5.7

Right-Hand-Side Scaling Algorithm


ni
.

Scaling techniques are

among

the most effective algorithmic strategies for

designing polynomial time algorithms for the


section,

minimum

cost flow problem.

In this

we

describe an algorithm based on a right-hand-side scaling (RHS-scaling)

technique.
scaling,

The next two

sections present polynomial time algorithms based


cost scaling.

upon

cost

and simultaneous right-hand-side and


is

The RHS-scaling algorithm

an improved version of the successive shortest


in the successive shortest

path algorithm. The inherent drawback

path algorithm

is

that

augmentations

may

carry relatively small

amounts

of flow, resulting in a fairly large


that

number

of augmentations in the worst case.


sufficiently large

The RHS-sc<iling algorithm guarantees

each augmentation carries

flow and thereby reduces the number of

augmentations substantially.

We
i.e.,

shall illustrate

RHS-scaling on the uncapacitated


Uj:

minimum

cost flow problem,

problem with

for each

(i,

j)

e A.
it

This

algorithm can be applied to the capacitated

minimum

cost flow

problem
2.4).

after

has been

converted into an uncapacitated problem (as described in Section

The algorithm uses the pseudoflow


Section
5.4.
It

and the imbalances

e(i)

as defined in

performs a number of scaling phases.

Much
A be

as

we did

in the excess scaling

algorithm for the


either
2' (i)

maximum
for all
i,

flow problem,
(ii)

we

let
i,

the least

power

of 2 satisfying
Initially,
is
:

e(i)

< 2A

or

e(i)

> -2A

for all

but not necessarily both.

A=

'S

'.

This definition implies that the


is

sum

of excesses
{ i
:

(whose magnitude
)

equal to

the

sum

of deficits)

bounded by 2nA.

Let S(A) =

e(i)

^A

and

let

T(A) =
0.

{ j

e(j)

< -A

).

Then

at the

beginning of the A-scaling phase, either S(2A) =

or T(2A) =

In the given
i

A-scaling phase,

we perform

number

of augmentations, each from a


carries

node

c S(A) to a

node
j

T(A),

and each of these augmentations

imits of flow.

The

definition of

implies that within n augmentations the algorithm will decrease

A by

a factor of at
scaling

least 2.

At

this point,

we

begin a

new

scaling phase.

Hence, within

Odog U)

127

phase,

A <

1.

By

the integrality of data,

all

imbalances are

now

zero and the algorithm

has found an

optimum

flow.

The driving

force behind this scaling technique

is

an invariant property (which


is

we

will

prove

later) that

each arc flow in the A-scaling phase

a multiple of A. This flow that

invariant property

and the connectedness assumption (A5.2) ensure


in S(A) to a

we

can always

send A units of flow from a node


description
is

node

in T(A).

The following algorithmic

a formal statement of the RHS-scaling algorithm.

algorithm RHS-SCALING;

begin
X
:= 0, e := b,

>

let

n be the shortest path distances in G(0);


U1;

,^ 2f log

while the network contains a node with nonzero imbalance do


begin

S(A):={i N:e(i)^A);
T(A)
:=
{ i

e(i)

< -A

);

while S(A) *

and T(A) * e do

begin
select a

node k e S(A) and

node / e

T(A);
all

determine shortest path distances d from node k to


in the residual

other nodes

network G(x) with respect

to the

reduced costs

let

P denote

the shortest path from

node k

to

node

/;

update n:=n-d;

augment A
update
end;
X,

units of flow along the path P;

S(A)

and

T(A);

A := A/2;
end;
end;

The RHS-scahng algorithm


A-scaling phcise,
to a
it is

correctly solves the

problem because during the

able to send

units of flow

on the shortest path from a node k SiA)


result.

node / e

T(A). This fact follows

from the follovdng

128

Lemma

5.2.

The residual

capacities of arcs in the residual

A
Proof.
initial

network are always integer multiples of

We

use induction on the number of augmentations and scaling phases.

The
Each

residual capacities are a multiple of

A because they
or

are either

or .

augmentation changes the residual capacities by


hypothesis.
hypothesis.

units

and preserves the inductive

decrease in the scale factor by a factor of 2 also preserves the inductive

This result implies the conclusion of the lemma.

Let

S(n,

m, C) denote the time

to solve a shortest path

problem on a network

with nonnegative arc lengths.

Theorem 5.4. The RHS-scaling algorithm correctly computes a minimum cost flow and performs 0(n log U) augmentations and consequently solves the minimum cost flow problem in 0(n log U
Sin, m,

O)

time.

Proof.

The RHS-scaling algorithm

is

a special case of the successive shortest path cost flow.

algorithm and thus terminates with a

minimum

We show

that the algorithm

performs
l+Flog

at

most n augmentations per scaling phase.

Since the algorithm requires

Ul

seeding phases, this fact

would imply

the conclusion of the theorem. or T(2A) =


0. 0.

At the

beginning of the A-scaling phase, either S(2A) =

We

consider the case

when
phase,

S(2A) =
I

0.

A
n.

similar proof applies

when

T(2A) =

At the beginning of the scaling


i

S(A)

<

Observe

that

A<
at a

e(i)

< 2A for each node


deficit,

e S(A).

Each augmentation

starts at a

node
it

in S(A),
I

ends
I

node with a

and

carries

units of flow;
at

therefore,

decreases

S(A)

by one. Consequently, each scaling phase can perform

most n augmentations.

Applying the scaling algorithm


problem introduces some

directly to the capacitated

minimum

cost flow

subtlety, because
fails to

Lemma

5.2

does not apply for

this situation.

The inductive hypothesis

be true

initially since the residual capacities

are

or

Uj;.

As we noted
problem
is

previously, one

method of solving the


problem

cajjacitated

minimum

cost flow

to first transform the capacitated


2.4.

to

an uncapacitated one using the

technique described in Section

We

then apply the RHS-scaling algorithm on the

transformed network.

The transformed network contains

n+m

nodes, and each seeding

phase performs

at

most

n+m

augmentations.

The

shortest path

problem on the

transformed problem can be solved (using some clever techniques) in S(n, m, C) time.

Consequently, the RHS-scaling algorithm solves the capacitated

minimum
in

cost flow

problem

in

0(m

log

U S(n,

m,

O)

time.

recently developed

modest variation of the


problem

RHS-scaling algorithm solves the capacitated

minimum

cost flow

0(m

lof^

129

(m + n

log n)) time.

This method

is

currently the best strongly

polynomial-time

algorithm for solving the

minimum

cost flow problem.

5.8.

Cost Scaling Algorithm

We now
maximum

describe a cost scaling algorithm for the

miiumum

cost flow problem.

This algorithm can be viewed as a generalization of the preflow-push algorithm for the

flow problem.

This algorithm relies on the concept of approximate optimality.

flow x

is

said to

be e -optimal for some


conditions.

>

if

x together with

some node

potentials n satisfy the following

C5.7
C5.8.

(Primal feasibility) x
(e -EHial feasibility)

is Cj;

feasible.

-e for

each arc

(i, j)

in the residual

network G(x).

We
The
Cjj

refer to these conditions as the e -optimality conditions.

These conditions are

a relaxation of the original optimality conditions e -optimality conditions permit -e

<

Cj;

<

for

and reduce to C5.5 and C5.6 when e is 0. an arc (i, j) at its lower bound and e S
is

>

for

an arc

(i, j)

at its

upper bound, which

a relaxation of the usual optimality

conditions.

The

follovsdng facts are useful for analysing the cost scaling algorithm.
is

Lemma

5.3.

Any feasible flow

e -optimal for

ekC. Any

e -optimal feasible flow for

E<l/n

is

an optimum flow.

Proof.

Clearly,

any

feasible flow with zero


1

node

potentials satisfies C5.8 for e


feasibility conditior

^ C.

Now

consider an e-optimal flow with e <

/n.

The e-dual

imply that for


all

any directed cycle

W in the residual network,

i^

C;:

C;;^-n>-l. Since

arc costs are integral, this result implies that

(i, j)

X W' ^ 6
^\\

0.

Hence, the residual network

contaii no negative cost cycle and from

Theorem

5.1

the flow

is

optimum.

The

cost scaling algorithm treats e as a parameter


e.

and

iteratively obtains e-optimal

flows for successively smaller values of

Initially e

= C, and

finally e

< 1/n. The

algorithm perfom\s cost scaling phases by repeatedly applying an Improve-Approximation

procedure that transforms an e-optimal flow into an e/2-optimal flow. After l+Tlog nCl

130

cost scaling phases, e

< 1/n and the algorithm terminates with an optimum flow. More

formally,

we

can state the algorithm as follows.

algorithm

COST SCALING;
and
e := C;

begin
j:

:=

let

X be any feasible flow;


1

while e S

/n do

begin

IMPROVE- APPROXIMATION-I(,
E:=/2;
end;
X
is

x,

re);

an optimum flow for the

minimum

cost flow problem;

end;
i

The Improve-Approximation procedure transforms an


E/2-optimal flow.
It

e -optimal flow into

an

does so by
is

(i) first

converting an e -optimal flow into an 0-optimal


if it satisfies

pseudoflow

(a

pseudoflow x
(ii)

called e -optimal

the e -dual feasibility

conditions C5.8), and then

gradually converting the pseudoflow into a flow while


feasibility conditions.

always maintaining the e/2-dual


active

We
if

call a

node
c^;

with
0.

e(i)

>

and

call

an arc

(i, j)

in the residual

network admissible

-e/2 <

<

The

basic
shall

operations are selecting active nodes and pushing flows on admissible arcs.
see later that pushing flows on admissible arcs preserves the e/2-dual
conditions.

We

feasibility

The Improve-Approximation procedure uses the following subroutine.

procedure PUSH/RELABEL(i);
begin
if

G(x) contains an admissible arc

(i, j)

then

push 6
else
Jt(i)

:=

min

e(i), rj:

units of flow from


:

node
>
0);

to

node

:=

7c(i)

+ e/2 + min

c^:

(i, j)

e A(i) and

r^j

end;
Recall that
r^:

denotes the residual capacity of an arc

(i, j)

in G(x).

As
if

in

our earlier
r^;,

discussion of preflow-push algorithms for the

maximum
it

flow problem,

5 =

then

we

refer to the

push as saturating; otherwise

is

nonsaturating.

We

also refer to the


a relabel
bls

updating of the potential of a node as a


operation
is to

relabel operation.

The purpose of

create

new

admissible arcs.

Moreover,

we

use the same data structure

131

used

in the

maximuin flow algorithms


(i, j)

to identify admissible arcs.

For each node

i,

we
i.

maintain a currenl arc

which

is

the current candidate for pushing flow out of


list A(i).

node

The current

arc

is

found by sequentially scanning the arc


of the

The following generic version


summarizes
its

Improve-Approximation procedure

essential operations.

procedure IMPROVE- APPROXIMATION-I(e,


begin
if
Cjj if

x,

Jt);

>

then
Cjj

Xj; :=

else

<

then

Xj: := uj;

compute node imbalances;


while the network contains an active node do
begin
select

an active node

i;

PUSH/RELABEL(i);
end;
end;

The correctness

of this procedure rests on the iollowing result.

Lemma 5.4. The Improve-Approximation procedure always maintains e /2-optimality of the pseudoflow, and at termination yields an e /2-optimal flow.
Proof. This proof
is

similar to that of

Lemma

4.1.

At the beginning of the procedure, the


(in fact,
it

algorithm adjusts the flows on arcs to obtain an E/2-pseudoflow

is

a 0-optiCTiaI
that the

pseudoflow).

We
(j,

use induction on the number of push/relabel steps to

show

algorithm preserves /2-optimality of the pseudoflow. Pushing flow on arc

(i, j)

might

add

its

reversal

i)

to the residual

network. But since -e/2 S


is

Cj;

<

(by the criteria of


c

admissibility),

Cjj

>

and the condition C5.8


i

satisfied for
(i, j)

any value of

>

0.

The

algorithm relabels node

when

Cj;

for every arc


increaise
(i, j)

in the residual network.


{

By our
and
fjj

rule for increasing potentials, after

we

Jt(i)

by e/2 + min
rj:

Cj:

(i, j)

e A(i)

>

0) units, the

reduced cost of every arc


Ji(i)

with

>

still

satisfies

Cj;

^ -e/2.

In

addition, increasing
residual network.

maintains the condition

cj^ t -e/2

for all arc (k,i)

in the

Therefore, the procedure preserves e/2-optimality of the pseudoflow

throughout and,

at termination, yields

an e/2-optimal flow.

132

We
will

next analyze the complexity of the Improve-Approximation procedure.


that the complexity of the generic version is

We
a

show

O(n^m) and then describe

specialized version running in time OCn-^).

These time bounds are comparable


flow problem.

to those

of the preflow-push algorithms for the

maximum

Lemma 5.5. No node potential increases more than 3n times during an execution of the ImproveApproximation procedure.
Proof. Let X be the current /2-optimal pseudoflow and
x'

be the e-optimal flow

at the

end of the previous cost scaling phase. Let n and


to the

n'

be the node potentials corresponding


possible to show, using a variation

pseudoflow x and the flow

x'

repectively.

It is

of the flow decomposition properties discussed in Section 2.1, that for every

node v with

positive imbalance in x there exists a


satisyfing the properties that
(i)

node

with negative imbalance in x and a path P


x,

is

an augmenting path with respect to


x'.

and

(ii)

its

reversal

is

an augmenting path with respect to


exists a
v^ is a

This fact in terms of the residual


...
,

networks implies that there


property that

sequence of nodes v = vq, v^,


its

vj

w
...

with the
-

P = vq

- v-j -

...

path in G(x) and

reversal
to arcs

P = vp

vj.j

V|

is

path

in G(x').

Applying the e/2- optimality conditions


C:;
^

on the path P

in G(x),

we

obtain

^-/(e/2). Alternatively,

(i,j)eP

7i(v)

<

Jt(w)

+ /(e/2) +

Cjj.

(5.16)

apeP^J
Applying the

optimality conditions to arcs on the path

in G(x'),

we obtain
(5.17)

7l'(w)

<

7t*(v)

I
(j,i)

_C;;

7t'(v)

/ -

C;;.

P^'

(i,j)eP'J

Combii\ing

(5.16)

and
+

(5.17) gives

Jt(v)

<

n'(v)

(7c(w)

n'(w))

(3/2)/.

(5.18)

Now we use
n,

the facts that

(i)

k(w) =

it'(w) (the potentials of


it

a node with a negative


(ii) /

imbalance does not change because the algorithm never selects

for push/relabel),
units.

<
is

and

(iii)

each increase in potential increases

Ji(v)

by

at least

e/2

The len\ma

now

immediate.

133

Lemma
Proof.
that

5.6.

The Improve- AppToximation procedure performs 0(nm) saturating pushes.

This proof

is

similar to that of

Lemma

4.5 ar\d essentially


(i, j),

amounts

to

showing
i

between two consecutive saturations of an arc


j

the potentials of both the nodes

and

increase at least once.

Since any node p>otential increases 0(n) times, the algorithm


resulting in

also saturates

any arc 0(n) times


the

0(nm)

total saturating

pushes.

To bound

number

of nonsaturating pushes,

we need one more

result.

We
The

define the admissible network as the network consisting solely of admissible arcs.

following result

is

crucial to analyse the complexity of the cost scaling algorithms.


is

Lemma
Proof.

5.7.

The admissible network

acyclic throughout the cost scaling algorithms.

We

establish this result


relabels.
is

by an induction argument applied

to the

number

of

pushes and

The

result

is

true at the beginning of each cost scaling phase because

the pseudoflow

0-optimal and the network contains no admissible arc.


(i, j)

We

always
(j, i)

push flow on an

arc

with
Cjj

Cj:

<

0;

hence,

if

the algorithm adds


create

its

reversal

to

the residual network, then

>

0.

Thus pushes do not

new
node

admissible arcs and


i

preserve the inductive hypothesis.


admissible arcs
(i, j),

relabel operation at

may

create

new

but
(k,

it

also deletes
cj^j

all

admissible arcs

because for any arc

i),

k -e/2 before a relabel

The latter result is true operation, and cj^j ^ after the


(k,
i).

relabel operation since the relabel operation increases

7t(i)

by

at least

e/2 units. Therefore

the algorithm can create no directed cycles.

Lemma

5.8.

The Improve- Approximation procedure performs 0(n m) nonsaturating pushes.


Let g(i) be the
let

Proof (Sketch).

number

of nodes

that are reachable

from node

in the
to

admissible network and

the potential function F =


i

g^i)-

Th^ proof amounts


at

active

showing

that a relabel operation or a saturating

push can increase F by


1

most n units

and each nonsaturating push decreases F by


at

at least

unit.

Since the algorithm performs


5.5

most 3n2

relabel operations

and 0(nm) saturation pushes, by Lemmas


of

and

5.6,

these observations yield a

bound

O(nTn) on

the

number

of nonsaturating pnjshes.

As

in the

maximum
is

flow algorithm, the bottleneck operation in the Improvethe noraturating pushes,


to

Approximation procedure

which take O(n^m)

time.

The

algorithm takes 0(nm) time

perform saturating pushes, and the same time to scan


Since the cost scaling algorithm calls Improveresult.

arcs while identifying admissible arcs.

Approximation l+Tlog nCl times, we obtain the following

134

Theorem 5S. The

generic cost scaling algorithm runs in 0(n^Tn log nC) time.

The

cost scaling algorithm illustrates an important connection

between the
Solving

maximum

flow

and

the

minimum
is

cost

flow

problems.

an

Improve-Approximation problem

very similar to solving a

Just as in the generic preflow-push algorithm for the

maximum flow problem. maximum flow problem, the


Researchers have
using
si>ecific order, or

bottleneck operation

is

the

number

of nonsaturating pushes.

suggested improvements based on examining nodes in some


clever data structures.

We

describe one such improvement

called the

wave algorithm.

The wave algorithm


selects active

is

the

same

as the

Improve-Approximation procedure, but

it

nodes

for the push/relabel step in a specific order.

The algorithm uses the


network can

acyclicity of the admissible network.

As

is

well

known, nodes
i

of an acyclic

be ordered so that for each arc

(i, j)

in the

network,

<

j.

It is

possible to determine this


that

ordering, called a topological ordering of nodes, in

0(m)

time.

Observe

pushes do not

change the admissible network since they do not create new admissible
operations, however,

arcs.

The

relabel

may

create

new

admissible arcs and consequently

may

affect the

topological ordering of nodes.

The wave algorithm examines each node


is active,

in the topological order

and

if

the

node

then

it

performs a push/relabel step.


to

When examined

in this order, active

nodes push flow

higher numbered nodes, which in turn push fiow to even higher


so on.

numbered nodes, and

relabel operation

changes the numbering of nodes and


starts to

the topological order, and thus the


to the topological order.

method again
if

examine the nodes according

However,

within n cortsecutive node examinations, the


all

algorithm performs no relabel operation then


excesses and the algorithm obtains a flow.

active

nodes have discharged

their

Since the algorithm requires O(n^) relabel of OCn-^) on the

operations,

we immediately

obtain a

bound

number

of

node

examinations.

Each node examination

entails at

most one nonsaturating push.

Consequently, the wave algorithm performs O(n^) nor\saturating pushes per Improve-

Approximation.

We now describe a
relabel operation.

procedure for obtaining a top)ological order of nodes after each


initial

An

topological ordering

is

determined using an 0(m)


it.

algorithm.

Suppose

that while

examining node
i,

i,

the algorithm relabels

Note

that

after the relabel operation at

node

the network contains

no incoming admissible
i

arc at

node

(see the proof of

Lemma

5.7).

We

then

move node

from

its

present position in

135

the topological order to the


topological ordering of the

first

position.

Notice that this altered ordering

is

a
(i)

new

admissible network. This result follows from the facts


arc;
(ii)

node

has no incoming admissible


j

for each outgoing admissible arc

(i, j),

node

precedes node

in the order;

and

(iii)

the rest of the admissible network does not change

and so the previous order


nodes (possibly
relabels a
eis

is still

valid.
list)

Thus the algorithm maintains an ordered


and examines nodes
it

set of
it

doubly linked

in this order.

Whenever

node

i,

the algorithm
this

moves
at

to the first place in this order


i.

and again

examines nodes in

order starting

node

We
Theorem minimum

have established the following


The
cost scaling

result.

5.6.

approach using the wave algorithm as a subroutine solves the


log

cost flow problem in

0(n^

nC)

time.

5.9.

Double Scaling Algorithm


The double
scaling approach combines ideas from both the RHS-scaling

and

cost

scaling algorithms and obtains an

improvement not obtained by


shall describe the

either algorithm alone.

For the sake of simplicity,

we

uncapacitated transportation network

= 0^^

double scabng algorithm on the N2, A), with Nj and N2 as the sets of

supply and demand nodes respectively.

capacitated

minimum

cost flow

problem can

be solved by

first

transforming the problem into an uncapacitated transportation

problem

(as

described in Section 2.4) and then applying the double scaling algorithm.

The double

scaling algorithm

is
it

the

same

as the cost scaling algorithm discussed

in the previous section except that

uses a more efficient version of the Improvein the previous


to try

Approximation procedure.

The Improve-Approximation procedure

section relied on a "pseudoflow-push" method.

natural alternative

would be

an

augmenting path based method.

This approach would send flow from a node with


i.e.,

excess to a node with deficit over an admissible path,

a path in

which each arc


result in

is

admissible.

natural implementation of this approach

would

0(nm)

augmentations since each augmentation would saturate


5.6,

at least
this

one arc and, by

Lemma
to

the algorithm requires

0(nm)

arc saturations.

Thus,

approach does not seem

improve the O(nTn) bound of the generic Improve-Approximation procedure.

We
number
of

can, however, use ideas

from the RHS-scaling algorithm to reduce the


for

augmentations

to

0(n log U)

an uncapacitated problem by ensuring

that

136

each augmentation carries

sufficiently large flow.

This approach gives us an algorithm


cost scaling phase performs a
is

that does cost scaling in the outer loop

and within each


this

number

of RHS-scaling phases; hence,

algorithm

called the double scaling

algorithm.

The advantage
problem

of the double scaling algorithm, contrasted with solving a

shortest path

in the

RHS-scaling algorithm,
in

is

that the

double scaling algorithm

identifies

an augmenting path
fact,

0(n) time on average over a sequence of n

augmentations. In

the double scaling algorithm app>ears to be similar to the shortest


for the

augmenting path algorithm

maximum

flow problem; this algorithm,

also

requires 0(n) time on average to find each augmenting path.

The double

scaling

algorithm uses the following Improve-Approximation procedure.

procedure
begin

IMPROVE- APPROXIMATION-n(e, x,
and compute node imbalances;
+ E for
,

n);

set X :=
7t(j)

:=

7t(j)

all

N2;

A:=2riogUl;
while the network contains an active node do
begin
S(A) :=
(

Nj

u N2

e(i)

^A

};

while S(A) ^

do

begin OlHS-scaling phase)


select a

node k

in S(A)

and delete

it

from

S(A);
/

determine an admissible path P from node k to some node


with
e(/)

<

0;

augment A
end;

units of flow

on P and update

x;

A := A/2;
end; end;

We

shall describe a

method

to

determine admissible paths after


First, observe that
it(j)

first

commenting
e

on the correctness of

this procedure.

c^;

^
j

-e for all

(i, j)

at the

beginning of the procedure and, by adding e to


optimal
(in fact, a 0-optimal)

for each

e N2/

we

obtain an e/2-

pseudoflow.
5.4, this

The procedure always augments flow on


choice preserves the e/2-optimality of the

admissible arcs and, from

Lemma

pseudoflow. Thus,

at the termination of the procedure,

we

obtain an /2-optimal flow.

137

Further, as in the RHS-scaling algorithm, the procedure maintains the invariant

property that

all

residual capacities are integer multiples of

A and thus each

augmentation can carry A units of flow.

The algorithm
maintain a
partial

identifies

an admissible path by gradually building the path.

We

admissible path

P using

a predecessor index,

i.e., if

(u, v)

P then

prediy)
steps,

u.

At any point
is

in the algorithm,
leist

we perform one
of P, say

of the following

two

whichever
has a

applicable, at the

node

node

i,

terminating

when

the last

node

deficit.

advanced).
e(j)

If

the residual network contains an admissible arc

(i, j),

then add

(i, j)

to P.

If

<

0,

then stop.
the residual network does not contain an admissible arc
{

rctreat(i).
n(i) to
7t(i)

If

(i, j),

then ujxiate
then delete

+ e/2 + min

Cj;

(i, j)

A(i)

and

r^:

>

0).

If

P has

at least

one

arc,

(pred(i),

i)

from

P.

The
creating

retreat step relabels (increases the potential

oO node

for the

purpose of
i)

new

admissible arcs emanating from this node; in the process, the arc (pred(i),

becomes inadmissible.

Hence,

we

delete this arc from P.

The proof

of

Lemma

5.4

implies that increasing the node potential maintaii^s e/2-optimality of the pseudoflow.

We
l+flog
e(i)

next

consider

the

complexity

of

this

implementation

of

the

Improve-Approximation procedure.

Each execution of the procedure performs


i.e.,

Ul RHS-scaling
for each

phases. At the beginning of the A-scaling phase, S(2A) = 0,


i

A<

< 2A

node

e S(A).

During the scaling phase, the algorithm augments A

units of flow from a

node k

in S(A) to a

node

with

e(/)

<

0.

This operation reduces the

excess at node k to a value less then


is less

A and

ertsures that the excess at

node

/,

if

there

is

any,
at

than A.

Consequently, each augmentation deletes a node from S(A) and after


a

most n augmentations, the method begins


performs a
total of

new

scaling phase.

The algorithm thus

0(n log U) augmentations.

We next

coimt the number of advance steps. Each advance step adds an arc to the

partial admissible path,

and

a retreat step deletes


(i)

an arc from the

partial admissible path.

Thus, there are two types of advance steps:

those that add arcs to an admissible path


(ii)

on which the algorithm

later

performs an augmentation; and


is

those that are later

cancelled by a retreat step. Since the set of admissible arcs


at

acyclic (by

Lemma

5.7), after

most n advance steps of the

first

type, the algorithm will discover

an admissible path

138

and

vsdll

perform an augmentation.

Since the algorithm requires a total of 0(n log U)


of advance steps
is

augmentations, the number of the


algorithm performs advance steps

first typ>e

at

most 0(n^ log U). The


retreat

at

most O(n^) of the second type because each

step increases a node potential, and by

Lemma
is

5.5,

node potentials increase

0{t\^) times.

The

total

number

of advance steps, therefore,

0(n^ log U). n

The amount

of time needed to identify admissible arcs

is

0(

i=l

lA(i)ln)

0(nm)

since

between a potential increase of a node

i,

the algorithm will

examine
result.

A(i)

arcs for testing admissibility.

We

have therefore established the following

Theorem 5.7. The double scaling 0((nm + rr log U) log nC) time.

algorithm solves the uncapacitated transportation problem in

To

solve

the capacitated

minimum

cost flow

problem ,we

first

transform

it

into

an uncapacitated transportation problem and then apply the double scaling algorithm.

We

leave

it

as an exercise for the reader to

show

that

how

the transformation permits us

to use the

double scaling algorithm

to solve the capacitated

minimum

cost flow

problem
of the

0(nm

log

log nC) time.

The references describe further modest improvements

algorithm.

For problems that satisfy the similarity assumption, a variant of this

algorithm

using

more sophisticated data

structures

is

currently

the

fastest

polynomial-time algorithm for most classes of the


5.10

minimum

cost flow problem.

Sensitivity Analysis

The purpose
solution of a

of sensitivity analysis cost

is

to

determine changes in the optimum

minimum

flow problem resulting from changes in the data

(supply/demand
practitioners

vector, capacity or cost of

any

arc).

Traditionally, researchers

and

have conducted
There

this sensitivity analysis

using the primal simplex or dual


this

simplex algorithms.

is,

however, a conceptual drawback to


at

approach.

The

simplex based approach maintains a basis tree


aruilysis

every iteration and conducts sensitivity

by determining changes

in the b<isis tree precipitated

by changes

in the data.

The
in

basis in the simplex algorithm

is

often degenerate, though,

and consequently changes

the basis tree

do not

necessarily traiislate into the changes in the solution. Therefore, the

simplex based approach does not give information about the changes in the solution as
the data changes; instead,
it

tells

us about the changes in the

basts tree.

139

We

present another approach for performing serisitivity analysis.

This approach

does not share the drawback

we have

just

mentioned.

For simplicity,

we

limit

our

discussion to a unit change of only a particular type. In a sense, however, this discussion
is

quite general:

it

is

possible to reduce

more complex changes

to a

sequence of the

simple changes
cost flow

we

cor^sider.

We

show

that the sensitivity analysis for the

minimum
flow

problem

essentially reduces to solving shortest path or

maximum

problems.
Let X* denote an

optimum

solution of a
Cj;

minimum
Cj;

cost flow problem.

Let n* be

the corresponding node potentials and


costs.

7C*(i)

7t*(j)

denote the reduced

Further,

let

d(k,

denote the shortest distance from node k


Cj;
.

residual network with respect to the original arc lengths

Since for

node / in the any directed path


to
/ )

P from node k

to

node

/ ,

Z
(i,j)6P
to

^ij

X
(i,j)

Cjj

- K(k)

jt(l),

d(k,

equals the

P
cjj

shortest distance from


jt*(/)
).

node k

node

with respect to the arc lengths


Cj;

plus

7t*(k)

At optimality, the reduced costs

of all arcs in the residual

network are by solving n

nonnegative. Hence,

we

can compute d(k,

/)

for all pairs of

nodes k and

single-source shortest path problems with nonnegative arc lengths.

Supply/Demand

Sensitivity Analysis

We
becomes
problem
of

first

study the change in the supply/demand vector.


of a
1.

Suppose

that the

supply/demand
b(/)

node k becomes bGc) +


(Recall

and the supply/demand


that feasibility of the

of another

node

from Section
b(i)

1.1

minimum

cost flow

dictates that

ie

X N

0;

hence,

we must change

the supply /demand values

two nodes by equal magnitudes, and must increase one value and decrease the
is

other).

Then x*

pseudoflow

for the modified problem;

moreover,

this vector satisfies the

dual feasibility conditions C5.6.

Augmenting one unit

of flow from
this

node k

to

node
into

along the shortest path in the residual network G(x') converts


flow.
5.1

pseudoflow
/ )

Tliis

augmentation changes the objective function value by d(k,


is

units.

Lemma

implies that this flow

optimum

for the

modified minimvmi cost flow problem.

Arc Capacity Sensitivity Analysis

We

next consider a change in an arc capacity. Suppose that the capacity of an arc

(p, q) increases

by one unit

The flow x*

is

feasible for the modified problem. In

140

addition,

if

Cpq S

0,

it

satisfies the optimality


If

conditions C5.2 - C5.4;


0,

hence,

it

is

an

optimum flow

for the modified problem.


its

Cpg <

then condition C5.4 dictates that

flow on the arc must equal


flow on the arc
unit at
(p, q)

capacity.

We
at

satisfy this

requirement by increasing the

by one

unit,

which produces a pseudoflow with an excess of one

node q and

a deficit of

one unit

node

p.

We

convert the pseudoflow into a

flow by augmenting one unit of flow from node q to node p along the shortest path in the residual network which changes the objective function value by an amount Cpg +
d(q, p).

This flow

is

optimum from our observations concerning supply /demand

sensitivity analysis.

When
strictly less

the capacity of the arc (p, q) decreases by one unit

and flow on the arc

is

than

its

capacity, then x* remains feasible,


if

and hence optimun,


capacity,

for the

modified problem. However,

the flow on the arc


of flow

is at its

we

decrease the flow

by one unit and augment one unit


path in the residual network.

from node p to node q along the shortest

This augmentation changes the objective function value

by an amount -Cpn +

d(p, q).

The preceding discussion shows how


solution value
in

to

determine changes in the optimum

due

to unit

changes of any two supply /demand values or a unit change

any arc capacity by solving n single -source shortest path problems.

We can, however,
/)

obtain useful upper bounds on these changes by solving only two shortest path

problems.

This observation uses the


/.

fact that

d(k,

/)

S d{k,

1)

+ d(l,

for all pairs of

nodes k and
1

Consequently,

we need
all

to

determine shortest path distances from node

to all other nodes,

and from

other nodes to

node

to

compute upper bounds on

all

d(k,

/)

Recent empirical studies have suggested that these upper bounds are very

close to the actual values; often these

upper bounds and the actual values are equal, and

usually they are within

5%

of each other.

Cost Sensitivity Analysis


Finally, that the cost of

we

discuss changes in arc costs, which


(p, q)

we assume

are integral. Suppose

an arc

increases by one unit. This change increases the reduced cost


If

of arc (p, q) by one unit as well.

Cpq =

<

before the change, then after the change

c^

<

0.

Similarly,

if

Cpq >

0,

before the change, then

c_

^
if

after the change.

In

both the

Ctises,

we

preserve the optimality conditions. However,


0,

Cpg =

before the
violates the

change and Xp_ >

then after the change

Cpq =

>

and the solution

141

condition C5.2.

To

satisfy the optimality condition of the arc,

we must

either reduce the


(p, q)

flow on arc

(p, q) to zero, or

change the potentiak so

that the

reduced cost of arc

becomes

zero.

We

first try to

reroute the flow

from node p

to

node q without

violating

any of the optimality conditions.


defined as follows:

(i)

We
at

do so by solving
is set

maximum

flow problem

the flow on the arc (p, q)

to zero, thus

creating an excess of

X Pi
sink.

at

node p and

a deficit of x

node

Pi
(iii)

q;

(ii)

define
of

node p as the source node and

node q as the sink node; and

send a

maximum

x__

units from the source to the

We
C5.4.

permit the

maximum

flow algorithm, however, to change flows only on arcs


it

with zero reduced costs, since otherwise

would generate

a solution that violates C5.2

and

Let

v"

denote the flow sent from node p to node q

If

and

x"

denote the

resulting arc flow.

v =

then

denotes a

minimum

cost flow of the

Pi

modified problem. In

this Ccise, the

optimal objective function values of the original and

modified problems are the same.

cut

On the (X, N- X)

other hand,

if

v < x

then the

maximum

flow algorithm yields an

s-t

with the properties that p X, q e

N - X, and
It is

every forward arc in the

cutset with zero

reduced cost has others

at the arc's

capacitated.

We

then decrease the

node
that

potential of every
this

node

in

N-X

by one unit.

eeisy to verify

by case

aruilysis

change

in

node potentials maintains the optimality conditions and,


(p, q) to zero.

furthermore, decreases the reduced cost of arc


the flow on arc (p, q) equal to

Consequently,

we
v"

can set
In

x^

- v and obtain a feasible

minimum
is

cost flow.

this case, the objective function

value of the modified problem

x_,

units

more than

that of the original problem.

5.11

Assignment Problem

The assignment problem


special cases of the

is

one of the best-known and most intensively studied

minimum
is

Section
(
I

1.1

this

problem
,

network flow problem. As already indicated in defined by a set N|, say of f)rsoris, a set N2, say of objects
cost

Nj

N2 = n)
1

a collection of

node

pairs

A C Nj

N2

representing possible person(i, j)

to-object assignments,
in A.

and a

cost

Cj;

(possibly negative) associated with each element

The

objective

is

to assign each person to

one object

choosing the assignment with

142

minimum
program:

possible cost.

The problem can be formulated as the following

linear

Minimize

2(i, j)

Cj;X::

(5.18a)

'

subject to

{j

(i. j)

X e A) =l,foraUi
X::
Xji

N-i,

(5.18b)

(i

(i, j)

X X) =l,foraUje N2,
xjj

(5.18c)

0,

for all

(i, j)

A.

(5.1 8d)

The assignment problem is with node set N = N| u N2, arc


=
1 if
i

minimum

cost flow
Cj;,

set

A, arc costs

problem defined on a network and supply /demand specified as


has 2n nodes <md

b(i)

N| and

b(i)

=
is

-1 if

e N2. The network

m= A
|

arcs.

The assignment problem

also

known

as the bipartite matching problem.

We
Xjj
^

use the following notation.


i

0-1 solution x of (5.18) is

an assignment.
"ii {j:(i,j)eA)

If

1,

then

is

assigned to

and

is

assigned to

i.

A 0-1

solution x satisfying

for all

Ni and

''ii

1 fo'" 3^'

No
X
.

is

called a partial assignment.

Associated

{i:(i,j)e

A)
is

with any partial assignment x

an index

set

defined as

X=

{(i, j)

x^;

1}.

node

not assigned to any other node

is

unassigned.

Researchers have suggested numerous algorithms for solving the assignment

problem. Several of these algorithms apply, either explicitly or implicitly, the successive
shortest path algorithm for the
typically select the initial

These algorithms node potentials with the following values: nii) = for all i e N|
cost flow problem.
all
j

minimum
e N2-

and

7t(j)

= min

{cj;

(i, j)

e A) for

All reduced costs defined by these

node

potentials are nonnegative.

The successive shortest path algorithm solves the

assignment problem as a sequence of n shortest path problems with normegative arc


lengths,

and consequently runs

in 0(n S(n,m,C)) time.

(Note that S(n,m,C)

is

the time

required to solve a shortest p>ath problem with nonnegative arc lengths)

143

The

relaxation approach

is

another popular approach, which

is

also closely related

to the successive shortest path algorithm.

The

relaxation algorithm removes, or relaxes,

the constraint (5.18c), thus allowing any object to be assigned to

more than one


an
object
j

person.

This relaxed problem


smallest
Cjj

is

easy to solve:

assign each person

to

with the

value.

As

a result,

some

objects

may be unassigned and other


a feasible

objects

may be

overassigned.
shortest paths

The algorithm gradually builds


from overassigned objects
to

assignment by identifying

vmassigned objects and augmenting flows on

these paths.

The algorithm solves

at

most n shortest path problems.


it

Because

this

approach always maintains the optimality conditions,


problems by implementations of
runs in 0(n S(n,m,C)) time.
Dijkstra's algorithm.

can solve the shortest path

Consequently, this algorithm also

One
method,
is

well knovkn solution procedure for the assignment problem, the Hungarian

essentially the primal-dual variant of the successive shortest path algorithm.

The network simplex algorithm, with provisions


basis,
is

for maintaining a strongly feasible


is fairly

another solution procedure for the assignment problem. This approach

efficient in practice;

moreover, some implementations of

it

provide polynomial time

bounds.

For problems that satisfy the similarity assumption, however, a cost scaling

algorithm provides the best-knowT> time bound fo- the tissignment problem. Since these

algorithms are special cases of other algorithms


specify their details.

we have

described earlier,

we

will not

Rather, in this section,

we

will discuss a different type of algorithm

based upon the notion of an auction.

Before doing so,

we show

another intimate

connection between the assignment problem and the shortest path problem.

Assignments and Shortest Paths

We

have seen that by solving a sequence of shortest path problems,


Interestingly,

we

can solve

any assignment problem.


assignment problem
so,

we

can also use any algorithm for the

to solve the shortest

path problem with arbitrary arc lengths. To do

we

apply the tissignment algorithm twice.


a negative cycle; and,
if it

The

first

application determines

if

the

network contains
shortest path.

doesn't, the second application identifies a

Both the appbcations use the node splitting transformation described in

Section

2.4.

The node
replaces each arc

splitting tremsformation replaces


(i, j)

each node
(artificial)

by two nodes
(i, i').

and

i',

by an arc

(i,

j),

and adds an

zero cost arc

We

first
:

note that the transformed network always has a feasible solution with cost zero

144

namely, the assignment containing

all

artificial arcs
is

(i,

i').

We
if

next

show

that the

optimal value of the assignment problem

negative

if

and only

the original network

has a negative cost cycle.

First,

suppose the original network contains


{

a negative cost cycle, iy\2 -J3


'
'
* "

...

Jl^-jj.

Then the assigment

negative cost.

^^^ 2 Ok+1 Jk+1^' '^h\' jp^) Therefore, the cost of the optimal assignment must be negative.
(j^,
j

2), (J2

J3)/

(Jk' J])

Conversely, suppose the cost of an optimeil assignment

is
i

negative.

This solution

must contain

at least

one arc of the form


set of

(i,

j')

with

*
{

Consequently, the

assignment must contain a


Qk'
ii

arcs of the form


is
,

PA

(j|

(J2

jo

) /

^'-

^^^

^^^ ^ *^'^ "partial" assignment

nonpositive, because
j,'), (J2
/

it

can be no
^
^

more expensive than

the partial assignment


is

(jj

jA

(Jk- Iv

Since

the optimal assignment cost


negative.

negative,

some

partial

assignment

PA
j|

must be
J2

But then by construction of the transformed network, the cycle

Jk

)l

^ negative cost cycle in the original network.

145

(a)

(b)

Figure

5.3.

(a)

The

original network, (b)

The transformed network.

146

If

the original network contains no negative cost cycle, then

we
n,

can obtain

shortest path

between

a specific pair of nodes, say

from node

to

node

as follows.
1'

We

consider the transformed network as described earlier and delete the nodes
the arcs incident to these nodes.

and n and

See Figure 5.3 for an example of this transformation.


1

Now

observe that each path from node

to

node n

in the original

network has

corresponding assignment of the same cost in the transformed network, and the
converse
is

also true.

For example, the path 1-2-5 in Figure 5.3(a) has the corresponding
in Figure 5.3(b),

assignment
(4,
5'),

((1, 2'), (2, 5'), (3, 3'), (4, 4'))

and an assignment

{(1, 2'), (2, 4'),

(3,

3'))

in Figure 5.3(b) has the corresponding path 1-2-4-5 in Figure 5.3(a).

Consequently, an optimum assignment in the transformed network gives a shortest


path in the original network.

The Auction Algorithm

We now describe an algorithm for the assignment problem known as the auction algorithm. We first describe a pseudopolynomial time version of the algorithm and then
incorporate scaling to

make

the algorithm polynomial time.

This scaling algorithm


1.6.

is

an

instance of the bit-scaling algorithm described in Section

To describe

the auction
this

algorithm,

we

cor\sider the

maximization version of the assignment problem, since

version appears

more

natural for interpreting the algorithm.

Suppose n persons want


is

to

interested in a subset of cars,

buy n and has

cars that are to be sold

by

auction.
j

Each person
(i, j)

a nonnegative utility Uj; for car


utility.

for each
set

A(i).

The

objective
this

is

to find

an assignment with m<iximum


Let

We can

Cj;

-uj;

to

reduce

problem
is

to (5.18).

max
j,

{lu^jl

(i, j)

e A).

At each stage of the


For a given set of
-

algorithm, there

an asking price for car

represented by
i

price(j).
j

asking prices, the


iteration,

marginal utility of person

for

buying car

is U|j

price(j).

At each

an unassigned person bids on a car

that has the highest margir\al utility.


in dollars.

We

assume

that all utilities

and

prices are

measured
a

We
call a

associate with each person

number
-

valued),

which

is

an upper bound on
:

that person's

highest marginal

utility, i.e., value(i)

^ max

{u^: - price(j)

(i, j)

A(i)}.

We
The

bid

(i, j)

admissible

if

valued) = uj:

price(j)

and inadmissible otherwise.


If

algorithm requires every bid in the auction to be admissible.


bid and has no admissible bid, then value(i)
is

person

is

next in turn to

too high and

we

decrease this value to

max

(u^j - price(j)

(i, j)

e A(i)).

147

So the algorithm proceeds by persons bidding on


car
j,

cars.

If

a jjerson

makes

a bid

on

then the price of car


i

goes up by $1; therefore, subsequent bids are of higher value.


j.

Also, person there

is

assigned to car

The person k who was the previous bidder

for car

j,

if

was

one, becomes uneissigned.

Subsequently, person k must bid on another

car.

As

the auction proceeds, the prices of cars increase

and hence the marginal values


is

to the

persons decrease.

The auction stops when each person

assigned a car.
starts

We now
j

describe this bidding procedure algorithmically.


choices for value(i) and
value(i) =
price(j).

The procedure
can
i.

with some valid

For example,

we

set price(j)

for each car

and

max

{u^

(i, j)

A(i)} for

each person

Although

this initialization is

sufficient for the

pseud opolynomial time version, the polynomial time version requires


At termination, the procedure yields an almost

more

clever initialization.
x.

optimum

tissignment

procedure BIDDING(u,
begin
let

x", value, price);

the

initial

assignment be a null assignment;


is

while some person


begin
select
if

unassigned do

an unassigned person
bid
(i, j)

i;

some

is

admissible then

begin
assign person
price(j)
if
:

to car

j;

price(j)

1;

person k was already assigned to car

j,

then

person k becomes unassigned;

end
else update vzJue(i)
:

= max

{uj: - price(j)

(i, j)

A(i)};

end;
let

x be the current assignment;

end;

We now show
of the

that this

procedure gives an assignment whose

utility is

vdthin $n

optimum

utility.

Let x" denote a partial assignment at

some

point during the


Recall that
i,

execution of the auction algorithm and x* denote an


value(i) is

optimum assignment.
utility of

always an upper bound on the highest marginal


-

person

i.e.,

valued) ^

Uj:

price(j) for all

(i, j)

e A(i).

Consequently,

148

X
The
partial

Uji

<

(x,i)eX''

iNi

valued) +

JN2
satisfies the condition

price(j)

(5.19)

assignment \ also
-

value(i) = Ujj

price(j)

1,

for all

(i, j)

e X,

(5.20)

because
priceCj)

at the

time of bidding value(i) =


$1. Let

Uj:

price(j)

and immediately

after the bid,

goesupby
UB(x)=

UB(x) be defined as follows.

(i, j)

Z X e

"ii
^

+
i

I value(i), N
in

(5.21)

with N

denoting the unassigned persons

N^. Using
obtain
n.

(5.20) in (5.21)

and observing

that unassigned cars in

N2

have zero

prices,

we

UB(x^) ^

value(i) +
J

I
e

price(j)

(5.22)

N2

(5.23)

As we show

in

our discussion to follow, the algorithm can change the node

values and prices at most a finite

number

of times. x
is

Since the algorithm v^l either

modify

node value or node

price

whenever

not an assignment, within a finite a complete assignment x".


is

number

of steps the

method must terminate with


utility of this
is at

Then
utility

UB(x) represents the


of the assignment x"

assignment (since Nj
less

empty)

Hence, the

most $n

than the

maximum

utility.

It

is

easy to modify the method, however, to obtain an


all utilities Uj;

optimum assignment.

Suppose we multiply
Since
all utilities

by (n+1) before applying the Bidding procedure.

are

now

multiples of (n+1), two assignments with distinct toted utility

will differ

by

at least

(n+1) units.

The procedure

yields an assignment that

is

within n

units of the

optimum value and,

hence, must be optimal.

We

next discuss the complexity of the Bidding procedure as applied to the


v^ith all
utilities
first

assignment problem
largest utility is

multiplied by (n+1 ).

In this modified problem, the

C = (n+l)C. We

show

that the value of

any person decreases CXnC)

149

times.

Since

all utilities

are nonnegative, (5.23) implies UBCx") S -n.

Substituting this

inequality in (5.21) yields

valued)

^ -n(C' +

1).

ie

No
1

Since valued) decreases by at


that the value of

leist

one unit each time


at

it

changes, this inequality shows

any person decreases


I I

most O(nC') times. Since decreasing the value

of a person
persor\s
is

once takes 0( Ad)


\

time, the total time

needed

to ujxiate Veilues of all

O
ie

Ad)

= O(nmC').

N^

We

next examine the

number

of iterations performed
i

by the procedure.

Each
j.

iteration either decreases the value of a person

or assigns the person to


total.

some

car

By

our previous arguments, the values change O(n^C') times in


value(i) > Uj; - price(j)
after

Further, since
the price of car
j

person
i

hais

been aissigned to car


I

and
I

increases by one unit,

a person
in valued).

can be assigned at most

A(i)

times betvk^een two


of

consecutive decreases
total

This

observation gives us a

bound

O(nmC') on the
the "current

number

of times

all

bidders become ass'.gned.


to locate

As can be shown, using

arc" data structure permits us

admissible bids in O(nmC') time. Since

C = nC,
K

we have
Theorem

established the following result.

5.8.

The auction algorithm solves the assignment problem

in

O(n^mC)
it

time.

The auction algorithm

is

potentially very slow because

can

increase prices

(and thus decreases values) in small increments of $1 and the final prices can be as
large as

n^C

(the values as small as -n^C).

Using a scaling technique

in the auction

algorithm ensures that the prices and values do not change too many times. As in the
bit -scaling

technique described in Section

1.6,

we decompose

the original problem into a

sequence of
algorithm.

Odog nC) assignment problems and


and show

solve each problem by the auction

We

use the optimum prices and values of a problem as a starting solution


that the prices

of the subsequent problem

and values change only CXn) times

per

sctiling phaise.

Thus,

we

solve each problem in

0(nm) time and solve

the original

problem

in

0(nm

log nC) time.

The scaling version of the auction algorithm first multiplies all utilities by (n+1) and then solves a sequence of K = Flog (n+l)Cl assignment problems Pj, ?,
...

150

Pj^

The problem

Pj^ is

an assignment problem
ujj,

in

which the

utility of arc

(i,j) is

the k
if

leading bits in the binary representation of

assuming (by adding leading zeros

necessary) that each

Uj; is

bits long.

In other words, the

problem

Pj^

has the arc


or
1,

utilities u-j= Luj; / 2'^*'^ J.

Note

that in the

problem

Pp

all utilities

are

and

subsequently

k+1
u^-

k = 2u- +

{0 or 1),

depending upon whether the newly added


follows:

bit is

or

1.

The

scaling algorithm

works as

algorithm

ASSIGNMENT;
all Uj;

begin
multiply

by

(n+1);

K: = riog(n+l)Cl
price(j)
:

=
:

for each car

j;

value(i)

=
to

for each person

i;

for k

K do
=
:

begin
let ujj
:

L Ujj /

2^-^J for each

(i, j)

A;

price(j)

= 2
:

price(j) for
(i)

each car
1

j;

value(i)

= 2 value

for each person

i;

BIDDING(uK
end;
end;

x, value, price);

The assignment algorithm performs


scaling phase,
it

number

of cost scaling phtises. In the k-lh

obtains a near-optimum solution of the problem with the utilities

k
u--.
It is

easy to verify that before the algorithm invokes the Bidding procedure, prices
satisfy value(i)

and values

max

{uj; - price(j)

(i, j) e.

A(i)), for
its

each person

i.

The

Bidding procedure maintains these conditions throughout

execution.

In the last

scaling phase, the algorithm solves the assignment problem with

the original utilities


that in each scaling
is

and obtains an optimum solution

of the original problem.

Observe

phase, the algorithm starts with a null assignment; the purpose of each scaling phase
to obtain

good

prices

and values

for the subsequent scaling phase.

We
is

next discuss the complexity of this assignment fdgorithm.

The

crucial result

that the prices

and values change only 0(n) times during each execution of the

151

Bidding procedure.
as

We

define the reduced utility of an arc

(i, j)

in the k-th scaling

phase

_
Ujj

= Ujj

ic

price(j)

value(i).

In this expression, price(j)


calling the

and

value(i)

have the values computed


x,

just before

Bidding procedure. For any assignment

we have
value(i).

y
(i,

_
u;;

=
(i,

ic

U:: j

)U X

X
e

price(j)

jfe X'^

N2

X
e

Nj

Consequently, for a given set of prices and values, the reduced

utility of

an

assignment differs from the

utility of that

assignment by a constant amount. Therefore,


utility also

an assignment that maximizes the reduced


value(i)

maximizes the

utility.

Since

t u-

price(j) for

each

(i, j)

e A,

we have
(5.24)

Uij

<

0, for

aU

(i, j)

e A.

Now
assignment
k-1

consider the reduced

utilities of arcs in the

assignment
(5.20)

x*^"*

(the final

at tie

end of the

(k-l)-st scaling phase).

The equality
V
1

implies that

u.

price'(j)

value'(i)

-1,

for all

(i, j)

x*^"',

(5.25)

where

price'(j)

and

value'(i) are the

corresponding values

at the

end of the

(k-l)-st

scaling phase.

Before calling the Bidding procedure, we set price(j) = 2 price'(j), value(i) k k-1 = 2 value'(i) + 1, and Uj; = 2 u- + (0 or 1). Substituting these relationships in (5.25), we
find that the reduced utilities
Uj; of arcs in x*'"
If
*

are either -2 or

-3.

Hence, the optimum

reduced

utility is at least -3n.

is

some

partial

assignment in the k-th scaling phase,

then (5.23) implies that UBCx") t -4n. Using this result and (5.24) in (5.21) yields

I
icNj

valued) ^-4n.

(5.26)

Hence, for any

i,

valued) decreases 0(n) times.

Using

this result in the

proof of

Theorem

5.7,

we

observe that the Bidding procedure would terminate in 0(nm) time.

The assignment algorithm applies the Bidding procedure Odog nC) times and,
consequently, runs in

0(nm

log nC) time.

We

summarize our discussion.

152

Theorem 5.9. The 0(nm log nC) time.

scaling version of the auction algorithm solves the assignment problem in

The
in

scaling version of the auction algorithin can be further


time.

improved

to

run

0(Vn

m log nC)
If

This improvement
i

is

based on the following implication of


if

(5.26).

we

prohibit person

from bidding

value(i) S

4Vn

then by (5.26)

the

number

of unassigned persons is at
to assign n1

most Vn.
and 0((n
if
-

Hence, the algorithm takes

CXVn m) time

FVn

1 f>ersons

fVn

)m) time to assign the

remaining FVii

persons.
first

For example,

n =

10,000, then the auction algorithm

would assign would assign

the

99%

of the persons in

1%

of the overall running time

and

the remaining

1%

of the persons in the remaining

99%
it

of the time.

We
all

therefore terminate the execution of the auction algorithm

when

has assigned

but

rVn
It

persons

and use successive shortest path algorithms

to assign these

persons.

so happens that the shortest paths have length 0(n) and thus Oial's
3.2, will find

algorithm, as described in Section

these shortest paths in

0(m)

time.

This version of the auction algorithm solves a scaling phase in

0(Vn m) time

and

its

overall running time


this

is

0{-\fn

m log nC).
.

If

we

invoke the similarity


the best

assumption, then

version of the algorithm currently

heis

known

time

bound

for solving the assignment

problem

153

6.

Reference Notes
In this section,

we

present reference notes on topics covered in the


(i)

text.

This

discussion has three objectives:

to

review important theoretical contributions on

each topic,

(ii)

to point out inter-relationships

among

different algorithms,

and

(iii)

to

comment on
6.1

the empirical aspects of the algorithms.

Introduction

The study

cf

network flow models predates the development of


first

linear

programming techniques. The

studies in this problem domain, conducted by

Kantorovich (1939], Hitchcock [1941], and Koopmans (1947], considered the


transportation problem, a special case of the
studies provided

minimum

cost flow problem.

These

some

insight into the

problem structure and yielded incomplete

algorithms.

Interest in

network problems grew with the advent of the simplex


Dantzig (1951] specialized the simplex algorithm for
noted the traingularity of the basis and integrality of
(1956] generalized this

algorithm by Dantzig in 1947.


the tranportation problem.

He

the

optimum

solution.

Orden

work by

specializing the

simplex algorithm for the uncapacitated

minimum

cost flow problem.

The network

simplex algorithm for the capacitated


the development of the

minimum

cost flow

problem follov/ed from


for linear

bounded

variable simplex

method

programming

by Dantzig

(1955].

The book by Dantzig

(1962] contains a

thorough description of these

contributions along with historical perspectives.

During the

1950's,

researchers began to exhibit increasing interest in the


its

minimum
the

cost flow

problem as well as

special cases-the shortest path problem,

maximum

flow problem and the assignment problem

mainly

because of their
to

important applications.
solve these problems.

Soon researchers developed special purpose algorithms

Dantzig, Ford and Fulkerson pioneered those efforts.

Whereas Dantzig focused on the primal simplex based algorithms. Ford and
Fulkerson developed primal-dual type combinatorial algorithms to solve these
problems. Their book. Ford and Fulkerson (1962], presents a thorough discussion of
the early research conducted by
of flow decomp)osition theory,

them and by
is

others.

It

also covers the

development

which

credited to Ford

and Fulkerson.
flow

Since

these

pioneering

works,

network

problems and

their

generalizations

emerged as major research

topics in operations research; this research

154

is

documented

in

thousands of papers and many

text

and reference books.

We

shall

be surveying

many important

research papers in the following sections.


field

Several

important books summarize developments in the


literature:

and serve as

a guide to the

Ford and Fulkerson [1962] (Flows in Networks), Berge and Ghouila-Houri


,

11962]

(Programming

Games and

Transportation Networks),

Iri

(1969]

(Network

Flows, Transportation and Scheduling),

Hu

[1969] (Integer

Programming and

Network Flows), Frank and


Transportation

Frisch [1971]

(Communication, Transmission and

Networks), Potts and Oliver [1972] (Flows in Transportation

Networks), Christophides [1975] (Graph Theory:


[1976] (Linear

An

Algorithmic Approach), Murty


[1976]

and Combinatorial Programming), Lawler

(Combinatorial (Linear

Optimization:

Networks and Matroids), Bazaraa and

Jarvis [1978]

Programming and Network Flows), Minieka

[1978] (Optimization

Algorithms for

Networks and Graphs), Kennington and Helgason


Programming), Jensen and Barnes
[1980]

[1980] (Algorithms for

Network
and

(Network Flow Programming),

Phillips

Garcia-Diaz [1981] (Fundamentals of Network Analysis),


[1981] (Graphs,

Swamy and

Thulsiraman

Networks and Algorithms), Papadimitriou and

Steiglitz [1982]

(Combinatorial Optimization: Algorithms and Complexity), Smith [1982] (Network

Optimization Practice), Syslo, Deo, and

Kowalik

[1983] (Discrete

Optimization

Algorithms), Tarjan [1983] (Data Structures and Network Algorithms), Gondran and

Minoux

[1984]

(Graphs and Algorithms), Rockafellar [1984] (Network Flows and


[1988]

Monotropic Optimization), and Derigs


Graphs).

(Programming

in Netorks

and

As an additional source

of references, the reader might consult the

bibliography on network optimization prepared by Golden and Magrvanti [1977] and


the extensive set of references on integer
the University of
1985]).

programming compiled by researchers

at

Bonn (Kastning

[1976],

Hausman

[1978],

and Von Randow

[1982,

Since the applications of network flow modelsa are so pervasive, no single

source provides a comprehensive account of network flow models and their impact

on

practice.

Several researchers have prepared general surveys of selected

application areas.

Notable

among

these

is

the paper by Glover

and Klingman

[1976]

on the applications of minimum


problems.

cost flow

and generalized minimum


domains

cost flow

A number

of books written in special problem

also contain

valuable insight about the range of applicatior\s of network flow


in this category are the

modek. Examples

paper by Bodin, Golden, Assad and Ball [1983] on vehicle

routing and scheduling problems, books on commurucation networks by Bertsekas

155

and Gallager [1987] and on transportation planning by


collection of survey articles
[1988].
1.1.

Sheffi [1985], as well as a

on

facility location

edited by Francis and Mirchandani

Golden

[1988] has described the census

rounding application given

in Section

General references on data structure serve as a useful backdrop for the


algorithms presented in this chapter. The book by Aho, Hop>croft and Ullman [1974]
is

an excellent reference for simple data structures as arrays, linked


lists,

lists,

doubly
is

linked

queues, stacks, binary heaps or d-heaps.

The book by Tarjan

[1983]

another useful source of references for these topics as well as for more complex data
structures such as

dynamic

trees.

We
Gabow

have mentioned the "similarity assumption" throughout the chapter.


paper on scaling algorithm for combinatorial

[1985] coined this term in his

optimization problems.

This important paper, which contains scaling algorithms for

several network problems, greatly helped in popularizing scaling techiuques.

6^

Shortest Path Problem

The

shortest path problem

and

its

generalizations have a voluminous

research literature.

As

a guide to these results,

we

refer the reader to the extensive

bibliographies compiled by Gallo, Pallattino,

Ruggen and

Starchi [1982]

and Deo and

Pang

[1984].

This section, which summarizes some of this literature, focuses

especially

on issues of computational complexity.

Label Setting Algorithms

The

first

label setting algorithm

was suggested by

Dijkstra [1959],

and

independently by Dantzig [1960] and Whiting and Hillier [I960].

The
is

original

implementation of Dijkstra's algorithm runs in 0(n2) time which


running time for
fully

the optimal

dense networks (those with

m = fiCn^

)),

since

any algorithm
for sparse

must examine every


networks.

arc.

However, improved running times are possible

The following

table svimmarizes various implementations of Dijkstra's

algorithm that have been designed to improve the running time in the worst case or
in practice.
In the table,
2.

d =

[2

+ m/n] represents the average degree of a node

in the

network plus

156

157

Boas, Kaas and Zijlstra [1977] suggested a data structure

whose

analysis

depends upon the


takes

largest

key

D stored
this

in a heap.

The

initialization of this algorithm

0(D) time and each heap operation takes Odog log


is

D).

When

Dijkstra's

algorithm
time.

implemented using

data structure,

it

runs in

0(nC +

m log

log nC)
it

Johiison [1982]

suggested an improvement of

this

data structure and used

to

implement

Dijkstra's algorithm in

0(m

log log

C) time.

The

best strongly polynomial-time algorithm to date

is

due

to

Fredman and
is

Tarjan [1984]
ingenious, but

who

use a Fibonacci heap data structure.

The Fibonacci heap

an
n)

somewhat complex, data

structure that takes an average of

Odog

time for each node selection (and the subsequent deletion) step and an average of
0(1) time for each distance update.
Dijkstra's algorithm in

Consequently, this data structure implements

0(m

+ n log n) time.

Dial [1969] suggested his implementation of Dijkstra's algorithm because of

its

encouraging empirical performance.

This algorithm was independently discovered


[1979]

by Wagner[1976].

Dial, Glover,

Kamey and Klingman


which runs better
its

have proposed an

improved version of
algorithm
is

Dial's algorithm,

in practice.

Though

Dial's

only pseudopolynomial-time,

successors have had improved worst-

case behavior.
that
if

Denardo and Fox


[1,

[1979] suggest several such

improvements. Observe

max

minlcj,:

(i,j)

A}], then

we

can use buckets of width

in Dial's

algorithm, hence reducing the

number

of buckets

from 1+

C
if

to

l+(C/w).
is

The

correctness of this observation follows from the fact that

d*

the current

minimum temporary
temporary distance

distance labels, then the algorithm will modify no other

label in the range [d*, d*

1]

since each arc has length at least

1.

Then, using a multiple level bucket scheme, Denardo and Fox implemented

the shortest path algorithm in

0(max{k C^^K

m log (k+1), nk(l+C^/^/w)]


bound
to a

time for
log C).

any choice of

k.

Choosing k = log

yields a time

of

0(m

log log

C+n

Depending on n,m and C, other choices might lead

modestly better time bound.

Johnson [1977b] proposed a related bucket scheme with exponentially growing

widths and obtained the running time of


structure
it

0((m+n

log

Olog

log C).

This data

is

the

same

as the R-heap data structure described in Section 33, except that

performs binary search over

Odog C)

buckets to insert nodes into buckets during

the redistribution of ranges


replaces the binary search

and the distance updates. The R-heap implementation

by a sequential search and improves the running time by a

158

factor of

Odog

log C).

Ahuja, Mehlhom, Orlin and Tarjan [1988] suggested the Rits

heap implementation and

further improvements, as described next.

The R-heap implementation described


system.

in section 3.3

uses a single level bucket

two-level bucket system improves further

on the R-heap implementation

of Dijkstra's algorithm.

The two-level data

structure consists of

(big) buckets,

each

bucket being further subdivided into L (small) subbuckets. Ouring redistribution, the
two-level bucket system redistributes the range of a subbucket over
buckets.
all

of

its

previous

This approach permits the selection of

much

larger width of buckets, thus

reducing the number of buckets. By using

= L = 2 log C/log log C, this two-level

bucket system version of Dijkstra's algorithm runs in

0(m+n

log

C/log log C)

time.

Incorporating a generalization of the Fibonacci heap data structure in the two-level

bucket system with appropriate choices of

and L further reduces the time bound

to

0(m

+ nVlog

).

If

we

invoke the similarity aissumption, this approach currently


all classes

gives the fastest worst-case implementation of Dijkstra's algorithm for

of

graphs except very sparse ones, for which the algorithm of Johnson [1982] appears

more

attractive.

The Fibonacci heap version


it

of two-level R-heap

is

very complex,
in practice.

however, and so

is

unlikely that this algorithm

would perform well

Label Correcting Algorithm

Ford [1956] suggested,


the shortest path problem.

in skeleton

form, the

first label

correcting algorithm for


-

Subsequently, several other researchers


-

Ford and

Fulkerson [1962] and Moore [1957]


algorithm. algorithm.

studied the theoretical properties of the

Bellman's [1958] algorithm can also be regarded as a label correcting

Though

specific

implementations of label correcting algorithms run in


is

0(nm)
[1970].

time, the

most general form

nonpolynomial-time, as

shown by Edmonds

Researchers have exploited the flexibility inherent in the generic label


correcting algorithm to obtain algorithms that are very efficient in practice.

The

modification that adds a node to the LIST (see the description of the Modified Label

Correcting Algorithm given in Section

3.4.) at

the front

if

the algorithm has


is

previously examined the node earlier and at the end otherwise,

probably the most

popular.

This modification was conveyed to Pollack and Wiebenson [1960] by

D'Esopo, and later refined and tested by Pap>e [1974].


this

algorithm as D'Esopo and Pape's algorithm.

We shall subsequently refer to A FORTRAN listing of this

159

algorithm can be found in Pape [1980].

Though

this

modified label correcting


it

algorithm has excellent computational behavior in the worst-case


exponential time, as

runs in

shown by Kershenbaum

[1981].

Glover, Klingman and Phillips [1985] proposed a generalization of the FIFO


label correcting algorithm, called the partitioning shortest path (PSP) algorithm.

For

general networks, the

FSP algorithm runs


it

in

0(nm)

time, while for networks with

nonnegative arc lengths


behavior.

runs in 0(n2) time and has excellent computational


their

Other variants of the label correcting algorithms and


found
in Glover,

computational

attributes can be

Klingman, Phillips and Schneider

[1985].

Researchers have been interested in developing polynomial-time primal

simplex algorithms for the shortest path problem.

Dial, Glover,

Karney and
pivoting in

Klingman

[1979]

and Zadeh

[1979]

showed

that Dantzig's pivot rule

(i.e.,

the arc with largest violation of optimality condition) for the shortest path problem
starting

from an
0(n)

artificial basis

leads to Dijkstra's algorithm.

Thus, the number of

pivots

is

if all

arc costs are nonnegative.

Primal simplex algorithms for the


that efficient.

shortest path

problem with arbitrary arc lengths are not

Akgul

[1985a]

developed a simplex algorithm for the shortest path problem that performs O(n^)
pivots.

Using simple data structures, Akgul's algorithm runs


to

in

O(n^) time which

can be reduced

0(nm

+ n^logn) using the Fibonacci heap data structure. Goldfarb,

Hao and

Kai [1986] described another simplex algorithm for the shortest path
this

problem: the number of pivots and running times for


to those of

algorithm are comparable

Akgul's algorithm.

Orlin [1985]

showed

that the simplex algorithm with

Dantzig's pivot rule solves the shortest path problem in 0{rr log nC) pivots.

Ahuja

and Orlin

[1988] recently discovered a scaling variation of this

approach that performs

0(n^

log C) pivots

and runs

in

0(nm

log C) time.

This algorithm uses simple data


.

structures, uses very T\atural pricing strategies, aiul also permits partial pricing

All Pair Shortest Path Algorithms

Most algorithms
manipulation.

that solve the all pair shortest path

problem involve matrix

The

first

such algorithm appears to be a part of the folklore. Lawler

[1976] describes this algorithm in his textbook.

The complexity of

this algorithm is

0(n3

log n), which can be improved slightly by using

more

sophisticated matrix

multiplication procedures.

The algorithm we have presented

is

due
in

to Floyd [1962]

and

is

based on a theorem by Warshall [1962]. This algorithm

nms

0(n3) time and

160

is

also capable of detecting the presence of negative cycles.

Dantzig [1967] devised

another procedure requiring exactly the same order of calculations. The bibliography

by Deo and Pang [1984] contains references


algorithms.

for several other all pair shortest path

From
solve the
all

a worst -case

complexity point of view, however,

it

might be desirable

to

pair shortest path problem as a sequence of single source shortest path


in the text, this

problems.

As pointed out

approach takes CXnm) time

to construct

an

equivalent problem with nonnegative arc lengths and takes 0(n S(n,m,C)) time to
solve the n shortest path problems (recall that S(n,m,C)
shortest path
is

the time neede to solve a

problem with nonnegative arc


is

lengths).

For very dense networks, the


in the

algorithm by Fredman [1976]

faster than this

approach

worst<ase complexity.

Computational Results
Researchers have extensively tested shortest path algorithms on a variety of

network

classes.

The studies due

to Gilsinn

and Witzgall

[1973],

Pape

[1974], Kelton

and Law

[1978], [1979],

Van

Vliet [1978], Dial, Glover,


Iri

Kamey and Klingman

[1979],

Denardo
,

and Fox

Imai and

[1984], Glover,

Klingman, Phillips and Schneider [1985]

and Gallo and

Pallottino [1988] are representative of these contributions.

Unlike the worst<ase

results, the

computational performance of an algorithm


is

depends upon many

factors:

for

example, the manner in which the program

written; the language, compiler

and the computer used; and the distribution


is

of

networks on which the algorithm

tested.

Hence, the results of computational

studies are only suggestive, rather than conclusive.

The

results of these studies also

depend

greatly

upon the density

of the network.

These studies generally suggest that


path problem.
It is

Dial's algorithm is the best label setting algorithm for the shortest

faster than the original

OCn^) implementation, the binary heap, d-heap or the


all

Fibonacci heap implementation of Dijkstra's algorithm for

network

classes tested
is fcister

by these

researchers.

Denardo and Fox

[1979] also find that Dial's algorithm


all

than their two-level bucket implementation for

of their test problems; however,

extrapolating the results, they observe that their implementation

would be

faster for

very large shortest path problems.

Researchers have not yet tested the R-heap


Dial's algorithm is

implementation and so
available.

at this

moment no comparison with

161

Among
by Glover
algorithm.

the label correcting algorithn\s, the algorithms


Phillips

by D'Esopo and Pape

and by Glover, Klingman,


et al.

and Schneider

[1985] are the

two

fastest.

The study

finds that

their algorithm is

superior to D'Esopo and Pape's


label setting algorithms

Other researchers have also compared

with label

correcting algorithms.

Studies generally suggest that, for very dense networks, label

setting algorithms are superior and, for sparse networks,

bbel correcting algorithms

perform

better.

Kelton and

Law

[1978]

have conducted a computational study of several

aill

pair shortest path algorithms.

This study indicates that Dantzig's [1967] algorithm


is

with a modification due to Tabourier [1973]

faster

(up to two times) than the Floyd-

Warshall algorithm described

in Section 3.5.

This study also finds that matrix

manipulation algorithms are faster than a successive application of a single-source


shortest path algorithm for very dense networks, but slower for sparse networks.

6.3

Maximum Flow Problem


The maximum flow problem
is

distinguished by the long succession of

research contributions that have improved


algorithrr\s;

upon

the worst-case complexity of

some, but not

all,

of these

improvements have produced improvements

in practice.

Several researchers

Dantzig and Fulkerson [1956], Ford and Fulkerson [1956]


[1956]
-

and

Elias, Feinstein

and Shannon

independently established the max-flow

min-cut theorem.

Fulkerson and Dantzig [1955] solved the

maximum

flow problem
[1956]

by specializing the primal simplex algorithm, whereas Ford and Fulkerson


Elias et
al.

and

[1956] solved

it

by augmenting

p>ath algorithms.

Since then, researchers

have developed a number of algorithms

for this problem;

Figure 6.2 summarizes the

running times of some of these algorithms.

In the figure,

is

the

number

of nodes,

m is the number of arcs, and U is an upper bound on the integral arc capacities.
algorithms whose time bounds involve

The

assume

integral capacities; the

bounds

specified for the other algorithms apply to problems with arbitrary rational or real
capacities.

162

#
1

Discoverers

Running Time
[1972]

Edmonds and Karp


Dinic [1970]

0(nm2) CKn2m)
0(n3)

2 3 4
5 6

Karzanov
Cherkasky
Malhotra,

[1974]
[1977]

0(n2 VIS")
[1978]

Kumar and Maheshwari

0(n3)

Galil [1980]

0(n5/3m2/3)
[1980]; Shiloach [1978]

7
8

GalU and Naamad

0(nm
CXn3)

log2 n)

Shiloach and Vishkin [1982]


Sleator

9
10
11

and Tarjan

[1983]

0(nm
0(n3)

log n)

Tarjan [1984]

Gabow[1985]
Goldberg [1985]

0(nm
0(n3)

log U)

12 13
14

Goldberg and Tarjan [1986]


Bertsekas [1986]

CXnm
0(n3)

log (n^/m))

15 16

Cheriyan and Maheshwari [1987]

0(n2

Vm
+
,

Ahuja and Orlin

[1987]

0(nm + n^
,.
Ca)

log
.

J O nm
1^

U)

r?-

log log

log

"

U
.,

17

Ahuja, Orhn and Tarjan [1988]

(b)

uvnm ol

+ n ^VlogU)

(c)

O nm
V

Table

6.2.

Running times

of

maximum flow algorithms.

Ford and Fulkerson [1956] observed that the labeling algorithm can perform as

many
an
the

as 0(nU) augmentations for networks with integer arc capacities.

They

also

showed

that for arbitrary irrational arc capacities, the labeling algorithm can

perform

infinite

sequence of augmentations and might converge to a value different from


flow value.

maximum
that

Edmonds and Karp

[1972] suggested

two

specializations of

the labeling algorithm, both with improved computational complexity.

They
one

showed

if

the algorithm

augments flow along a shortest path

(i.e.,

containing the smallest possible

number

of arcs) in the residual network, then the

algorithm performs 0(nm) augmentations.


will

breadth

first

search of the network

determine a shortest augmenting path; consequently,

this version of the labeling

163

algorithm runs in 0(nm2) time.


flow along a path with

Edmonds and

Karp's second idea

was

to

augment

maximum

residual capacity.

They proved

that this algorithm


to

performs
path

0(m log U) with maximum

augmentations.

Tarjan [1986] has

shown how

determine a
this version

residual capacity in

0(m) time on average; hence,


U)
time.

of the labeling algorithm runs in

0(m2

log

Dinic [1970] independently introduced the concept of shortest path networks,


called layered networks
is
,

for solving the

maximum

flow problem.

layered network
lie

subgraph of the residual network


at least

that contains only those

nodes and arcs that

on

one shortest path from the source


into layers of

to the sink.
.

The nodes
.,

in a layered
(i, j)

network can be partitioned


in the layered

nodes N], N2,

so that for every arc


,

network connects nodes

in adjacent layers

(i.e.,

Nk and

Nk+1

for

some

k).

blocking flow in a layered


in the

network G'

(N', A') is a

flow that blocks

flow augmentations
residual capacity

sense that G' contains no directed path with positive

from the source node to the sink node.

Dinic showed

how

to

construct, in a total of

0(nm)

time, a blocking flow in a layered

network by

performing

at

most

augmentations.

His algorithm constructs layered networks


Dinic showed that after each

and

establishes blocking flows in these networks.

blocking flow iteration, the length of the layered network increases and a^er at most

iterations, the source is disconnected

from the sink

in the residual network.

Consequently, his algorithm runs in OCn^m) times.

The

shortest

augmenting path algorithm presented

in Section 4.3 achieves the

same time bound


it

as Dinic's algorithm, but instead of constructing layered networks


labels.

maintains distance

Goldberg [1985] introduced distance labels

in the context

of his preflow push algorithm.

Distance labels offer several advantages:

They are

simpler to understand than layered networks, are easier to manipulate, and have led
to

more

efficient algorithms.

Orbn and Ahuja

[1987]

developed the distance

label

based augmenting path algorithm given in Section


algorithm
is

4.3.

They

also

showed

that this

equivalent both to
all

Edmonds and

Karp's algorithm and to Dinic's

algorithm in the sense that

three algorithms enumerate the

same augmenting

paths in the same sequence. The algorithms differ only in the manner in which they
obtain these augmenting paths.

Several researchers have contributed improvements to the computational

complexity of

maximum

flow algorithms by developing more efficient algorithms to

establish blocking flows in layered networks.

Karzanov [1974] introduced the concept

164

of preflows in a layered network.

(See the technical report of

Even

(1976] for a

comprehensive description of

this

algorithm and the paper by Tarjan [1984] for a


that an

simplified version.) Karzanov

showed

implementation that maintains

preflows and pushes flows from nodes with excesses, constructs a blocking flow in

0(n2) time. Malhotra, Kumar and Maheshwari [1978] present a conceptually simple

maximum

flow algorithm that runs in OCn^) time. Cherkasky [1977] and Galil [1980]

presented further

improvements of Karzanov's algorithm.


for

The search

more

efficient

maximum

flow algorithms has stimulated

researchers to develop
first

new

data structure for implementing Dinic's algorithm.

The

such data structures were suggested independently by Shiloach [1978] and Galil
[1980].

and Naamad

Dinic's algorithm (or the shortest

augmenting path algorithm

described in Section 4.3) takes 0(n) time on average to identify an augmenting path

and, during the augmentation,


saturated arcs from this path,

it

saturates

some

arcs in this path.

If

we

delete the
is

we

obtain a set of path fragments.

The

basic idea

to

store these path fragments using

some data

structure, for example, 2-3 trees (see

Aho,

Hopcroft and Ullman [1974] for a discussion of 2-3 trees) and use them
identify

later to

augmenting paths quickly.


to

Shiloach [1978] and Galil and


in a

Naamad

[1980]

showed how

augment flows through path fragments

way

that finds a blocking


rur\s

flow in O(m(log n)^) time.


in

Hence, their implementation of Dinic's algorithm

0(nm

(log n)2) time.

Sleator

and Tarjan

[1983]

improved

this

approach by using a

data structure called dynamic

trees to store

and update path fragments. Sleator and

Tarjan's algorithm establishes a blocking flow in

0(m

log n) time

and thereby yields

an

0(nm

log n) time

bound

for Dinic's algorithm.

Gabow
to the

[1985] obtained a similar time

bound by applying

a bit scaling

approach

maximum flow problem. As outlined in Section 1.7, this approach solves a maximum flow problem at each scaling phase with one more bit of every arc's
capacity.

Ehiring a scaling phase, the


at

initial

flow value differs from the miximum

flow value by

most

units

and so the shortest augmenting path algorithm (and

also Dinic's algorithm) performs at


scaling phase takes

most

augmentations.

Consequently, each
log C) time.
If

0(nm) time and

the algorithm runs in

0(nm

we

invoke the similarity assumption,

this

time bound

is is

comparable to that of Sleator

and Tarjan's algorithm, but the scaling algorithm

much

simpler to implement.
algorithm achieving

Orlin and Ahuja [1987] have presented a variation of


the

Ga bow's

same time bound.

165

Goldberg and Tarjan [1986] developed the generic preflow push algorithm and
the highest-label preflow
that the

push algorithm.

Previously, Goldberg (1985] had

shoum
in the

FIFO version

of the algorithm that

pushes flow from active nodes

first-in-first-out

order runs in OCn-^^ time.


it

(This algorithm maintains a queue

of

active nodes; at each iteration,

selects a

node from the

front of the queue, j>erforms

push /relabel step

at this

node, and adds the newly active nodes to the rear of the

queue.) Using a dynamic tree data structure, Goldberg and Tarjan [1986]
the running time of the

improved
This

FIFO preflow push algorithm

to

0(nm log

(n^/m).

algorithm currently gives the best strongly polynomial-time bound for solving the

maximum

flow problem.

Bertsekas [1986] obtained another


his

maximum

flow algorithm by specializing

minimum

cost flow algorithm; this algorithm closely resembles the Goldberg's

FIFO preflow push algorithm.


that

Recently, Cheriyan

and Maheshwari

[1987]

showed

Goldberg and Tarjan's highest-label preflow push algorithm actually performs


)

OCn^Vin

nonsaturating pushes and hence runs in

OiriNm

time.

Ahuja and Orlin [1987] improved the Goldberg and Tarjan's algorithm using
the excess-scaling technique to obtain an

0(nm

+ n^ log U) time bound.

If

we

invoke

the similarity

assumption,

this

algorithm improves Goldberg and Tarjan's


for

0(iun log (n2/m)) algorithm by a factor of log n

networks that are both non-sp>arse

and nondense.

Further,

this

algorithm does not use any complex data structures.

Scaling excesses by a factor of log U/log log

and pushing flow from

a large excess

node with the highest distance

label,

Ahuja, Orlin and Tarjan [1988] reduced the


U).

number

of nonsaturating pushes to

OCn^ log U/ log log

Ahuja, Orlin and Tarjan

[1988] obtained another variation of origir\al excess scaling algorithm

which further

reduces the number of nonsaturating pushes to 0(n^

VlogU

).

The use

of the

dynamic

tree data structure


its

improves the running times of the

excess-scaling algorithm and

variations,

though the improvements are not as


For

dramatic as they have been for example, the

E>inic's

and the FIFO preflow push algorithms.

0(nm + n^ Vlog U
trees, as

algorithm improves to

O nm log

+2

by using dyiuimic

showT in Ahuja, Orlin and Tarjan [1988].

Tarjan [1987]

conjectures that any preflow push algorithm that performs

p noraturating pushes
trees.

can be implemented in

0(nm

log

(2+p/nm) time using dynamic

Although

this

166

conjecture

is

true for

all

known preflow push

algorithms,

it

is

still

open

for the

general case.

Developing a polynomial-time primal simplex algorithm for the


flow problem has been an outstanding open problem for quite some time.

maximum
Recently,
essentially

Goldfarb and Hao [1988] developed such an algorithm. This algorithm

is

based on selecting pivot arcs so that flow


source to the sink.

is

augmented along

a shortest path

from the

As one would

expect, this algorithm performs

0(nm)

pivots

and
to

can be implemented in (n^m) time.

Tarjan[1988] recently

showed how

implement

this

algorithm in

0(nm

logn) using

dynamic

trees.

Researchers have also investigated the following special cases of the

maximum
(i.e.,

flow problems:
(ii)

the

maximum

flow problem on
(i.e.,

(i)

unit capacity networks


in the
;

U=l);

unit capacity simple networks

U=l, and, every node

network, except source and sink, has one incoming arc or one outgoing arc)
bipartite networks;

(iii)

and

(iv)

planar networks.
is

Observe that the

maximum

flow value

for unit capacity

networks

less

than n, and so the shortest augmenting path


in

algorithm will solve these problems


to solve

0(nm)

time.

Thus, these problems are easier

than are problems with large capacities. Even and Tarjan [1975] showed that

Dinic's algorithm solves the

maximum

flow problem on unit capacity networks in


Orlin and

O(n^'-'m) time and on unit capacity simple networks in 0(n^/2in) time.

Ahuja [1987] have achieved the same time bounds using a modification of the
shortest

augmenting path algorithm. Both of these algorithms

rely

on ideas

contained in Hopcraft and Karp's [1973] algorithm for

maximum

bipartite matching.

Femandez-Baca and Martel


small integer capacities.

[1987]

have generalized these ideas for networks with

Versions of the
bipartite
Let

maximum
= (N^

flow algorithms run considerably faster on a


if
j

networks

N2, A)

Nj

<<

N2

|(or

N2
.

N^

).

n^=|N J, n2 = |N2| andn = n^+n2[1985] obtained the

Suppose
first

that

nj < n2

Gusfield, Martel

and Fernandez-Baca

such results by showing

how

the

running times of Karzanov's and Malhotra

et al.'s

algorithms reduce from O(n^) to

0(n^

n2

and 0(nj

+ nm) respectively.
that

Ahuja, Orlin, Stein and Tarjan [1988]


it

improved upon these ideas by shov^dng


time bounds for
all

is

possible to substitute nj for n in the

preflow push algorithms to obtain the

new

time bounds for

bipartite networks.

This result implies that the FIFO preflow push algorithm and the

167

original excess scaling algorithm, respectively, solve the


bipartite

maximum

flow problem on

networks

in

0(n,

m + n,

and 0(n,

m + n,

log U) time.

It is

possible to solve the

maximum

flow problem on planar networks

much
at the

more

efficiently than

on general networks.

(A network

is

called planar

if it

can be

drawn
nodes.)

in a

two-dimensional plane so that arcs intersect one another only


planar network has at most

6n

arcs;

hence, the running times of the


Specialized

maximum

flow algorithms on planar networks appear more attractive.

solution techniques, that have even better running times, are quite different than

those for the general networks.

Some important
[1979],

references for planar

maximum

flow algorithms are

Itai

and Shiloach

Johnson and Venkatesan (1982] and

Hassin and Johnson [1985].

Researchers have also investigated whether the worst-case bounds of the

maximum
case

flow algorithms are


for

tight,

i.e.,

whether the algorithms achieve

their worst-

bounds

some

families of networks.
is

Zadeh

[1972]

showed

that the

bound

of

Edmonds and Karp


that the

algorithm

tight

when
bound

= n^.

Even and Tarjan

[1975] noted

same examples imply

that the

of Dinic's algorithm is tight

when

m=

n2-

Baratz [1977]

showed

that the

bound on Karzanov's algorithm

is tight.

Galil

[1981] constructed

an interesting

class of

examples and showed that the algorithms of


et al.

Edmonds and

Karp, Dinic, Karzanov, Cherkasky, Galil and Malhotra

achieve

their worst-case

bounds on those examples.

Other researchers have made some progress in constructing worst-case


examples for preflow push algorithms. Martel [1987] showed that the FIFO preflow

push algorithm can take n(nm) time

to solve a class of unit capacity networks.

Cheriyan and Maheshwari [1987] have showTi that the bound of 0(n2
highest-label preflow

Vm)

for the

push algorithm

is tight.

Cheriyan [1988] has also constructed a


for

family of examples to

show

that the

bound O(n^)

FIFO preflow push algorithm


is tight.

and the bound O(n^m)

for the generic preflow

push algorithm

The research

community has not

established similar results for other preflow


It is

push algorithms,

especially for the excess-scaling algorithms.

worth mentioning, however, that

these knovkTi worst-case examples are quite artificial and are not likely to arise in
practice.

Several computational studies have assessed the empirical behavior of

maximum

flow algorithms.

The studies performed by Hamacher

[1979],

Cheung

168

[1980], Glover,

Klingman, Mote and Whitman [1979, 1984), Imai (1983] and Goldfarb
[1986]

and Grigoriadis

are noteworthy.
that

These studies were conducted prior


labels.

to the

development of algorithms

use distance

These studies rank Edmonds


order of performance for

and Karp,

Ehnic's

and Karzanov's algorithms

in increasing
is

most

classes of networks.

Dinic's algorithm

competitive with Karzanov's

algorithm for sparse networks, but slower for dense networks. Imai [1983] noted that
Galil

and Naamad's
is

[1980] implementation of Dinic's algorithm, using sophisticated

data structures,

slower than the original Dinic's algorithm.

Sleator

and Tarjan

(1983] reported a similar finding; they observed that their implementation of Dinic's

algorithm using dynamic tree data structure


algorithm by a constant
factor.

is

slower than the original Dinic's

Hence, the sophisticated data structures improve only


are not useful
empirically.

the worst-case performance of algorithms, but

Researchers have also tested the Malhotra

et al.

algorithm and the primal simplex

algorithm due to Fulkerson and Dantzig [1955]

and found these algorithms

to

be

slower than Dinic's algorithm for most classes of networks.

A number

of researchers are currently evaluating

the computational

performance of preflow push algorithms. Derigs and Meier

[1988], Grigoriadis [1988],

and Ahuja, Kodialam and Orlin

[1988]

have found that the preflow push algorithms

are substantially (often 2 to 10 times) faster than Dinic's and Karzanov's algorithms
for

most

classes of networks.

Among

all

nonscaling preflow push algorithms, the


fastest.

highest-label preflow

push algorithm runs the

The

excess-scaling algorithm

and

its

variations have not been tested thoroughly.


tree

We

do not anticipate

that

dynamic
practice;

implementations of preflow push algorithms would be useful in


been
to

in this case, as in others, their contribution has

improve the worst-

case p>erformances of algorithms.

Finally,

we

discuss two important generalizations of the


(ii)

problem:
problem.

(i)

the multi-terminal flow problem;

the

maximum maximum dynamic

flow

flow

maximum flow value between every pair of nodes. Gomory and Hu (1961] showed how to solve the multi-terminal flow problem on undirected networks by solving (n-1) maximum
In the multi-terminal flow problem,

we wish

to

determine the

flow problems. Recently, Gusfield [1987] has suggested a simpler multi-terminal flow
algorithm.

These

results,

however

do not apply

to the multi-terminal

maximum

flow problem on directed networks.

169

In the simplest version of

maximum dynamic
tj:

flow problem,

we

associate

with each arc


that arc.

(i, j)

in the
is

network a number
to

denoting the time needed to traverse


possible flow from the source

The

objective

send the

maximum

node
first

to the sink

node within

a given time period T.

Ford and

Fulkerson [1958]

showed

that the

maximum dynamic

flow problem can be solved by solving a


a nice treatment of

nunimum
in

cost flow problem.

(Ford and Fulkerson [1962] give

this problem).

Orlin [1983]
is to

has considered infinite horizon dynannic flow problems

which the objective

minimize the average cost per period.

6.4

Minimum

Cost Flow Problem


cost

The minimum

flow problem has a rich history.


caise of

The

classical

transportation problem, a special

the

minimum

cost flow

problem,was posed

and solved (though incompletely) by Kantorovich

[1939],

Hitchcock [1941], and

Koopmans

[1947].

Dantzig [1951] developed the

first

complete solution procedure for

the transportation problem by specializing his simplex algorithm for linear

programming.

He observed
for linear

the spanning tree property of the basis and the


solution.

integrabty property of the

optimum

Later his development of the upper

bounding technique

programming

led to an efficient sp)ecializatior of the

simplex algorithm for the


discusses these topics.

minimum

cost flow problem.

Dantzig's book [1962]

Ford and Fulkerson [1956, 1957] suggested the


for the uncapacitated

first

combinatorial algorithms

and capacitated transportation problem; these algorithms are


Ford and Fulkerson [1962] describe the
cost flow problem.

known

as the primal-dual algorithms.

primal-dual algorithm for the

minimum

Jewell [1958],

Iri

[1960]

and Busaker and Gowen


algorithm.

[1961] independently discovered the successive shortest path

These researchers showed

how

to solve the

minimum

cost flow

problem
[1971]

as a sequence of shortest path problems v^th arbitrary arc lengths.

Tomizava

and Edmonds and Karp

[1972] independently pointed out that

if

the computations

use node potentials, then these algorithms can be implemented so that the shortest
path problems have nonnegative arc lengths.

Minty
algorithm.

[1960]

and Fulkerson

[1961] independently discovered the out-of-kilter


is

The negative cycle algorithm

credited to Klein [1967]. Helgason

and

Kennington [1977] and Armstrong, Klingnun and Whitman [1980]

describe the

170

specialization of the linear


cost flow

programming dual simplex algorithm


not discussed in this chapter).

for the

minimum

problem (which

is

Each of these algorithms

perform iterations that can (apparently) not be polynomially bounded. Zadeh [1973a]
describes one such example on which each of
several

algorithms

the primal

simplex algorithm with Dantzig's pivot

rule, the

dual simplex algorithm, the

negative cycle algorithm (which augments flow along a most negative cycle), the
successive shortest path algorithm, the primal-dual algorithm, and the out-of-kilter

algorithm

- performs an

exponential

number

of iterations.

Zadeh

11973b) has also

described more pathological examples for network algorithms.

The

fact that

one example

is

bad

for

many network
insightful

algorithms suggests

inter-relationship

among

the algorithms.

The

paper by Zadeh [1979]


just

showed

this relationship

by pointing out

that each of the algorithms

mentioned
of

are indeed equivalent in the sense that they perform the

same sequence

augmentations provided

ties are

broken using the same

rule.

All these algorithms

essentially cortsist of identifying shortest paths

between appropriately defined nodes

and augmenting flow along these

paths.

Further, these algorithms obtain shortest

paths losing a method that can be regarded as an application of Dijkstra's algorithm.

The network simplex algorithm and


most popular with operations researchers.

its

practical implementations

have been
first

Johnson [1966] suggested the

tree
first

manipulating data structure for implementing the simplex algorithm.

The

implementations using these ideas, due to Srinivasan and Thompson [1973] and
Glover,

Kamey, Klingman and Napier

[1974],

significantly

reduced the running time

of the simplex algorithm.

Glover, Klingman and Stutz [1974], Bradley,

Brown and

Graves

[1977],

and

Barr, Glover,

and Klingman
of

[1979] subsequently discovered


is

improved data
excellent

structures.

The book

Kennington and Helgason [1980]

an

source for references and background material concerning these

developements.
Researchers have conducted extensive studies to determine the most effective
pricing strategy,
i.e.,

selection of the entering variable.

These studies show that the

choice of the pricing strategy has a significant effect on both solution time and the

number
strategy
BrovkTi

of pivots required to solve

minimum

cost flow problems.

The candidate

list

we

described

is

due

to

Mulvey

[1978a].

Goldfarb and Reid [1977], Bradley,


Gibby, Glover, Klingman and
that

and Graves
[1983]

[1978], Grigoriadis

and Hsu

[1979],

Mead

and Grigoriadis

[1986]

have described other strategies

have been

171

effective in practice.

It

appears that the best pricing strategy depends both upon the
size.

network structure and the network

Experience with solving large scale


established that

minimum

cost

flow problems has

more than 90%

of the pivoting steps in the simplex

method can be

degenerate (see Bradley, Brown and Graves [1978], Gavish, Schweitzer and Shlifer
[1977]

and Grigoriadis

(1986]).

Thus, degeneracy

is

both a computational and a

theoretical issue.

The strongly

feasible basis technique,

proposed by Cunningham
[1977a, 1977b, 1978) has

{1976]

and independently by

Barr, Glover

and Klingman

contributed on both fronts.

Computational experience has

shown

that maintaining

strongly feasible basis substantially reduces the

number

of degenerate pivots.

On

the

theoretical front, the use of this technique led to a finitely converging primal simplex

algorithm. Orlin [1985] showed, using a p>erturbation technique, that for integer data

an implementation of the primal simplex algorithm that maintains


feasible basis

a strongly

performs

O(nmCU)
pivots

pivots

when used with any

arbitrary pricing strategy

and 0(nm

C log (mCU))

when used with

Dantzig's pricing strategy.

The strongly

feasible basis technique prevents cycling during a

sequence of

consecutive degenerate pivots, but the

number
is

of consecutive degenerate pivots

may

be exponential.

This

phenomenon

known
the

as stalling.

Cunningham

[1979]

described an example of stalling and suggested several rules for selecting the entering
variable to avoid stalling.

One such

rule

is

LRC
fixed,

(Leaist

Recently Considered) rule

which orders the arcs

in

an arbitrary, but

manner.

The algorithm then

examines the arcs in the wrap-around fashion, each

iteration starting at a place

where

it

left

off earlier,

and introduces the

first

eligible arc into the basis.

Cunningham showed
pivots.

that this rule admits at

most

nm

consecutive degenerate

Goldfarb,

Hao and

Kai [1987] have described more anti-stalling pivot rules for

the

minimum

cost flow problem.

Researchers have also been interested in developing polynomial-time


simplex algorithms for the

minimum

cost flow

problem or

its

special CJises.

The only
is

polynomial time-simplex algorithm for the


simplex algorithm due to Orlin [1984];
the uncapacitated
this

minimum

cost flow

problem

a dual

algorithm performs 0(n^log n) pivots for

minimum

cost flow problem.

Developing a polynomial-time

primal simplex algorithm for the

minimum

cost flow

problem

is

still

open.

However, researchers have developed such algorithms


the

for the shortest path problem,

maximum

flow problem, and the assignment problem:

Dial et

al.

[1979],

Zadeh

172

[1979], Orlin [1985],

Akgul

[1985a], Goldfarb,

Hao and

Kai [1986] and Ahu)a and OrUn


[1988] for the

[1988] for the shortest path problem; Goldfarb

and Hao

maximum

flow

problem; and Roohy-Laleh [1980],

Hung

[1983], Orlin [1985],

Akgul [1985b] and Ahuja

and Orlin

[1988]

for the

assignment problem.

The
attractive

relaxation algorithms

proposed by Bertsekas and his associates are other

algorithms for solving the


For the

minimum

cost

flow problem and

its

generalization.

mirumum

cost flow problem, this algorithm maintains a


(i)

pseudoflow satisfying the optimality conditions. The algorithm proceeds by either

augmenting flow from an excess node


with zero reduced cost, or
latter case,
it

to a deficit

node along

a path cortsisting of arcs

(ii)

changing the potentials of a subset of nodes.


to their

In the
satisfy

resets flows

on some arcs
however,

lower or upper bounds so as to

the optimality conditions;

this

flow assignment might change the excesses


that each

and

deficits at nodes.

The algorithm operates so

change
it

in the

node

potentials increases the dual objective function value

and when

finally

determines

the

optimum dual

objective function value,

it

has also obtained an

optimum primal
Bertsekas

solution.

This relaxation algorithm has exhibited nice empirical behavior.

[1985]

suggested the relaxation algorithm for the


Bertsekas and Tseng [1985]
real data,

minimum
this

cost flow

problem (with

integer data).

extended

approach

for the

minimum
cost flow

cost flow

problem with

and

for the generalized

minimum

problem

(see Section 6.6 for a definition of this problem).

A number
sizes.

of empirical studies

have extensively tested

minimum
to

cost flow

algorithms for wide variety of network structures, data distributions,

and problem

The most common problem generator


[1974],

is

NETGEN, due

Klingman, Napier

and Stutz

which

is

capable of generating assignment, and capacitated or

uncapacitated transportation and

minimum

cost flow problems.


[1976]

Glover,

Kamey and

Klingman

[1974]

and

Aeishtiani

and Magnanti

have tested the primal-dual and

out-of-kilter algorithms.

Helgason and Kennington [1977] and Armstrong, Klingman

and Whitman
algorithm.

[1980]

have reported on extensive studies of the dual simplex


subject of

The primal simplex algorithm has been a

more rigorous
,

investigation; studies conducted

by Glover, Kamey, Klingman and Napier [1974]

Glover,

Kamey and Klingman


and Hsu
[1988]

[1974], Bradley, Brov^Ti

and Graves

[1977],

Mulvey

[1978b], Grigoriadis

[1979]

and Grigoriadis [1986] are noteworthy. Bertsekas


results for the relaxation algorithm.

and Tseng

have presented computational

173

In view of Zadeh's [1979] result,

we would

expect that the successive shortest

path algorithm, the primal-dual algorithm, the out-of-kilter algorithm, the dual

simplex algorithm, and the primal simplex algorithm with Dantzig's pivot rule

should have comparable running times.


that determine a

By using more

effective pricing strategies

good entering arc without examining

all arcs,

we would

expect that
All the

the primal simplex algorithm should outperform other algorithms.

computational studies

have verified

this expectation

and

until very recently the


all

primal simplex algorithm has been a clear winner for almost

classes of

network
is

problems. Bertsekas and Tseng [1988] have reported that their relaxation algorithm
substantially faster than the primal simplex algorithm.

However, Grigoriadis

[1986]

finds his algorithm.

new
At

version of primal simplex algorithm faster than the relaxation


this time,
it

appears that the relaxation algorithm of Bertsekas and

Tseng, and the primal simplex algorithm due to Grigoriadis are the two fastest
algorithms for solving the

minimum

cost flow

problem

in practice.

Computer codes
public domain.

for

some minimum

cost flow

problem are available

in the

These include the primal simplex codes

RNET and NETFLOW

developed by Grigoradis and Hsu [1979] and Kennington and Helgason [1980],
respectively,
[1988].

and the relaxation code

RELAX

developed by Bertsekas and Tseng

Polynomial-Time Algorithms
In the recent past, researchers have actively pursued the design of fast

(weakly) polynomial and strongly polynomial-time algorithms for the


cost flow problem.

minimum
if

Recall that an algorithm


in the

is

strongly polynomial-time

its

running time

is

polynomial

number
or U.

of nodes

and

arcs,

and does not evolve


summarizes

terms containing logarithms of

The

table given in Figure 6.3

these theoretical developments in solving the


table reports running times for

minimum

cost flow problem.

The

networks with n nodes and

m arcs,

m' of which are


in absolute

capacitated.

It

cissumes that the integral cost coefficients are

bounded

value by C, and the integral capacities, supplies and demands are bounded in absolute value by U. The term S()
is

the running time for the shortest path problem

and the
flow

term M() represents the corresponding running time to solve a


problem.

maximum

174

Polynomial-Time Combinatorial Algorithms

#
1

Discoverers

Running Time
[1972]

Edmonds and Karp


Rock Rock
[1980] [1980]

0((n + m") log

2 3 4
5 6

0((n +

U S(n, m, C)) m') log U S(n, m, O)


C M(n, m, U)) C M(n, m, U))
nC)
)

0(n 0(n

log log

Bland and Jensen [1985]

Goldberg and Tarjan [1988a]


Bertsekas and Eckstein [1988]

0(nm log irr/nx) log nC)


o(n3
log

7 7
8

Goldberg and Tarjan [1987]

0( n^ log nC

Gabow and

Tarjan [1987]
[1987, 1988b]

0(nm

log n log log n log


(log

U log nQ
nC)

Goldberg and Tarjan

0(nm
0(nm
0(nm

Ahuja, Goldberg, Orlin

U/log log U) log nC)

and Tarjan

[1988]

and
log log

U log nQ

Strongly Polynomial -Time Combinatorial Algorithms

175

For the sake of comparing the polynomial and strongly polynomial-time


algorithms,

we

invoke the similarity assumption.

For problems that satisfy the

similarity assumption, the best

bounds

for the shortest path

and maximum flow

problems

are:

Polynomial-Time Bounds
S(n,m, C) =

Discoverers

min (m

log log C,

m + rh/logC

Johnson

[1982],

and

Ahuja, Mehlhom, Orlin and Tarjan


[1988]

M(n, m, C) =

nm

^%rT^gTJ
log
[

+ 2
J

Ahuja, Orlin and Tarjan [1987]

Strongly Polynomial -Time Bounds


S(n,

Discoverers

m) =

m+
nm

n log n
log

Fredman and Tarjan

[1984]

M(n, m) =

(n^/m)

Goldberg and Tarjan [1986]

Using capacity and right-hand-side scaling, Edmonds and Karp [1972]


developed the
first

(weakly) polynomial-time eilgorithm for the


in Section 5.7,

minimum
L>

cost flow

problem. The RHS-scaling algorithm presented


the

which

a Vciriant of

Edmonds-Karp algorithm, was suggested by Orlin


initially
little

[1988].

The

scaling technique
it

did not

capture the interest of

many

researchers, since they regarded

as

having

practical utility.

However, researchers gradually recognized

that the

scaling technique has great theoretical value as well as potential practical significance.

Rock

[1980]

developed two different bit-scaling algorithms for the

minimum

cost

flow problem, one using capacity scaling and the other using cost scaling. This cost
scaling algorithm reduces the

minimum

cost flow

problem

to a

sequence of

0(n log C) maximum flow problems.

Bland and Jensen [1985] independently

discovered a similar cost scaling algorithm.

The pseudoflow push algorithms

for the

minimum

cost flow

problem

discussed in Section 5.8 use the concept of approximate

optimality,

introduced

independently by Bertsekas [1979] and Tardos [1985]. Bertsekas [1986] developed the
first

pseudoflow push algorithm.

This algorithm was pseudopolynomial-time.


this

Goldberg and Tarjan [1987] used a scaling technique on a variant of


obtain the generic pseudoflow push algorithm described in Section

algorithm to
Tarjan [1984]

5.8.

proposed a wave algorithm for the

maximum

flow problem.

The wave algorithm

176

for the

minimum

cost flow

problem described

in Section 5.8

which was developed


relies

independently by Goldberg and Tarjan [1987] and Bertsekas and Eckstein [1988],

upon

similar ideas.

Using a dynamic

tree data structure in the generic

pseudoflow

push algorithm, Goldberg and Tarjan

[1987] obtained a computational time that the

bound

of

0(nm

log n log nC).

They

also

showed

minimum

cost flow

problem cam be

solved using 0(n log nC) blocking flow computations.

(The description of Dinic's

algorithm in Section 6.3 contains the definition of a blocking flow.)


finger tree (see

Using both

Mehlhom

[1984])

and dynamic

tree

data structures, Goldberg and

Tarjan [1988a] obtained an

0(nm

log (n^/m) log nC)

bound

for ^he

wave

algorithm.

These algorithms, except the wave algorithm, required sophisticated data


structures that impose a very high computational overhead.

Although the wave


This

algorithm

is

very practical,

its

worst-case running time

is

not very attractive.

situation has

prompted researchers

to investigate the possibility of

improving the

computational complexity of

minimum
first

cost flow algorithms without using

any

complex data
Tarjan [1987],
log

structures.

The

success in this direction

was due

to

who

developed a

triple scaling

algorithm running in time


to Ahuja, Goldberg,

Gabow and 0(nm log n

log nC).

The second success was due

Orlin and Tarjan


scaling algorithm,

[1988],

who developed

the double scaling algorithm.


5.9,

The double

as described in Section

runs in

0(nm

log

log nC) time.

Scaling costs by

an

appropriately larger factor improves the algorithm to 0(nm(log U/log log U) log nC)

and

dynamic

tree

implementation improves the bound further to

0(nm

log log

log nC).

For problems satisfying the similarity


is

assumption, the double scaling

algorithm

faster than all other algorithms for all

network topologies except

for

very dense networks; in these instances, algorithms by Goldberg and Tarjan appear

more

attractive.

Goldberg and Tarjan [1988b] and Barahona and Tardos [1987] have developed
other polynomial-time algorithms.
cycle algorithm

Both the algorithms are based on the negative

due

to Klein [1967].

Goldberg and Tarjan [1988b] showed that


flow a
it

if

the

negative cycle algorithm


cycle

always augments along


/

minimum mean

cycle (a

W for which V
(i,j)

Cj;

|W

is

minimum), then

is

strongly polynomial-time.

W
this

Goldberg and Tarjan described an implementation of

approach running

in

time

0(nm(log

n) minflog nC,

log

n)).

Barahona and Tardos


if

[1987], analyzing

an

algorithm suggested by Weintraub [1974], showed that

the negative cycle algorithm

177

augments flow along


then
it

a cycle with

maximum improvement

in the objective function,

performs
is

0(m

log

mCU)

iterations.

Since identifying a cycle with

maximum

improvement

difficult

(i.e.,

NP-hard), they describe a method (based upon solving


to

an auxiliary assignment problem)

determine a disjoint

set of

augmenting cycles

with the property that augmenting flows along these cycles improves the flow cost

by

at least as

much

as

augmenting flow along any single

cycle.

Their algorithm runs

in 0(.Tr\^ log

(mCU)

S(n,

m,

O)

time.

Edmonds and Karp


the

[1972]

proposed the

first

polynomial-time algorithm for

minimum

cost flow problem,

and

also highlighted the desire to develop a

strongly polynomial-time algorithm.


theoretical considerations.

This desire

was

motivated primarily by

(Indeed, in practice, the terms log


in n.)

C and

log

typically

range from

to 20,

and are sublinear

Strongly polynomial-time algorithms are


(i)

theoretically attractive for at least

two reasons:
run on
real

they might provide, in principle,

network flow algorithms


data,

that can

valued data as well as integer valued


level, identify the

and

(ii)

they might, at

more fundamental
i.e.,

source of the
difficult or

underlying complexity in solving a problem;

are problems

more

equally difficult to solve as the values of the tmderlying data becomes increasingly
larger?

The
Tardos

first

strongly polynomial-time

minimum

cost flow algorithm

is

due

to

[1985].

Several researchers including Orlin [1984], Fujishige [1986], Galil and

Tardos
time.

[1986],

and Orlin

[1988] provided subsequent

improvements

in the

running

Goldberg and Tarjan [1988a] obtained another strongly polynomial time


Goldberg and

algorithm by slightly modifying their pseudoflow push algorithm.


Tarjan [1988b] also

show

that their algorithm that proceeds

by cancelling minimvun

mean

cycles

is

also strongly polynomial time.


is

Currently, the fastest strongly

polynomial-time algorithm

due

to Orlin

[1988].

This algorithm solves the

minimum

cost flow

problem as a sequence of 0(min(m log U,

m log n)) shortest path


is

problems. For very sparse networks, the worst-case running time of this algorithm
nearly as low
cis

the best weakly polynomieil-time algorithm, even for problems that

satisfy the similarity

assumption.

Interior point linear

programming algorithms are another source of

polynomial-time algorithms for the

minimum

cost flow problem.

Kapoor and
to the

Vaidya [1986] have shown that Karmarkar's [1984] algorithm, when applied

minimum

cost

flow

problem performs

0(n^-^

mK)

operations,

where

178

K=

log n + log

+ log U.

Vaidya [1986]

suggested another algorithm for linear

programming

that solves the

minimum

cost flow

problem

in

0(n^-^ y[m K) time.

Asymptotically, these time bounds are worse than that of the double scaling
algorithm.

At
fully

this time, the research

community has

yet to develop sufficient evidence to

assess

the

computational worth of scaling and interior point linear


for the

programming algorithms
folklore,

minimum

cost flow problem.

According

to the

even though they might provide the best-worst case bounds on running
eu-e

times,

the scaling algorithms


[1986]

not as efficient as the non-scaling algorithms. Boyd


results.

and Orlin

have obtained contradictory

Testing the right-hand-side

scaling algorithm for the

minimum

cost flow problem, they

found the scaling

algorithm to be competitive with the relaxation algorithm for some classes of


problems.

Bland and Jensen [1985] also reported encouraging results with their cost

scaling algorithm.

We

believe that

when implemented with appropriate speed-up

techniques, scaling algorithms have the potential to be competitive with the best

other algorithms.

6.5

Assignment Problem

The assignment problem has been


emphasis
in the literature has

a popular research topic.

The primary
efficient

been on the development of empirically

algorithms rather than the development of algorithms with improved worst-case


complexity.

Although the research community has developed several different

algorithms for the assignment problem,


features.

many

of these algorithms share

common

The successive

shortest path algorithm, described in Section 5.4 for the


lie

minimum
algorithms.
[1955],

cost flow problem, appears to

at the heart of

many assignment
due
to

This algorithm

is

implicit in the first assignment algorithm

Kuhn

known

as the Hungarian method,


[1972].

and

is explicit

in the papers

by Tomizava

[1971]

and Edmonds and Karp

When

applied to an assignment problem on the network

= (N^

u N2

A)

the successive shortest path algorithm operates as follows.

To use

this solution

approach,

we
(j,t)

first

transform the assignment problem into a


a source

minimum
arcs

cost flow
(s,i)

problem by adding

node
;

and

a sink

node

t,

and introducing and unit

for all

iN|, and

for all

JN2

these arcs have zero cost


s to
t

capacity.

The

algorithm successively obtains a shortest path from

with respect

to the lir;ar

179

programming reduced

costs,

updates the node potentials, and augments one unit of

flow along the shortest path.

The algorithm solves

the assignment

problem by n

applications of the shortest path algorithm for nonnegative arc lengths

and runs

in

0(nS(n,m,C)) time, where S(n,m,C)


problem.

is

the time needed to solve a shortest path


is

For a naive implementation of Dijkstra's algorithm, S(n,m,C)

O(n^) and

for a Fibonacci

heap implementation
is

it is

0(m+nlogn).
log log C,

For problems satisfying the

similarity assumption, S(n,m,C)

min(m

m+nVlogC}.

The

fact that the

assignment problem can be solved as a sequence of n shortest


Iri

path problems with arbitrary arc lengths follows from the works of Jewell [1958],
[1960]

and Busaker and Gowen


[1971]

[1961]

on the minimum cost flow problem. However,


[1972] independently pointed out that

Tomizava

and Edmonds and Karp

working with reduced


lengths.

costs leads to shortest path

problems with nonnegative arc


details of

Weintraub and Barahona [1979] worked out the

Edmonds-Karp
assignment

algorithm for the assignment problem.


algorithm by Glover, Glover

The more recent


[1986]
is

threshold

and Klingman

also a successive shortest path

algorithm which integrates their threshold shortest path algorithm (see Glover,

Glover and Klingman [1984]) with the flow augmentation process.


Sodini [1986] also suggested a similar threshold assignment algorithm.

Carraresi

and

Hoffman and Markowitz


path problem
to

[1963] pointed out the transformation of a shortest

an assignment problem.

Kuhn's [1955] Hungarian method


shortest path algorithm.

is

the primal-dual version of the successive

After solving a shortest path problem and updating the

node

potentials, the
to

Hungarian method solves a (particularly simple)

maximum

flow problem

send the

maximum

possible flow from the source

node

s to the sink

node

using arcs vdth zero reduced cost.


in

Whereas the successive shortest path


an
iteration, the

problem augments flow along one path


augments flow along
all

Hungarian method
to the sink node.
If

the shortest paths from the source

node

we

use the labeling algorithm to solve the resulting

maximum

flow problems, then

these applications take a total of

0(nm) time
time.

overall, since there are

n augmentatior\s

and each augmentation takes 0(m)


runs in

Consequently, the Hungarian method, too,


(For

0(nm

+ nS(n,mC)) = 0(nS(n,m,C)) time.

some time

after the

development of the Hungarian method as described by Kuhn, the research

community considered

it

to

be O(n^) method.

Lawler [1976] described an

Oiri^)

180

implementation of the method.

Subsequently,

many

researchers realized that the

Hungarian method

in fact runs in

0(nS(n,m,C)) time.) Jonker and Volgenant [1986]

suggested some practical improvements of the Hungarian method.

The

relaxation approach for the


(1969],

minimum

cost flow

problem

is

due

to E>inic
is

and Kronrod

Hung

eind

Rom

[1980]

and Engquist

[1982].

This approach

closely related to the successive shortest path algorithm.

Both approaches

start writh
is in

an

infeasible assignment

and gradually make

it

feasible.

The major difference

the nature of the infeasibility.

The successive

shortest path algorithm maintains a

solution w^ith unassigned persons and objects,

and with no person or


is

object

overassigned.
objects

Throughout the relaxation algorithm, every person

assigned, but

may

be overassigned or unassigned. Both the algorithms maintain optimality

of the intermediate solution

and work toward

feasibility

by solving

at

most n shortest

path problems with nonnegative arc lengths.


[1969]

The algorithms

of Dinic

and Kronrod
but

and Engquist

[1982] are essentially the

same as the one we


in the

just described,

the shortest path computations are

somewhat disguised

paper of Dinic and

Kronrod

[1969].

The algorithm

of

Hung and Rom


after

[1980] maintains a strongly feaisible

basis rooted at an overassigned

node and,

each augmentation, reoptimizes over


All of these algorithms

the previous basis to obtain another strongly feaisible basis.

run in 0(nS(n,m,C)) time.

Another algorithm worth mentioning


This algorithm
is

is

due

to Balinski

and Gomory

[1964].

a primal algorithm that maintains a feasible


it

assignment and

gradually converts

into

an optimum assignment by augmenting flows along

negative cycles or by modifying node potentials. Derigs [1985] notes that the shortest

path computations vmderlie

this

method, and that

it

rurrs in

0(nS(n,m,C)) time.

Researchers have also studied primal simplex algorithms for the assignment

problem.

The

basis of the assignment problem

is

highly degenerate; of

its

2n-l

variables, only

n are nonzero.

Probably because of this excessive degeneracy, the

mathematical programming community did not conduct

much

research on the

network simplex method for the assignment problem until Barr, Glover and

Klingman

[1977a] devised the strongly feasible basis technique.

These authors
to

developed the details of the network simplex algorithm when implemented

maintain a strongly feasible basis for the assignment problem; they also reported

encouraging computational

results.

Subsequent research focused on developing

ISl

polynomial-time simplex algorithms. Roohy-Laleh [1980] developed a simplex pivot


rule requiring O(n^) pivots.

Hung

[1983] describes a pivot rule that performs at


at

most

O(n^) consecutive degenerate pivots and

most 0(n log nC) nondegenerate pivots.

Hence, his algorithm performs 0(n^log nC) pivots. Akgul [1985b] suggested another primal simplex algorithm performing O(n^) pivots.
This algorithm essentially
in

amounts

to solving

n shortest path problems and runs

0(nS(n,m,C)) time.

Orlin [1985] studied the theoretical properties of Dantzig's pivot rule for the
netvk'ork simplex algorithm

and showed

that for the eissignment

problem

this rule

requires O(n^lognC) pivots.

naive implementation of the algorithm runs in


[1988] described a scaling version of Dantzig's pivot

0(n^m

log nC). Ahuja

and Orlin

rule that performs 0(n^log C) pivots

and can be implemented

to

run

in

0(nm log C)

time using simple data structures.

The algorithm
cost.

essentially consists of pivoting in

any arc with

sufficiently large

reduced

The algorithm defines the term

"sufficiently large" iteratively; initially, this threshold value equals

C and

within

O(n^) pivots

its

value

is

halved.

Balinski [1985] developed the signature method, which

is

a dual

simplex

algorithm for the eissignment problem.


dual feasible basis,
it
it

(Although his basic algorithm maintains a

is

not a dual simplex algorithm in the traditional sense because


at

does not necessarily increase the dual objective


algorithm do have this property.)
in

every iteration; some variants of

this

Balinski's algorithm

performs O(n^) pivots

and runs

O(n^) time.

Goldfarb [1985] described some implementations of


O(n^)
time using simple data structures and in

Balinski's algorithm that run in

0(nm +

n^log n) time using Fibonacci heaps.

The auction algorithm


suggested in Bertsekas [1979].

is

due

to Bertsekas

and uses basic ideas originally


[1988] described a

Bertsekas

and Eckstein

more

recent
its

version of the auction algorithm.


analysis
is

Out

presentation of the auction algorithm tmd

somewhat

different that the

one given by Bertsekas and Eckstein

[1988].

For example, the algorithm

we have

presented increases the prices of the objects by

one unit

at a time,

whereas the algorithm by Bertsekas and Eckstein increases prices


that preserves e-optimality of the solution.

by the

maximum amount

Bertsekas
is

[1981] has presented another algorithm for the assignment

problem which
cost flow

in fact a

specialization of his relaxation algorithm for the

minimum

problem

(see

Bertsekas [1985]).

Currently, the best strongly polynomial-time

bound

to solve the

assignment
algorithms.

problem

is

0(nm

+ n^ log n)

which

is

achieved by

many assignment

Scaling algorithms can

do

better for

problems that

satisfy the similarity


first scciling

assumption.

Gabow

[1985]

using bit-scaling of costs, developed the

algorithm for the

assignment problem.

His algorithm performs O(log C) scaling phases and solves

each phase in OCn'^'^m) time, thereby achieving jm OCn'^'

^m

log C) time bound.

Using the concept of e-optimality,


algorithm running in time 0(n^'

Gabow and

Tarjan [1987] developed another scaling

push algorithm
the assignment

^m log nC). Observe that the generic pseudoflow for the minimum cost flow problem described in Section 5.8 solves problem in 0(nm log nC) since every push is a saturating push.
showed
that the scaling version of the auction

Bertsekas and Eckstein [1988]

algorithm runs in
this

0(nm

log nC).

Section 5.11

has presented a modified version of

algorithm in Orlin and Ahuja [1988]. They also improved the time bound of the

auction algorithm to

0(n^'^m lognC). This time bound


For problems satisfying
best time

is

comparable

to that of

Gabow and

Tarjan 's algorithm, but the two algorithms

would probably have

different

computational attributes.

the similarity assumption, these

two algorithms achieve the

boimd

to solve the

assignment problem

without using any sophisticated data structure.

As mentioned

previously, most of the research effort devoted to assignment

algorithms has stressed the development of empirically faster algorithms.


years,

Over the

many

computational studies have compared one algorithm with a few other

algorithms.

Some

representative computational studies are those conducted by Barr,

Glover and Klingman [1977a] on the network simplex method, by McGinnis [1983]

and Carpento, Martello and Toth


[1982]

[1988]

on the primal-dual method, by Engquist


et al.

on the relaxation methods, and by Glover

[1986]

and Jonker and

Volgenant [1987] on the successive shortest path methods.

Since no paper has

compared

all

of these zilgorithms,

it

is difficult to

assess their computational merits.

Nevertheless, results to date seem to justify the following observations about the
algorithms' relative performance.

The primal simplex algorithm

is

slower than the


the latter

primal-dual, relaxation and successive shortest path algorithms.


three approaches, the successive shortest path algorithms

Among

due

to

Glover

et al. [1986]

and Jonker and Volgenant


[1988]

[1987]

appear

to

be the

fastest.

Bertsekas and Eckstein


is

found

that the scaling version of the auction algorithm

competitive with

Jonker and Volgenant's algorithm. Carpento, Martello and Trlh [1988] present

183

several
cases.

FORTRAN

implementations of assignment algorithms for dense and sparse

6.6

Other Topics

Our
domain
of

discussion in this paper has featured single


costs.

commodity network flow

problems with linear

Several other generic topics in the broader problem


theoretical
(i)

network optimization are of considerable

and

practical interest.

In particular, four other topics deserve mention:


(ii)

generalized network flows;


(iv)

convex cost flows;

(iii)

multicommodity flows; and

network design.

We

shall

now

discuss these topics briefly.

Generalized Network Flows

The flow problems we have considered


conserve flows,
i.e.,

in this chapter

assume

that arcs

the flow entering an arc equals the flow leaving the arc.
If

In
xj:

models of generalized network flows, arcs do not necessarily conserve flow.


units of flow enter an arc
(i,
j),

then

Tj: Xj:

units "arrive" at
arc.
If

node
1,

j;

Tj; is

a
is

nonnegative flow multiplier dissociated with the


lossy and,
1

<

rj:

<

then the arc


Tjj

if

<

Tj;

<

>,

then the arc

is

gainy.

In the conventional flow networks,

for all arcs.

Generalized network flows arise in

may

application contexts.

For

example, the multiplier might model pressure losses in a water resource network or
losses incurred in the transportation of perishable goods.

Researchers have studied several generalized network flow problems.


extension of the conventional

An

maximum
two

flow problem

is

the generalized

maximum

flow problem which either maximizes the flow out of a source


the flow into a sink

node or maximizes
of

node

(these

objectives are different!)

The source version

the problem can be states as the following linear program.

Maximize v^

(6ia)

subject to

X
{j:

"ij

{j:

S
(j,i)

"'ji'^ji

K'if = s
S 0,
if
i ?t

(i,j)

A)

A)

s,t,
t

for

aU

(6.1b)

[vj, if

184

<

x^j

<

uj:

for all

(i, j)

e A.

Note

that the capacity restrictions apply to the flows entering


is

the arcs.

Further, note that Vg

not necessarily equal to

v^,

because of flow losses and gains

within arcs.

The generalized maximum flow problem has many

similarities with the

minimum
minimum

cost flow problem.

Extended versions of the successive shortest path

algorithm, the negative cycle algorithm, and the primal-dual algorithm for the
cost flow

problem apply

to the generalized

maximum

flow problem.

The

paper by Truemper [1977] surveys these approaches. These algorithms, however, are
not pseudopolynomial-time, mainly because the optimal arc flows and node
potentials might be fractional.

The

recent paper by Goldberg, Plotkin

and Tardos

[1986]

describes the

first

polynomial-time combinatorial algorithms for the

generalized

maximum

flow problem.

In the generalized

minimum

cost flow problem,

which

is

an extension of the

ordinary

minimum

cost flow problem,

we wish

to

determine the

minimum
first

cost

flow in a generalized network satisfying the specified supply/demand requirements


of nodes. These are three

main approaches

to solve this

problem. The

approach,
is

due

to Jewell [1982], is essentially a primal-dual algorithm.

The second approach


[1979]

the primal simplex algorithm studied by Elam, Glover


others.

and Klingman

among
they

Elam
it is

et al.

find their implementation to be very efficient in practice;

find that

about 2 to 3 times slower than their implementations for the ordinary

minimum
[1988b],

cost flow algorithm.

The

third approach,

due

to Bertsekeis

and Tseng

generalizes their

minimum

cost

flow relaxation algorithm for the

generalized

minimum

cost flow problem.

Convex Cost Flows

We

shall restrict this brief discussion to


i.e.,

convex cost flow problems with

separable cost functions,

the objective function can be written in the form

V
(i,j)

Cjj

(x^j).

Problems containing nonconvex nonseparable cost terms such as xj2

A
are substantially

X-J3

more

difficult to solve

and continue

to

pose a significant

challenge for the mathematical programming community.

Even problems with

nonseparable, but convex objective functions are more difficult to solve; typically.

185

analysts rely on the general nonlinear

programming techniques

to solve these

problems. The separable convex cost flow problem has the follow^ing formulation:

Minimize

V
(i,j)

Cj; (xj;)

(6.2a)

subject to

Y
{j: (i,j)

^i]

{j:

S
(j,i)

''ji

^^'^'

^^ all

N,

(6.2b)

A
<
Ujj
,

<

x^j

for all

(i, j)

e A.

(62c)

In this formulation, Cj;

(xjj)

for each

(i,j)

e A,

is

a convex function.

The

research

community has focused on two


(i)

classes of separable

convex costs flow


each Cj;
(xj;) is

problems:

each Cj;

(xjj) is

a piecewise linear function;

of

(ii)

continuously differentiate function.


classes of

Solution techniques used to solve the two

problems are quite


is

different.

There

well-known technique for transforming


linear functions to a linear

a separable

convex

program with piecewise


and Magnanti
standard
[1972]).

program

(see, e.g., Bradley,

Hax

This transformation reduces the convex cost flow problem to a


it

minimum

cost flow problem:

introduces one arc for each linear segment

in the cost functions, thus increasing the

problem

size.

However,

it

is

possible to
cost

carry out this transformation implicitly

and therefore modify many minimum

flow algorithms such as the successive

shortest path algorithm, negative cycle

algorithm, primal-dual and out-of-kilter algorithms, to solve convex cost flow

problems without increasing the problem


[1984] illustrates this technique

size.

The paper by Ahuja,

Batra,

and Gupta

and suggests a pseudopolynomial time algorithm.

Observe that
segments chosen
(if

it

is

possible to use a piecewise

linear function, with linear

necessary) with sufficiently small size, to approximate a convex

function of one variable to any desired degree of accuracy.


alternatives are possible.

More

elaborate

For example,

convex problem a priori (which of

we knew the optimal solution to a separable course, we don't), then we could solve the
if

problem exactly using a

linear approximation for

any arc

(i,

j)

with only three

186

breakpoints: at

0, Uj;

and the optimal flow on the

arc.

Any

other breakpoint in the

linear approximation

would be

irrelevant

and adding other points would be

computationally wasteful.

This observation has prompted researchers to devise

adaptive approximations that iteratively revise the linear approximation beised upon
the solution to a previous, coarser, approximation.
of this approach).
If

(See

Meyer

[1979] for an

example
could

we were

interested in only integer solutions, then

we

choose the breakpoints of the linear approximation

at the set of integer values,

and

therefore solve the problem in pseudopolynomial time.

Researchers have suggested other solution strategies, using ideas from


nonlinear

progamming

for solving this general separable

convex cost flow problems.

Some important

references on this
[1980],

topic are Ali, Helgason

and Kennington

[1978],

Kennington and Helgason

Meyer and Kao

[1981],

Dembo and

Klincewicz

[1981], Klincewicz [1983], Rockafellar [1984], Florian [1986],

and Bertsekas, Hosein and

Tseng

[1987].

Some
time.
cases, the

versions of the convex cost flow problems can be solved in polynomial


[1984] has devised a polynomial-time algorithm for

Minoux

one of
[1986]

its

special

mininimum quadratic

cost flow problem.


to obtain

Minoux

has also

developed a polynomial-time algorithm


the convex const flow problem.

an integer optimum solution of

Muticommodity Flows
Multicommodity flow problems
arise

when

several commodities use the


In this section,

same underlying network, but share common


a linear

arc capacities.

we

state

programming formulation

of the

multicommodity minimum
problem and
its

cost flow

problem and point the reader

to contributions to this

specializations.

Suppose
through
r.

that the
b*^

problem contains

distinct

commodities numbered
k.

Let

denote the supply/demand vector of commodity


cost flow

Then

the

multicommodity minimum
^

problem can be formulated as follows:

Minimize

V
1^=1

V
(i,j)e

k
c^:

k
x^(6.3a)

subject to

187

k
X;;
1]
{j:

{j:

V
(i,j)

k ~
^i
'

^OT a\]

and

k,

(6.3b)

''ii

(i,j)

e A)

y
ktl

'

k
X..
'^

< u:j, for


^

all

(i,j),

(63c)

<

k
Xj.

<

k
u,

for all

(i,j)

and

all

(6.3d)

k
In this formulation,
x--

and

k
c--

represent the

amont

of flow

and the

unit cost

of flow for

commodity k on

arc

(i,j).

As indicated by
its

the "bundle constraints" (6.3c),

the total flow on any arc cannot exceed

capacity. Further, as captured

by

(6.3d), the

model contains additional capacity


each
arc.

restrictions

on the flow of each commodity on

Observe

that
it

if

the multicommodity flow problem does not contain bundle


into r

constraints, then

decomposes

single

commodity minimum

cost flow
corxstraints

problems, one for each commodity.


(6.3c),

With the presence of the bundle

the essential problem


in a

is to

distribute the capacity of each arc to individual


costs.

commodities

way

that

minimizes overall flow

We
problem
is

first

consider some special cases.


(6.3).

The multicommodity maximum flow

a special instance of

In this problem, every


s*^

commodity k has
objective

a
is

source node and a sink node, represented respectively by


to

and tK The
t*^

maximize the sum

of flows that can be sent

from

s*^

to

for all k.

Hu

[1963]

showed how
network
in

to solve the

two-commodity maximum flow problem on an undirected


Rothfarb, Shein and

pseudopolynomial time by a labeling algorithm.

Frisch [1968]

showed how
source or a

to solve the

multicommodity

maximum

flow problem

with a

common

common

sink by

a single application of any

maximum

flow algorithm.

Ford and Fulkerson [1958] solved the general multicommodity


Dantzig and Wolfe

maximum
[1960]

flow problem using a column generation algorithm.

subsequently generalized this decomposition approach to linear programming.

Researchers have proposed three basic approaches for solving the general

multicommodity minimum
resource-directive

cost flow problems:

price-directive

decomposition,

decomposition and partitioning methods.

We

refer the reader to

188

the excellent surveys by Assad [1978] and Kennington [1978] for descriptions of these

methods.

The book by Kennington and Helgason

[1980] describes the details of a

primal simplex decomposition algorithm for the multicommodity

minimum

cost

flow problem.

Unfortunately, algorithmic developments on the multicommodity

minimum
made on

cost flow

problem have not progressed

at nearly the

pace as the progress

the single

commodity minimum

cost flow problem.

Although specialized

primal simplex software can solve the single commodity problem 10 to 100 times
faster than the

general purpose linear

programming systems, the algorithms

developed for the multicommodity minimum cost flow problems generally solve
thse problems about 3 times faster than the general purpose software (see Ali et
[1984]).
al.

Network Design

We
network;

have focused on solution methods


that
is,

for finding optimal routings in a

on analysis rather than synthesis.

The design problem

is

of
its

considerable importance in practice and has generated an extensive literature of

own.

Many

design problems can be stated as fixed cost network flow problems:


is

(some) arcs have an associated fixed cost which

incurred whenever the arc carries


0-1 variables
yjj

any flow.

These network design models contain


is

that indicate

whether or not an arc

included in the network.

Typically, these

models involve
k
x^- are

multicommodity flows.
related

The design decisions

yjj

and routing decisions

by "forcing" constraints of the form

2 k=l

''ii

"ij yij

^^^
'

^"

^^'^^

which replace the bundle constraints


multicommodity flow problem
(6.3).

of the

form

(6.3c)

in

the convex cost

k
These constraints force the flow
the arc
is
x^-

of each
if

commodity k on
the arc
is

arc

(i,j)

to

be zero

if

not included in the network design;


restricts the total

included, the constraint on arc


Ujj

(i,j)

flow to be the

arc's

design capacity
constraints

Many

modelling enhancements are possible; for example, some

may

restrict the

underlying network topology

(for instance, in

some

applications, the

network must be

a tree; in other applications, the

network might

189

need alternate paths

to

ensure reliable operations).

Also,
is

many

different objective

functions arise in practise.

One

of the

most popular

""

Minimize

^ k=l
(i^j)e

k
c

k
x^^

Y. ^
(i,j)

ij

A
(as well zs fixed costs

k which models commodity dependent per unit routing costs c


Fjj for

the design arcs).

Usually, network design problems require solution techniques from any


integer

programming and other type

of solution

methods from combinatorial

optimization. These solution methods include

dynamic programming, dual ascent

procedures, optimization-based heuristics, and integer programming decomposition

(Lagrangian relaxation. Benders decomposition) as well as emerging ideas from the


field of

polyhedral combinatorics.

Magnanti and

Wong

[1984]

and Minoux

[1985,

1987] have described the broad range of applicability of network design models

and

summarize solution methods


network design
literature.

for these

problems as well as many references from the


[1988] discuss

Nemhauser and Wolsey

many

underlying

methods from integer programming and combinatorial optimization.

Acknowledgments

We
Wong and

are grateful to Michel

Goemans, Hershel

Safer,

Lav^ence Wolsey ,Richard

Robert Tarjan for a careful reading of the manuscript and

many
for

useful

suggestions.

We

are particularly grateful to William

Cunningham

many

valuable and detailed comments.

The research
Presidential

of the first

and

third authors

was supported

in part

by the

Young

Investigator Grant 8451517-ECS of the National Science

Foundation, by Grant AFOSR-88-0088 from the Air Force Office of Scientific


Research, and by Grants from Analog Devices, Apple Computer,
Inc.,

and Prime

Computer.

190

References
Aashtiani, H.A., and T. L. Magnanti.
1976.
055-76,

Implementing Prin\al-E>ual Network


Operations Research Center, M.I.T.,

Flow Algorithms. Technical Report


Cambridge, MA.

OR

Aho, A.V.

J.E.

Hop>croft,

and

J.D.

Ullman. 1974. The Design and Analysis

of

Computer

Algorithms.

Addison-Wesley, Reading,
L. Batra,

MA.
1984.

Ahuja, R. K.,

J.

and

S.

K. Gupta.

Parametric Algorithm for the

Convex Cost Network Flow and Related Problems.


Ahuja, R.K.,
A.V.

Euro. ].of Oper. Res. 16, 222-25

Goldberg,

J.B.

Orlin,

and R.E. Tarjan. 1988.

Finding

Minimum-Cost Rows by Double


of

Scaling.

Working Paper No. 2047-88, Sloan School

Management,

M.I.T.,

Cambridge,

MA.
Orlin.

Ahuja, R.K., M. Kodialam, and Ahuja, R.K., K. Mehlhom,

J.B.

1988.

Personal Communication.

J.B.

Orlin,

and

R.E. Tarjan.

1988.

Faster Algorithms for

the Shortest Path Problem. Technical Report No. 193, Operations Research Center,
M.I.T.,

Cambridge, MA.
Orlin.

Ahuja, R.K., and

J.B.

1987.

Fast

and Simple Algorithm

for the

Maximum
M.I.T.,

Flow Problem.

Working Paper

1905-87, Sloan School of

Management,

Cambridge, MA. 1987. To appear


Ahuja, R.K., and
Orlin.

in Oper. Res.

J.B.

1988.

Improved Primal Simplex Algorithms


Cost Flow Problems. To appear.

for the

Shortest Path, Assignment and

Minimum
and

Ahuja, R.K.,
Bipartite

J.B.

Orlin, C. Stein,

R.E. Tarjan.

1988.

Improved Algorithms

for

Network Flow Problen. To appear.


J.B.

Ahuja, R.K.,

Orlin,

and

R.E. Tarjan.

1988.

Improved Time Bounds

for the

Maximum Flow
M.I.T.,

Problem.

Working Paper

1966-87, Sloan School of

Management,

Cambridge, MA.
1985a.

Akgul, M.
of

Shortest Path and Simplex Method.

Research Report, Department


State University,

Computer Science and Operations Research, North Carolina

Raleigh, N.C.

191

Akgul, M.

1985b.

Genuinely Polynomial Primal Simplex Algorithm for the


Research Report, Department of Computer Science and

Assignment Problem.

Operations Research, North Carolina State University, Raleigh, N.C.


D. Bamett, K. Farhangian,
1984.

Ali,I.,

J.

Kennington,

B. Patty, B. Shetty, B.

McCarl and

P.

Wong.

Multicommodity Network Problems: Applications and Computations.

LIE. Trans. 16,127-134.


R. V. Helgason,

Ali, A.

I.,

and

J.

L.

Kennington.

1978.

The Convex Cost Netwrork

Flow Problem:

State-of-the-Art Survey.
Texeis.

Technical Report

OREM

78001, Southern

Methodist University,

Armstrong, R.D., D. Klingman, and D. Whitman.

1980.

Implementation and

Analysis of a Variant of the Dual Method for the Capacitated Transshipment


Problem. Euro.
J.

Oper. Res. 4, 403-420.

Assad, A. 1978. Multicommodity Network Flows Balinski, M.L.


527-536.

A Survey.

Networks 8,37-91.

1985.

Signature Methods for the Assignment Problem.

Oper. Res. 33,

Balinski, M.L.,

and

R.E.

Comory.

1964.

Primal Method for the Assignment and

Transportation Problems. Man.

Sci. 10,

578-593.

Barahona,

F.,

and

E.

Tardos.

1987.

Note on Weintraub's Minimum Cost Flow

Algorithm. Research Report, Dept. of Mathematics, M.I.T., Cambridge,

MA.

Baratz, A.E.

1977.

Construction and Analysis of a Network Flow Problem Which


Technical Report TM-83,

Forces Karzanov Algorithm to O(n^) Running Time.

Laboratory for Computer Science, MIT, Cambridge,

MA.
Basis Algorithm

Ban,

R., F.

Glover, and D. Klingman.

1977a..

The Alternating Path

for the

Assignment Problem. Math. Prog.

12, 1-13.

Barr, R., F. Glover,

and D. Klingman.

1977b.

A Network Augmenting
of the International

Path Basis

Algorithm for Transshipment Problems. Proceedings


External Methods and System Analysis.

Symposium on

192
Barr, R., F. Glover,

and D. Klingman.
Euro.
].

1978.

Generalized Alternating Path Algorithm

for Transportation Problems.

Oper. Res. 2, 137-144.

Barr, R., P. Glover,

and D. Klingman.

1979.

Enhancement
17, 16-34.

of

Spanning Tree Labeling

Procedures for Network Optimization.


Bazaraa, M., and
1978.

INFOR

J.J.

Jarvis.

Linear Programming and Network Flows.

John

Wiley

&

Sons.

Bellman, R. 1958.

On

a Routing Problem.

QuaH. Appl. Math.

16, 87-90.

Berge, C.,

and A. Ghouila-Houri.
John Wiley
1979.

1962.

Programming, Games and Transportation

Networks.

&

Sons.

Bertsekas, D.P.

Distributed Algorithm for the Assignment Problem.


for Information Decision Systems, M.I.T.,

Working Paper, Laboratory

Cambridge,

MA.
Bertsekas, D.P. 1981.
152-171.

Nev^ Algorithm for the Assignment Problem. Math. Prog.

21,

Bertsekas, D. P.

1985.

Unified Framev^ork for Primal-Dual Methods in

Minimum

Cost Network Flow Problems. Math. Prog. 32, 125-145.


Bertsekas, D.P. 1986.

Distributed Relaxation Methods for Linear

Network Flow

Problems.

Proc. of 25th

IEEE Conference on Decision and

Control, Athens, Greece.

Bertsekas, D. P.

1987.

The Auction Algorithm:

Distributed Relaxation

Method

for

the Assignment Problem.

Report LIDS-P-1653, Laboratory for Information Decision

systems, M.I.T., Cambridge,

MA.

Also in Annals
1988.

of Operations Research 14, 105-123.

Bertsekas, D.P.,

and

J.

Eckstein.

IXial Coordinate Step

Methods

for Linear

Network Flow Problems. To appear


Bertsekas, D.,

in Math. Prog., Series B.

and

R. Gallager.

1987.

Data Networks. Prentice-Hall.


Relaxation Methods for Network
J.

Bertsekas, D.

P., P.

A. Hosein,

and

P.

Tseng.
.

1987.

Flow Problems with Convex Arc Costs.


25,1219-1243.

SIAM

of Control

and Optimization

193
Bertsekas, D.P.,

and

P.

Tseng.

1988a.

The Relax Codes


al.

for Linear

Minimum

Cost

Network Flow Problems.


Optimization.

In B. Simeone, et

(ed.),

FORTRAN

Codes for Network

As Annals
and
P.

of Operations Research

13, 125-190.

Bertsekas, D.P.,

Tseng.

1988b.

Relaxation Methods for

Minimum

Cost

Ordinary and Generalized Network Flow Problems. Oper.


Bland, R.G., and D.L. Jensen.
1985.

Res. 36, 93-114.

On

the Computational Behavior of a

Polynomial-Time Network Flow Algorithm.

Technical Report 661, School of

Operations Research and Industrial Engineering, Cornell University, Ithaca, N.Y.


Boas, P.

Van Emde,

R. Kaas,

and

E. Zijlstra.

1977.

Design and Implementation of an

Efficient Priority

Queue. Math.

Sys. Theory 10, 99-127.

Bodin, L. D., B.
of Vehicles

L.

Golden, A. A. Assad, and M. O.

Ball.

1983.

Routing and Scheduling

and Crews. Comp. and


J.B.

Oper. Res. 10, 65-211.

Boyd, A., and

Orlin.

1986.

Personal Communication.

Bradley, G., G. Brown, and G. Graves.


Scale Primal Transshipment Algorithms.

1977.

Design and Implementation of Large


Sri.

Man.

21, 1-38.

Bradley,

S.

P.,

A. C. Hax, and T. L. Magnanti.

1977.

Applied

Mathematical

Programming.

Addison-Wesley.

Busaker, R.G., and

P.J.

Gowen.

1961.

Procedure for Determining a Family of


15,

Minimal-Cost Network Flow Patterns. O.R.O. Technical Report No.


Research Office, John Hopkins University, Baltimore,

Operational

MD.

Carpento, G.,

S.

Martello,
In B.

and

P. Toth.

1988.

Algorithms and Codes for the

Assignment Problem.
Optimization.

Simeone

et al. (eds.),

FORTRAN

Codes for Network

As Annals
and
J.

of Operations Research 33, 193-224.

Carraresi, P.,

C. Sodini.

1986.

An

Efficient

Algorithm for the Bipartite Matching

Problem. Eur.

Oper. Res. 23, 86-93.

Cheriyan,

J.

1988.

Parametrized Worst Case Networks for Preflow Push Algorithms.

Technical Report,

Computer Science Group, Tata

Institute of

Fundamental Research,

Bombay,

India.

194 Cheriyan,

J.,

and S.N. Maheshwari.


Flow.

1987.

Analysis of Preflow Push Algorithms for

Maximum Network

Technical Report, Dept. of

Computer Science and

Engineering, Indian Institute of Technology,

New

Delhi, India.

Cherkasky, R.V.

1977.

Algorithm for Cor\struction of

Maximum Flow

in

Networks

with Complexity of OCV^


Economical Problems
7,

Vl

Operation, Mathematical Methods of Solution of

112-125

(in Russian).

Cheung,

T.

1980.

Computational Comparison of Eight Methods for the Mzocimum

Network Flow Problem.

ACM

Trans, on Math. Software 6, 1-16.

Christophides, N. 1975. Graph Theory

An

Algorithmic Approach.

Academic

Press.

Cunningham, W.H.

1976.

Network Simplex Method.

Mafft. Pro^. 11, 105-116.

Cunningham, W.H.
Math, of Oper. Res.
Dantzig, G.B.
In T.C.
4,

1979.
196-208.

Theoretical Properties of the

Network Simplex Method.

1951.

Application of the Simplex Method to a Transportation Problem.


(ed.). Activity

Koopmans
359-373.

Analysis of Production and Allocation, John Wiley

&

Sons,

Inc.,

Dantzig, G.B.
in Linear

1955.

Upper Bounds, Secondary

Constraints,

and Block Triangularity

Programming. Economeirica

23, 174-183.

Dantzig, G.B. 1960.

On

the Shortest Route through a Network.

Man. Sd.

6,

187-190.

Dantzig, G.B.
Princeton, NJ.

1962.

Linear Programming and Extensions. Princeton University Press,

Dantzig, G.B. 1967. All Shortest Routes in a Graph. In P. Rosenthiel


Graphs,

(ed.),

Theory of

Gordon and Breach, NY,

91-92.

Dantzig, G.B., and D.R. Fulkerson.

1956.

On

the

Max-Flow Min-Cut Theorem

of

Networks.

In

H.W. Kuhn and A.W. Tucker

(ed.). Linear Inequalities

and Related

Systems, Annals of Mathematics Study 38, Princeton University Press, 215-221.

Dantzig, G.

B.,

and

P.

Wolfe.

1960.

Decomposition Principle

for Linear

Programs.

Oper. Rfs. 8, 101-111.

195

Dembo,

R. S.,

and

J.

G. Klincewicz.

1981.

Scaled Reduced Gradient Algorithm for


Costs. Math. Prog. Study 15, 125-147.

Network Flow Problen\s with Convex Separable


Deo, N., and

C Pang.

1984.

Shortest Path Algorithms:

Taxonomy and Annotation.

Networks 14, 275-323.

Denardo, E.V., and

B.L. Fox. 1979.

Shortest-Route Methods:

1.

Reaching, Pruning

and Buckets.
Derigs, U.

Oper. Res. 27, 161-186.

1985.

The Shortest Augmenting Path Method

for Solving

Assignment

Problems:
4,57-102.

Motivation and Computational Experience. Annals of Operations Research

Derigs, U.

1988.

Programming

in

Networks and Graphs.

Lecture Notes in Economics

and Mathematical Systems,


Derigs, U., and

Vol. 300, Springer-Verlag.

W.

Meier. 1988.

Implementing Goldberg's Max-Flow Algorithm:

Computational Investigation.

Technical Report, University of Bayreuth, West

Germany.
Dial, R. 1969.

Algorithm 360:

Shortest Path Forest with Topological Ordering.

Comm.

ACM

12, 632-633.

Dial, R., F. Glover, D.

Kamey, and D. Klingman.

1979.

Computational Arvalysis of

Alternative Algorithms and Labeling Techniques for Finding Shortest Path Trees.

Networks

9, 2-[5-248.

Dijkstra, E.

1959.

Note on

Two

Problems

in

Connexion with Graphs. Numeriche

Mathematics 1,269-271.

Dinic, E.A. 1970.

Algorithm for Solution of a Problem of


Soviet

Maximum Flow

in

Networks with Power Estimation,


Dinic, E.A.,

Math. Dokl. 11, 1277-1280.

and M.A. Kronrod.

1969.

An

Algorithm for Solution of the Assignment

Problem. Soviet Maths. Doklady

10, 1324-1326.

Edmonds,

J.

1970.

Exponential Grov^h of the Simplex Method for the Shortest Path

Problem. Unpublished paper. University of Waterloo, Ontario, Canada.

196

Edmonds,

J.,

and R.M. Karp.

1972.
/.

Theoretical Improvements in Algorithmic

Efficiency for

Network Flow Problems.

ACM

19, 248-264.

Elam,

J.,

F.

Glover, and D. Klingman.

1979.

Strongly Convergent Primal Simplex

Algorithm for Generalized Networks. Math,


Elias, P.,

of Oper. Res. 4, 39-59.

A. Feiitstein, and C.E. Shannon.


Infor.

1956.

Note on

Maximum Flow Through

Network. IRE Trans, on


Engquist, M.
1982.

Theory TT-2, 117-119.

Successive Shortest Path Algorithm for the Assignment

Problem.

INFOR 20,
1976.

370-384.

Even,

S.

The Max-Flow Algorithm

of Dinic

and Karzanov:

An

Exposition.

Technical Report TM-80, Laboratory for

Computer

Science, M.I.T.,

Cambridge,

MA.

Even,

S.

1979. Graph Algorithms.

Computer Science

Press, Maryland.

Even,
SI

S.,
}.

and

R.E. Tarjan.
4,

1975.

Network Flow and Testing Graph Connectivity.

AM

Comput.

507-518.

Femandez-Baca,

D.,

and C.U. Martel.

1987.

On

the Efficiency of

Maximum Flow
To appear
in

Algorithms on Networks with Small Integer Capacities.

Research Report,
lA.

Department of Computer Science, Iowa


Algorithmica.

State University,

Ames,

Florian,

M.

1986.

Nonlinear Cost Network Models in Transportation Analysis.

Math. Prog. Study 26, 167-196.


Floyd, R.W. 1962. Algorithm 97: Shortest Path.

Comm. >4CM
P-923,

5, 345.

Ford, L.R.,

Jr.

1956.

Network Flow Theory. Report

Rand

Corp., Santa Monica,

CA.
Ford, L.R.,
J.

Jr.,

and D.R. Fulkerson.

1956.

Maximal Flow through

a Network.

Canad.

Math.

8,

399-404.

Ford, L.R.,

Jr.,

and D.R. Fulkerson.

1956.

Solving the Trar\sportation Problem. Man.

Sd.

3, 24-32.

197

Ford, L.R.,

Jr.,

and D.R. Fulkerson.

1957.

Primal-Dual Algorithm for the

Capacitated Hitchcock Problem. Naval Res.

Logist. Quart. 4, 47-54.

Ford, L.R.,

Jr.,

and DR. Fulkerson.

1958.

Constructing Maximal Dynamic Flows from

Static Flows. Oper. Res. 6, 419-433.

Ford,

L., R.,

and D.

R. Fulkerson.

1958.

Suggested Computation for Maximal

Multicommodity Network Flow. Man.


Ford, L.R.,

Sci. 5,

97-101.

Jr.,

and D.R. Fulkerson.

1962. Flows in Networks..

Princeton University

Press, Princeton, NJ.

Francis, R.,

and

P.

Mirchandani

(eds.).

1988.

Discrete Location Theory.

John Wiley

&

Sons.

To appear.
I.T.

Frank, H., and

Frisch.

1971.

Communication, Transmission, and Transportation

Networks. Addison-Wesley.

Fredman, M.

L.

1986.

New Bounds
5,

on the Complexity of the Shortest Path Problem.

SIAM

].

of

Computing

83

89.

Fredman, M.L., and R.E. Tarjan. 1984. Fibonacci Heaps and Their Uses

in
of

Improved

Network Optimization Algorithms.


338-346, also in
/.

25th Annual

IEEE Symp. on Found,

Comp. Sci

of

ACM 34(1987), 596-615.

Fujishige, S.

1986.

Cost Circulation
298-309.

An 0(m^ log n) Capacity -Rounding Algorithm for the Minimum Problem: A Dual Framework of Tardos' Algorithm. Math. Prog. 35,

Fulkerson, D.R. 1961.

An

Out-of-Kilter

Method

for

Minimal Cost Flow Problems.

SIAM J.

Appl. Math. 9, 18-27.

Fulkerson, D.R., and C.B. Dantzig.

1955.

Computation of

Maximum Flow

in

Networks. Naval

Res. Log. Quart. 2, 277-283.

Gabow, H.N.
31, 148-168.

1985.

Scaling Algorithms for

Network Problems. J.ofComput.Sys.Sci.

Gabow, H.N., and


Problems.

R.E. Tarjan.

1987.

Faster Scaling Algorithms for

Network

SIAM

].

Comput. (submitted).

198
GaUl, Z.
1980.

OCV^/S E^/^) Algorithm

for the

Maximum Flow

Problem, Acta

Informatica 14, 221-242.

Galil, Z.

1981.

On

the Theoretical Efficiency of Various


103-111.

Network Flow Algorithms.

Theoretical

Comp.

Sci. 14,

Galil, Z.,

and A. Naamad.
/.

1980.

An 0(VE

log^ V)

Algorithm

for the

Maximum

Flow Problem.
Galil, Z.,

ofComput.
Tardos.

Sys. Sci. 21, 203-217.

and

E.

1986.

An 0(n^(m

+ n log n) log n)
Sci.
,

Min-Cost Flow

Algorithm. Proc. 27th Annual Symp. on the Found, of Comp.


Gallo, G.,

136-146.

and

S.

Pallottino.
B.

1988.

Shortest Path Algorithms.


P.

In

Fortran Codes for

Network Optimization,
(eds.).

Simeone,

Toth, G. Gallo,

F. Maffioli,

and

S.

Pallottino

As Annals

of Operations Research 13, 3-79.

Gallo, G., S. Pallottino, C. Ruggen,

and G.

Starchi.

1982.

Shortest Paths:

Bibliography. Sofmat

Document

81 -PI

-4-SOFMAT-27, Rome,
1977.

Italy.

Gavish,

B., P.

Schweitzer, and
Its

E. Shlifer.

The Zero Pivot Phenomenon

in

Transportation Problems and

Computational Implications. Math. Prog.


1983.

12, 226-240.

Gibby, D.,

F.

Glover, D. Klingman, and M. Mead.

Comparison

of Pivot

Selection Rules for Primal Simplex Based

Network Codes.

Oper. Res. Letters 2, 199-202.

Gilsinn,

J.,

and C. Witzgall.

1973.

Performance Comparison of Labeling


Technical Note 772, National

Algorithms for Calculating

Shortest Path Trees.

Bureau of Standards, Washington, D.C.


Glover,
F.,

R. Glover,

and D. Klingman.
1.

1984.

The Threshold Shortest Path

Algorithm. Netxvorks 14, No.

Glover,

F.,

R. Glover,

and D. Klingman.

1986.

Threshold Assignment Algorithm.

Math. Prog. Study 26, 12-37.

Glover,

F.,

D.

Kamey, and D. Klingman.


EXial

1974.

Implementation and Computational


for

Comparisons of Primal,

and Primal-Dual Computer Codes


4,

Minimum

Cost

Network

Eow Problem.

Networks

191-212.

199

Glover, R, D.

Kamey, D. Klingman, and A. Napier. Change


Criteria,

1974.

Computational Study on
for Tranportation

Start Procedures, Basis

and Solution Algorithms

Problem. Man. Sd. 20, 793-813.

Glover,

F.,

and D. Klingman.
9,

1976.

Netvk'ork Applications in Industry

and

Government. AIIE Transactions


Glover,
F.,

363-376.

D. Klingman,

J.

Mote, and D. Whitman. 1979. Comprehensive Computer

Evaluation and Enhancement of

Maximum Flow

Algorithms. Applications of

Management
Glover,
for the
F.,

Science 3, 109-175.

D. Klingman,

J.

Mote, and D. Whitman.

1984.

Primal Simplex Variant

Maximum Flow
F.,

Problem. Naval Res.

Logis. Quart. 31, 41-61.

Glover,

D. Klingman, and N. Phillips.

1985.

A New

Polynomially Bounded

Shortest Path Algorithm. Oper. Res. 33, 65-73.

Glover,

F.,

D. Klingman, N. Phillips, and R.F. Schneider.

1985.

New

Polynomial
Sci. 31,

Shortest Path Algorithms and Their Computational Attributes.


1106-1128.

Man.

Glover,

F.,

D. Klingman, and

J.

Stutz.

1974.

Augmented Threaded Index Method

for

Network Optimization. INFOR


Goldberg,
A.V.
1985.

12, 293-298.

A New Max-Flow
for

Algorithm.
M.I.T.,

Technical

Report

MIT/LCS/TM-291, Laboratory

Computer Science,
E.

Cambridge,

MA.

Goldberg, A.V., S.A. Plotkin, and

Tardos.

1988.

Combiiuitorial Algorithms for the

Generalized Circulation Problem.


Science, M.I.T., Cambridge,

Research Report.

Laboratory for Computer

MA.
1986.

Goldberg, A.V., and RE. Tarjan.


Problem.
Proc.

A New

Approach

to the

Maximum Flow
/.

18th

ACM

Symp. on the Theory of Comput., 136-146. To appear in

ACM.
Goldberg, A.V., and R.E. Tarjan.
Successive Approximation.
1987.

Solving

Minimum

Cost Flow Problem by


of

Proc. 19th

ACM

Symp. on the Theory

Comp. 136-146.

200

Goldberg, A.V., and R.E. Taijan. 1988a.


Successive Approximation.

Solving

Minimum

Cost Flow Problem by


[1987]. )To

(A revision of Goldberg and Tarjan

appear

in

Math. Oper. Res.

Goldberg, A.V., and R.E. Tarjan.

1988b.

Finding Minimum-Cost Circulations by


Symp. on
the Theory of Comp., 388-397.

Canceling Negative Cycles. Proc. 2(Hh

ACM

Golden,

B. 1988.

Controlled Rounding of Tabular Data for the Cerisus Bureau


at the

An

Application of

LP and Networks. Seminar given

OperatJons Research Center,

M.

I.

T.

Cambridge,
B.,

MA.
Magnanti.
7,

Golden,

and

T. L.

1977.

Deterministic

Network Optimization:

Bibliography. Networks

149-183.

Goldfarb, D.

1985.

Efficient

Dual Simplex Algorithms

for the

Assignment Problem.

Math. Prog. 33, 1S7-203.

Goldfarb, D., and M.D. Grigoriadis.

1986.

Computational Comparison of the Dinic


Flow.
In B.

and Network Simplex Methods

for

Maximum

Simeone

et al. (eds.)

FORTRAN Codes for Network


Goldfarb, D.,
J.

Optimization.

As Annals

of Operations Research 13, 83-124.

Hao, and

S.

Kai.

1986.

Efficient Shortest

Path Simplex Algorithms.

Research Report, Department of Operations Research and Industrial Engineering,

Columbia University,
Goldfarb, D.,

New

York, NY.

J.

Hao, and

S.

Kai.

1987.

Anti-Stalling Pivot Rules for the

Network

Simplex Algorithm.
Industrial Engineering,

Research Report, Department of Operations Research and

Columbia University,
Hao. 1988.
in

New

York, NY.

Goldfarb, D., and

J.

Primal Simplex Algorithm that Solves the

Maximum Flow Problem


University,

At Most

nm

Pivots and

O(n^m) Time.

Technical

Report, Department of Operations Research and Industrial Engineering, Columbia

New

York, NY.

Goldfarb, D., and J.K. Reid.

1977.

Practicable

Steepest

Edge Simplex Algorithm.

Math. Prog.

12,361-371.

Gomory,
551-570.

R. E.,

and

T. C.

Hu. 1961. Multi-Terminal Network Flows. f.ofSlAM

9,

201

Gondran, M., and M. Minoux. 1984. Graphs and Algorithms. Wiley-Interscience.


Grigoriadis,

M. D.

1986.

An

Efficient

Implementation of the Network Simplex

Method. Math. Prog. Study


Grigoriadis,

26, 83-111.

M. D.

1988.

Personal Communication.

Grigoriadis,

M.

D.,

and

T.

Hsu.

1979.

The Rutgers Minimum Cost Network Flow


26, 17-18.

Subroutines.

SIGMAP
1987.

Bulletin of the

ACM

Gusfield, D.

Very Simple Algorithms and Programs


Dept.
of

for All Pairs

Network

Flow Analysis.

Research Report No. CSE-87-1.

Computer Science and

Engineering., University of California, Davis,

CA.
1985. Fast Algorithms for Bipartite

Gusfield, D., C. Martel, and D.

Femandez-Baca.

Network Row. Technical Report No. YALEN/DCS/TR-356, Yale


Haven, CT.

University,

New

Hamachar, H.

1979.

Numerical Investigations on the Maximal Flow Algorithm of


22, 17-29.
.-<

Karzanov. Computing
Hassin, R., and D.

B.

Johnson.

1985.

An

O(nlog^n) Algorithm for


14,

Maximum Flow

in Undirected Planar

Networks.
Integer

SIAM J.

Comput.

612-^24.

Hausman, D.

1978.

Programming and Related Areas:

Classified Bibliography.

Lecture Notes in Economics and Mathematical Systems, Vol.

160.

Springer-Verlag.

Helgason, R. V., and

J.

L.

Kennington.

1977.

An

Efficient

Procedure for
9, 63-68.

Implementing
Hitchcock,

Dual-Simplex Network Flow Algorithm. AIIE Trans.


1941.
/.

F. L.

The Distribution
Math. Phys
.

of a Product

from Several Sources

to

Numerous

Facilities.

20, 224-230.

Hoffman, A. J., and H.M. Markowitz. 1963.

Note on Shortest Path, Assignment,

and Transportation Problems. Naval


Hopcroft,
E.

Res. Log. Quart. 10, 375-379.

J.

and

R.

M. Karp.
J.

1973.
2,

An n

'

Algorithm for

Maximun Matching

in

Bipartite Graphs.

SIAM

of

Comp.

225-231.

Hu,

T. C.

1963.

Multicommodity Network Flows. Oper.

Res. 11, 344-260.

202

Hu, T.C.

1969. Integer Programming and Network Flours.

Addison-Wesley.

Hung, M.
Oper.Res.

S.

1983.

Polynomial Simplex Method for the Assignment Problem.

31,595-600.

Hung, M.
Oper. Res
.

S.,

and W. O. Rom.

1980.

Solving the Assignment Problem by Relaxation.

28, 969-892.

Imai, H.

1983.

On

the Practical Efficiency of

Various

Maximum Flow

Algorithms,

/.

Oper. Res. Soc. Japan

26,61-82.

Imai, H.,

and M.

Iri.

1984.

Practical Efficiencies of Existing Shortest-Path Algorithms


/.

and
Iri,

New

Bucket Algorithm.

of the Oper. Res. Soc. Japan 27, 43-58.

M.

1960.

A New Method

of Solving Transportation-Network Problems.

J.

Oper.

Res. Soc. Japan 3, 27-87.

Iri,

M.

1969. Network Flaws, Transportation and Scheduling.

Academic

Press.

Itai,

A.,

and

Y. Shiloach.

1979.

Maximum Flow

in Planar

Networks.

SIAM

J.

Comput.

8,135-150.

Jensen, P.A., and

W.

Barnes.

1980.

Network Flow Programming. John Wiley

&

Sons.

Jewell,

W.

S.

1958.

Optimal Flow Through Networks.

Interim Technical Report

No.

8,

Operation Research Center, M.I.T., Cambridge,

MA.
Gair>s.

Jewell,
499.

W.

S.

1962.

Optimal Flow Through Networks with

Oper. Res.

10, 476-

Johnson, D. B. 1977a. Efficient Algorithms for Shortest Paths in Sparse Networks.

/.

ACM

24,1-13.

JohT\son, D. B.

1977b.

Efficient Special

Purpose Priority Queues.


1-7.

Proc. 15th

Annual

Allerton Conference on

Comm., Control and Computing,

Johnson, D.

B.

1982.

Priority

Queue

in

Which

Initialization

and Queue

Operations Take

OGog

log D) Time. Math. Sys. Theory 15, 295-309.

203
Johnson, D.
B.,

and

S.

Venkatesan. 1982. Using Oivide and Conquer to Find Flows in


Proceedings of the 20th Annual

Directed Planar Networks in O(n^/^logn) time. In


Allerton Conference on

Comm.

Control, and Computing.

Univ. of Dlinois, Urbana-

Champaign,
Johnson,

IL.

E. L.

1966.

Networks and Basic


1986.

Solutions. Oper. Res. 14, 619-624.

Jonker, R., and T. Volgenant.

Improving the Hungarian Assignment

Algorithm. Oper. Res.

Letters 5, 171-175.

Jonker, R.,

and A. Volgenant.

1987.

Shortest

Augmenting Path Algorithm


38, 325-340.

for

Dense and Sparse Linear Assignment Problems. Computing


Kantorovich, L. V.
of Production.
in Mfln. Sci.

1939.

Mathematical Methods in the Organization and Planning

Publication

House

of the Leningrad University, 68 pp.

Translated

6(1960), 366-422.

Kapoor,

S.,

and

P.

Vaidya.

1986.

Fast

Algorithms for Convex Quadratic


Proc. of the 18th

Programming and Multicommodity Flows,


Theory of Comp.
,

ACM

Symp.

on the

147-159.

Karmarkar, N.

1984.

A New

Polynomial-Time Algorithm

for Linear

Programming.

Combinatorica 4, 373-395.

Karzanov, A.V.

1974.

Determining the Maximal Flow in a Network by the Method

of Preflows. Soviet Math. Doklady 15, 434-437.

Kastning, C.

1976.

Integer

Programming and Related Areas:

Classified Bibliography.

Lecture Notes in Economics and Mathematical Systems. Vol. 128. Springer-Verlag.

Kelton,

W.

D.,

and A. M. Law.

1978.

Mean-time Comparison of Algorithms


Networks
8,

for

the All-Pairs Shortest-Path Problem with Arbitrary Arc Lengths.

97-106.

Kennington,

J.L.

1978.

Survey of Linear Cost Multicommodity Network Flows. Oper.

Res. 26, 209-236.

Kennington,

J.

L.,

and

R. V. Helgason.

1980.

Algorithms for Network

Programming,

Wiley-Interscience,

NY.

204

Kershenbaum, A. 1981.
400.

Note on Finding Shortest Path Trees. Networks

11,

399-

Klein,

M.

1967.

Primal Method for Minimal Cost Flows. Man.

Sci.

14, 205-220.

Klincewicz,

J.

G.

1983.

A Newton Method

for

Convex Separable Network Flow

Problems. Networks

13, 427-442.

Klingman,

D., A. Napier,

and

Large Scale Capacitated

NETGEN: A Program for Assignment, Transportation, and Minimum


J.

Stutz.

1974.

Generating

Cost Flow

Network Problems. Man. So. 20,814-821.

Koopmans,

T.

C.

1947.

Optimum
17 (1949).

Utilization of the Transportation System.

Proceedings of the International Statistical Conference,

Washington, DC. Also

reprinted

as supplement to Econometrica

Kuhn, H. W.

1955.

The Hungarian Method

for the

Assignment Problem. Naval

Res.

Log. Quart. 2, 83-97.

Lawler, E.L. 1976. Combinatorial Optimization:

Networks and Matroids. Holt, Rinehart

and Winston.
Magnanti,
T. L.

1981.

Combinatorial Optimization and Vehicle Fleet Planning:

Perspectives and Prospects. Networks 11, 179-214.

Magnanti,

T.L.,

and

R. T.

Wong.

1984.

Network Design and Tranportation Planning:

Models and Algorithms.

Trans. Sci. 18, 1-56.

Malhotra, V. M., M. P. Kumar, and


for Finding

S.

N. Maheshwari. 1978.

An CK V
I

3)

Algorithm

Maximum Flows
1987.

in

Networks. Inform.

Process. Lett. 7

277-278.

Martel, C. V.

Comparison

of Phase

and Non-Phase Network Flow

Algorithms.

Research Report, Dept. of Electrical and Computer Engineering,

University of California, Davis, CA.

McGinnis,

L.F.

1983.

Implementation and Testing of a Primal-Dual Algorithm

for

the Assignment Problem. Oper. Res. 31, 277-291.

Mehlhom,

K. 1984.

Data Structures and Algorithms.

Springer Verlag.

205 Meyer, R.R. 1979.

Two Segment
C. Y. Kao.

Separable Programming. Man.

Sri. 25,

285-295.

Meyer,

R. R.

and

1981.

Secant Approximation Methods for Convex

Optimization. Math. Prog. Study 14, 143-162.

Minieka,

E.

1978.

Optimization Algorithms for Networks and Graphs.

Marcel Dekker,

New

York.

Minoux, M.

1984.
J.

Polynomial Algorithm for

Mirumum

Quadratic Cost Flow

Problems. Eur.

Oper. Res. 18, 377-387.

Minoux, M.

1985.

Network Synthesis and Optimum Network Design Problems:


Technical Report, Laboratoire MASI,

Models, Solution Methods and Applications.


Universite Pierre
et

Marie Curie,

Paris, France.

Minoux, M.

1986.

Solving Integer

Minimum

Cost Flows with Separable Convex

Cost Objective Polynomially. Math. Prog. Study 26, 237-239.

Minoux, M.

1987.

Network Synthesis and E>ynamic Network Optimization. Annals

of Discrete Mathematics 31, 283-324.

Minty, G.

J.

1960.

Monotone Networks.

Proc. Roy. Soc.

London

257 Series A, 194-212.

Moore,

E.

F.

1957.

The Shortest Path through a Maze.


the Theory of Switching Part

In Proceedings
II;

of the

International

Symposium on

The Annals of the

Computation Laboratory of Harvard University 30, Harvard University Press, 285-292.

Mulvey,
266-270.

J.

1978a.

Pivot Strategies for Primal-Simplex

Network Codes.

J.

ACM

25,

Mulvey,

J.

1978b. Testing a Large-Scale

Network Optimization Program. Math.

Prog.

15,291-314.

Murty, K.C. 1976. Linear and Combinatorial Programming. John Wiley

&

Sons.

Nemhauser,
Wiley

G.L.,

and L.A. Wolsey.

1988.

Integer

and Combinatorial Optimization. John

&

Sons.

Orden, A. 1956. The Transshipment Problem. Man.

Sci. 2,

276-285.

106
Orlin, J.B.
1983.

Maximum-Throughput Dynamic Network Flows. Math.

Prog. 27,

214-231.

Orlin,

J.

B.

1984.

Genuinely Polynomial Simplex and Non-Simplex Algorithms

for

the

Minimum

Cost Flow Problem.


M.I.T.,

Technical Report No. 1615-84, Sloan School of

Management,
Orlin,
B.

Cambridge, MA.

J.

1985.

On

the Simplex Algorithm for


24, 166-178.

Networks and Generalized

Networks. Math. Prog. Study


Orlin,
1988.

J.

B.

Faster Strongly Polynomial

Minimum

Cost Flow Algorithm.

Proc. 20th

ACM
and

Symp. on

the Theory of Comp., 377-387.

Orlin,

J.

B.,

R. K. Ahuja.

1987.

New

E>istance-E>irected

Algorithms for

Maximum
MA.
and

Flow and Parametric Maximum Flow Problems.


School of Management, Massachusetts
Ii\stitute of

Working Paper

1908-87, Sloan

Technology, Cambridge,

Orlin,

J.

B.,

and

R. K. Ahuja.

1988.

New
MA.

Scaling Algorithms for the Assignment

Minimum

Cycle

Mean Problems.

Working Paper No.

OR

178-88, Operations

Research Center, M.I.T., Cambridge,


Papadimitriou, C.H., and K.

Steiglitz.

1982.

Combinatorial Optimization:

Algorithms

and Complexity. Prentice-Hall.


Pape, U. 1974. Implementation and Efficiency of Moore- Algorithms for the Shortest

Route Problem. Math. Prog. 7,212-222.


Pape, U. 1980. Algorithm 562: Shortest Path Lenghts.
450-455.

ACM Trans.

Math. Software

6,

Phillips, D.T.,

and A. Garcia-Diaz.

1981.

Fundamentals of Network Analysis. Prentice-

HaU.
Pollack, M.,

and W. Wiebenson.

1960.

Solutions of the Shortest-Route

Problem-A

Review. Oper. Res. 8,224-230.

Potts, R.B.,

and R.M.
1980.

Oliver. 1972. Floips in Transportation Netxvorks.

Academic

Press.

Rock, H.

Scaling Techniques for Miiumal Cost

Network Flows.

In V.

Page

.(ed.). Discrete Structures

and Algorithms

Carl Hansen, Munich, 101-191.

207

Rockafellar, R.T.
Interscience.

1984.

Network Flows and Monotropic Optimization.

Wiley-

Roohy-Laleh,
Method.

E.

1980.

Improvements

to the Theoretical Efficiency of the

Network Simplex

Unpublished Ph.D. Dissertation, Carleton University, Ottawa, Canada.


B.,

Rothfarb,

N.

P.

Shein,

and

I.

T.

Frisch.

1968.

Common

Terminal

MuJticommodity Flow. Oper.


Sheffi, Y.

Res. 16, 202-205.

1985.

Urban Transportation Networks: Equilibrium Analysis with Mathematical

Programming Methods. Prentice-Hall.


Shiloach, Y., 1978.

An

0(nl log^(I))

Maximum Flow

Algorithm.

Technical Report

STAN-CS-78-702, Computer Science Dept., Stanford University, CA.


Shiloach, Y.,

and U. Vishkin.

1982.

An OCn^

log n) Parallel

Max-Flow Algorithm.

/.

Algorithms 3 ,128-'i46.

Sleator, D. D.,

and

R. E. Tarjan.

1983.

Data Structure for Dynamic Trees,

/.

Comput.

Sys.Sci. 24,362-391.

Smith, D. K. 1982. Network Optimisation Practice:

Computational Guide. John Wiley


.

&

-,.

Sons.

Srinivasan, V., and G. L.

Thompson.

1973.

Benefit-Cost Analysis of Coding


/.

Techniques for Primal Transportation Algorithm,

ACM

20, 194-213.

Swamy,
Wiley
Syslo,

M.N.S., and K. Thulsiraman.


Sons.

1981.

Graphs, Networks, and Algorithms. John

&

M.M., N. Deo, and

J.S.

Kowalik.

1983.

Discrete Optimization

Algorithms.

Prentice-Hall,

New

Jersey.

Tabourier, Y. 1973. All Shortest Distances in a Graph:

An Improvement

to Dantzig's

Inductive Algorithm. Disc. Math.

4, 83-87.

Tardos,

E.

1985.
5,

Strongly Polynomial

Minimum

Cost Circulation Algorithm.

Combinatorica

247-255,

Tarjan, R.E. 1983. Data Structures and Network Algorithms.

SIAM, Philadelphia, PA.

208

Tarjan, R. E.
Res. Letters 2
,

1984.

Simple Version of Karzanov's Blocking Flow Algorithm, Oper.

265-268.

Tarjan, R. E.
1-11.

1986.

Algorithms for

Maximum Network

Flow. Math. Prog. Study 26,

Tarjan, R. E.

1987.

Personal Communication. Personal Communication.

Tarjan, R. E. 1988.

Tomizava, N.

1972.

On Some
1,

Techniques Useful for Solution of Transportation

Network Problems. Networks


Truemper, K. 1977.

173-194.

On Max Flow

with Gair\s and Pure Min-Cost Flows. SI

AM

].

Appl.Math. 32,450-456.

Vaidya,

P.

1987.

An

Algorithm

for Linear

Programming which Requires 0(((m


Proc. of the 19th

+n)n^ + (m+n)^-^n)L) Arithmetic Operations,


Theory of Comp., 29-38.

ACM

Symp. on the

Van

Vliet, D.

1978.

Improved Shortest Path Algorithms

for Transport

Networks.

Transp.Res. 12,7-20.

Von Randow,
1978-1981.

R.

1982. Integer

Programming and Related Areas:

Classified Bibliography

Lecture Notes in Economics and Mathematical Systems, Vol.197.

Springer-Verlag.

Von Randow,
1981-1984.

R.

1985. Integer

Programming and Related Areas:

Classified Bibliography

Lecture Notes in Economics and Mathematical Systems, Vol. 243.

Springer-Verlag.

Wagner,
23^-57.

R. A. 1976.

Shortest Path Algorithm for

Edge

Sparse Graphs.

/.

ACM

Warshall,

S.

1962.

A Theorem on Boolean A

Matrices.

J.

ACM

9,11-12.

Weintraub, A.

1974.

Primal Algorithm to Solve Network Flow Problems with

Convex

Costs.

Man.

Sci. 21, 87-97.

209

Weintraub, A., and

F.,

Barahona.

1979.

Ehial

Algorithm for the Assignment


2,

Problem.

Departmente de Industrias Report No.

Universidad de Chile-Sede

Occidente, Chile.

Whiting,

P. D.

and

J.

A. Hillier.

1960.

A Method

for Finding the Shortest

Route

Through

Road Network.

Oper. Res. Quart. 11, 37-40.

WiUiams,

J.

W.

J.

1964.

Algorithm 232: Heapsort. Comm. y4CM 7

347-348.

Zadeh, N.

1972.

Theoretical Efficiency of the


/.

Edmonds-Karp Algorithm

for

Computing Maximal Flows.


Zadeh, N.
1973a.

y4CM

19, 184-192.

A Bad Network

Problem
5,

for the

Simplex Method and other

Minimum
Zadeh, N.

Cost Flow Algorithms. Math. Prog.

255-266.

1973b.

More

Pathological Examples for

Network Flow Problems. Math.

Prog. 5,217-224.

Zadeh, N.

1979.

Near Equivalence

of

Network Flow Algorithms. Technical Report

No.

26, Dept. of

Operations Research, Stanford University, CA.

l^8^7

U^6

Date Due

ne

m^

?;*

>

SZQ0^

nrr

^^. 0.5
4Pi? 2 7 1991

W
t
1

,_

f^cr

CM-

OS

1992

::m

\995t-

o 1994
Lib-26-67

MIT

LIBRARIES DUPl

TDSD DQ5b72fl2

Vous aimerez peut-être aussi