Network Flow Problems: outline
I
Graphs — undirected and directed
I
(Minimum Cost) Network Flow Problem formulation
Simplex method for NFP
I
I
I
I
I
Full row rank assumption
Basic solutions (trees)
Basic directions, reduced costs, and dual basic solutions
Special cases and extensions of the NFP
IOE 610: LP II, Fall 2013
Network Flow Problems
Page 219
Undirected graphs
I
I
I
I
An undirected graph G = (N , E) consists of a set of nodes N
and a set of (undirected) arcs, or edges, E, where e 2 E is an
unordered pair {i, j} of distinct nodes
Arc {i, j} is incident to i and j; they are the endpoints of this
arc
Degree of a node — number of arcs incident to it
A walk from i1 to it : a finite sequence of nodes i1 , i2 , . . . , it
such that {ik , ik+1 } 2 E, k = 1, . . . , t 1.
I
I
I
A walk is a path if it has no repeated nodes.
A walk is a cycle if i1 = it and i1 , . . . , it 1 form a path (t
4)
G is connected if 8i 6= j 2 N , there exists a path from i to j.
IOE 610: LP II, Fall 2013
Network Flow Problems
Page 220
Directed graphs
I
A directed graph G = (N , A) consists of a set of nodes N
and a set of directed arcs A, where a 2 A is an ordered pair
(i, j) of distinct nodes
I
For a = (i, j), i is the start and j is the end node; it is
outgoing from i and incoming into j.
I
I (i) = {j 2 N : (j, i) 2 A},
O(i) = {j 2 N : (i, j) 2 A}
A walk from i1 to it : a finite sequence of nodes i1 , i2 , . . . , it
and associated sequence of arcs a1 , . . . , at such that for
k = 1, . . . , t 1 either ak = (ik , ik+1 ) (forward arc) or
ak = (ik+1 , ik ) (backward arc).
I
I
I
Path, cycle – similar.
A walk, path or cycle is directed if all arcs are forward.
IOE 610: LP II, Fall 2013
Network Flow Problems
Page 221
Networks
A network consists of
I
I
a directed graph G = (N , A)
bi 2 <, i 2 N — supplies at nodes
I
I
I
uij 2 <+ [ 1, (i, j) 2 A — capacities of arcs
I
I
if bi < 0, i is a sink and |bi | is the demand,
if bi > 0, i is a source
If all uij = 1, G is uncapacitated
cij 2 <, (i, j) 2 A — cost per unit of flow on arcs
Motivation behind a network flow problem
I
Nodes represent locations (suppliers of a product, customers,
or simply transshipment locations)
I
Arcs (with directions) represent available shipping routes
I
We are interested in finding the cheapest way of shipping the
product from the suppliers to the customers, subject to arc
capacity limits, if any.
IOE 610: LP II, Fall 2013
Network Flow Problems
Page 222
Formulation of the network flow problem (NFP)
I
I
Variables: fij — amount of “flow” on arc (i, j)
Constraints:
I
Nonnegativity:
0, 8(i, j) 2 A
fij
I
I
Capacities, if any:
fij uij , 8(i, j) 2 A
Flow conservation:
bi +
I
I
Note that
P
X
fji =
j2I (i)
X
j2O(i)
fij , 8i 2 N
bi = 0 is necessary for feasibility.
X
Objective: minimize
cij fij over all feasible flows.
i2N
(i,j)2A
Assumption 7.1
P
i2N
bi = 0, and the graph G is connected.
IOE 610: LP II, Fall 2013
Network Flow Problems
Page 223
Special cases of the NFP
I
The shortest path problem (under certain assumptions)
I
The maximum flow problem
The transportation problem
I
I
I
Only arcs present are arcs from sources to sinks
The assignment problem
I
I
IOE 610: LP II, Fall 2013
Transportation problems with equal number of sources and
sinks, and supply/demand of 1 at each
Goal: find minimum cost flow f with fij = 0 or 1 for all (i, j)
(integer program?!)
Network Flow Problems
Page 224
Uncapacitated NFP
Let n = |N | and m = |A|
Node-arc incidence matrix
I A 2 <n⇥m (rows$nodes, columns$arcs)6
I
aik =
I
I
8
>
<1
>
:
1
0
if i is the start node of arc k,
if i is the end node of arc k,
otherwise.
P
P
For any i 2 N , aT
f
=
f
ij
j2O(i)
j2I (i) fji
i
The (uncapacitated) NFP is an LP in standard form:
min cT f s.t. Af = b, f
I
0
Capacitated NFP:
min cT f s.t. Af = b, 0 f u
6
Note that the roles of m and n are reversed compared to what we’ve beed
used to!
IOE 610: LP II, Fall 2013
Network Flow Problems
Page 225
Network flow problems: solution approaches
I
The (uncapacitated) NFP:
min cT f s.t. Af = b, f
I
0
— an LP in standard form
Capacitated NFP:
min cT f s.t. Af = b, 0 f u
I
— an LP in standard form with upper bound constraints
(recall Exercises 2.3 and 3.25)
To apply/implement a simplex-type algorithm, need to
examine:
I
full row rank assumption on A
I
I
basic solutions
I
I
Trees
feasible directions and basic directions
I
IOE 610: LP II, Fall 2013
Needs work!
Circulations
Network Flow Problems
Page 226
Uncapacitated NFP — the full row rank assumption
(NFP) min cT f s.t. Af = b, f
where
aik =
8
>
<1
>
:
1
0
0,
if i is the start node of arc k,
if i is the end node of arc k,
otherwise.
Assumption 7.1
(a)
I
I
P
i2N
Notice: the rows of the incidence matrix A sum to 0T
Let the truncated node-arc incidence matrix à consist of the
first n 1 rows of A.
I
I
bi = 0; (b) G is connected.
b̃ consists of the first n
1 elements of b
Under Assumtion 7.1(a),
I
I
Ãf = b̃, f 0 has a solution i↵ Af = b, f 0 does
à has full row rank under Assuption 7.1(b) — will show
IOE 610: LP II, Fall 2013
Network Flow Problems
Page 227
Trees (on undirected graphs)
Towards understanding of basic solutions of NFP
Definition: Tree
G = (N , E) is called a tree if it is connected and has no cycles.
I
If a node of a tree has degree 1, it is called a leaf.
Theorem 7.1
(a) Every tree with |N | > 1 has at least one leaf
(b) An undirected graph is a tree , it is connected and has
|N | 1 arcs.
(c) In a tree, there exists a unique path between each pair of
distinct nodes.
(d) Adding one arc to a tree creates exactly one cycle. (We do not
distinguish between cycles involving the same set of nodes.)
IOE 610: LP II, Fall 2013
Trees
Page 228
Proof outline of Theorem 7.1
(a) Every tree with |N | > 1 has at least one leaf
I
If there are no leaves, then
I
I
I
Every node has degree at least 2
For each node, can follow one arc in, and another arc out
Repeating this process, we find a cycle — contradiction.
IOE 610: LP II, Fall 2013
Trees
Page 229
Proof outline of Theorem 7.1
(b) Tree , connected, has |N |
I
I
Every tree is connected by definition
Every tree has |N | 1 arcs:
I
I
Trivial if |N | = 1
If |N | > 1, use induction:
I
I
I
1 arcs
Suppose, true for all trees with < |N | nodes.
For a tree with |N | nodes, find and remove a leaf node. What
remains is a tree with |N | 1 nodes and, therefore, |N | 2
arcs...
Given a connected graph with |N |
I
I
I
IOE 610: LP II, Fall 2013
1 arcs,
If there is a cycle, can remove one arc and the graph remains
connected
Repeat this process until no cycles remain — the remaining
graph is a tree
But a tree must have |N | 1 arcs — there could not have
been any cycles
Trees
Page 230
Proof outline of Theorem 7.1
(c) In a tree, there exists a unique path between each pair of distinct nodes.
(d) Adding one arc to a tree creates exactly one cycle.
(c) If there are two paths between some two nodes in a tree
I
I
Join the two paths; delete the arcs that are common to both
We are left with one or more cycles — contradiction
(d) Let’s add an arc {i, j} to a tree
I
I
Resulting graph has |N | arcs — not a tree, so it must have a
cycle
The created cycle consists of {i, j} and the unique path
connecting i and j in the tree, so its a unique cycle.
IOE 610: LP II, Fall 2013
Trees
Page 231
Spanning trees (on undirected graphs)
Definition: Spanning Tree on a graph
Given connected G = (N , E), let E1 ✓ E be such that
T = (N , E1 ) is a tree. Then T is called a spanning tree.
Theorem 7.2
Let G = (N , E) be a connected undirected graph and let E0 ⇢ E
have no cycles. Then E0 can be augmented to E1 E0 so that
(N , E1 ) is a spanning tree.
Proof outline:
I If G is itself a tree, take E1 = E.
I Otherwise, G contains at least one cycle.
I A cycle cannot consist exclusively of arcs of E0 , hence one can
find and remove an arc of G that is contained in a cycle of G ,
but not in E0 . The resulting graph is still connected.
I Repeat until (what remains of) G is a tree.
IOE 610: LP II, Fall 2013
Trees
Page 232
Tree solutions of NFP
I
Consider an uncapacitated NFP defined on graph G = (N , A)
with n = |N | and m = |A|, satisfying Assumption 7.1
Definition 7.1
f is a tree solution if it can be constructed by the following:
(a) Pick T ⇢ A of n
direction)
1 arcs that form a tree (ignore arc
(b) Let fij = 0 8(i, j) 62 T
(c) Use the flow conservation equation Ãf = b̃ to determine
fij , (i, j) 2 T
A tree solution such that f
I
0 is a feasible tree solutions.
To execute (c), follow the tree from the leaves up.
IOE 610: LP II, Fall 2013
Tree solutions
Page 233
Structure of flow vectors: Tree solutions and BSs
Theorem 7.3
Let T ⇢ A be a spanning tree. Then the system of linear
equations Ãf = b̃ and fij = 0, (i, j) 62 T has a unique solution.
Proof idea:
I Number the nodes so that the numbers increase along any
path to node n
I B — the incidence matrix of the tree is lower triangular with
±1’s on the diagonal
Corollary 7.1
If G is connected, the matrix à has full row rank (n
Proof idea:
I To find n
tree in G
IOE 610: LP II, Fall 2013
1).
1 linearly independent columns, find a spanning
Tree solutions
Page 234
Structure of flow vectors: Tree solutions and BSs
Theorem 7.4
A flow vector is a basic solution i↵ it is a tree solution.
Proof idea:
I Theorem 7.3 implies that a tree solution is a BS
I Suppose we have a BS that is not a tree solution
I
I
I
Let S = {(i, j) 2 A : fij 6= 0}
If S doesn’t have cycles, can be completed to a tree solution.
Suppose S has cycles; let C ⇢ S be one such cycle.
I
I
Consider f̂ with
8
>
<fij
fˆij = fij + 1
>
:
fij 1
(i, j) 62 S or (i, j) 2 S \ C
(i, j) 2 C and is a forward arc in C
(i, j) 2 C and is a backward arc in C
f̂ 6= f, but satisfies all constraints active at f at equality; thus
solution to corresponding equations is not unique
— contradicts the assumption that f is a BS.
IOE 610: LP II, Fall 2013
Tree solutions
Page 235
Structure of flow vectors: Tree solutions and BSs
Summary
I
I
Basic (feasible) flow solutions , (feasible) tree solutions
Given a basis, i.e., a spanning tree, the values of basic
variables can be computed easily by following the tree’s
topology
IOE 610: LP II, Fall 2013
Tree solutions
Page 236
Structure of flow vectors: circulations/feasible directions
Definition: Circulation
Any flow vector f (feasible or not) such that Af = 0 is a circulation
I
I
I
I
Consider a cycle C ; let F ✓ C and B ✓ C be sets of its
forward and backward arcs.
Circulation associated with cycle C : (note: AhC = 0)
8
>
if (i, j) 2 F ,
<1
C
hij =
1 if (i, j) 2 B,
>
:
0
otherwise.
If ✓ 2 <, the flow vector f + ✓hC is obtained from f by
pushing ✓ units of flow along
C.
X the cycle
X
T C
The cost of C : c h =
cij
cij . Pushing ✓ units
(i,j)2F
of flow along C changes the cost
IOE 610: LP II, Fall 2013
Circulations
(i,j)2B
by ✓ · cT hC
Page 237
Structure of flow vectors: Basic directions, Change of basis
I
I
I
I
I
I
In (primal) simplex method, given a BFS, we need to pick a
non-basic variable to enter, and a variable to leave the basis,
to obtain a BFS with a better cost
Applying simplex method to NFP, given a tree T , we need to
pick a non-tree arc to add to, and a tree arc to remove from
T , to obtain a tree solution with a better cost.
Let (i, j) 62 T be the entering arc.
Adding it to T creates a cycle C (convention: (i, j) 2 F ).
To increase fij by ✓ and stay feasible, move to solution
f̂ = f + ✓hC :
8
>
<fkl + ✓, (k, l) 2 F ,
fˆkl = fkl ✓, (k, l) 2 B,
>
:
fkl
otherwise.
Hence, ✓ can be as large as ✓? = min(k,l)2B fkl . The variable
fkl that attains the minimum exists the basis.
IOE 610: LP II, Fall 2013
Change of basis and reduced costs in NFP
Page 238
Structure of flow vectors: Basic directions, Change of basis
I
The change in the cost resulting from the change in the basis:
0
1
X
X
✓? · (cT hC ) = ✓? · @
c(ij)
c(ij) A
(i,j)2F
I
We can immediately conclude that the reduced cost
associated with the variable fkl is
X
X
c̄kl =
c(ij)
c(ij) = cT hC .
(i,j)2F
I
(i,j)2B
(i,j)2B
It would make sense to have fkl enter the basis if c̄lk < 0.
IOE 610: LP II, Fall 2013
Change of basis and reduced costs in NFP
Page 239
The dual of NFP; another way of computing reduced costs
I
Recall:
c̄T = cT
pT Ã, where pT = cT
BB
1
Is there a fast way to compute p and c̄?
I
The dual of NFP is:
Pn
max
i=1 pi bi
s.t. pi pj cij , (i, j) 2 A
p 2 <n , pi ’s are associated with nodes i = 1, . . . , n.
I
I
I
I
Let us set pn = 0 (variable pn removed when passing to Ã).
From the definition of Ã: c̄ij = cij (pi pj ), 8(i, j) 2 A
At a basic dual solution: c̄ij = cij (pi pj ) = 0, 8(i, j) 2 T
To compute dual basic solution:
I
I
IOE 610: LP II, Fall 2013
Set pn = 0 (root of the tree)
Follow the tree arcs from n down, setting the values of pi ’s to
satisfy pi pj = cij
Change of basis and reduced costs in NFP
Page 240
The simplex method for the uncapacitated NFP
1. An iterations starts with a tree T and associated BFS (tree
solution) f
2. Compute p
3. Compute c̄ij = cij (pi pj ) for (i, j) 62 T . If all c̄ij 0, stop
— optimal basis found; else, choose some (i, j) with c̄ij < 0 to
enter the basis.
4. (i, j) and arcs in T form a unique cycle with (i, j) 2 F . If set
of backward arcs B = ;, stop — optimal cost is 1.
5. Let ✓? = min(k,l)2B fkl . Push ✓? units of flow around the cycle;
the variable fkl that attains the minimum exists the basis.
I
I
Computational e↵ort: using calculations specific to the
NFP, we need O(n) time to compute p, O(m) time to
compute all the reduced costs, O(n) to change the basis.
If no starting primal feasible tree is available
I
I
Can use Phase I method (artificial arcs connecting all sources
to all sinks)
Use parametric primal-dual method
IOE 610: LP II, Fall 2013
Network Simplex method
Page 241
Integrality property of the NFP
Theorem 7.5
Consider an uncapacitated NFP and assume that the underlying
graph is connected.
(a) For every basis matrix B, B
1
has integer entries.
(b) If the supplies bi are integer, then every basic solution has
integer coordinates
(c) If the costs cij are integer, then every dual basic solution has
integer coordinates.
Corollary 7.2
Consider an uncapacitated NFP and assume that the optimal cost
is finite.
(a) If the supplies bi are integer, 9 an integer optimal flow vector
(b) If the costs cij are integer, 9 an integer optimal solution to the
dual problem.
IOE 610: LP II, Fall 2013
Integrality property
Page 242
Assignment problem
I
There are n projects and n people; each person gets one
project
I
Cost of person i performs project j, the cost is cij .
I
Formulation:
I
Interpretation as NFP:
I
I
P
min
c f
Pi,j ij ij
s.t.
f = 1 8i
Pj ij
i fij = 1 8j
fij 2 {0, 1} 8i, j
N : 2n nodes i = 1, . . . , n and j = 1, . . . , n
A: n2 arcs (i, j) for each i, j
I
In formulation above, can replace fij 2 {0, 1} by fij
solution guaranteed to be integer
I
More efficient specialized algorithms exist as well
IOE 610: LP II, Fall 2013
Special cases and extensions
0—
Page 243
Shortest path problem
I
Given:
I
I
I
G = (N , A)
cij , (i, j) 2 A — “length” of arc (i, j)
Destination node n
find the “shortest” directed path from each node in the graph
to n
I
I
Note: shortest directed path is not the same as a shortest
directed walk if the graph has negative-cost directed cycles!
If arcs corresponding to shortest paths to n are drawn, they
form an “in-tree,” i.e., a spanning tree in which all paths to n
are directed
I
IOE 610: LP II, Fall 2013
“Principle of optimality”: if the first step of a shortest path
from i to n is node j, the rest of the path must be a shortest
path from j to n
Special cases and extensions
Page 244
NFP model of the shortest path
I
NFP formulation: bi = 1 for i = 1, . . . , n
1, bn =
(n
1).
Theorem 7.17
Consider the shortest path problem in a directed graph with n
nodes, and the associated NFP. Assume there is a path from any
node to n, and node n has no outgoing arcs.
(a) If there exists a negative length cycle, the optimal cost of the
NFP is 1
(b) Suppose all cycles have nonnegative length. If a feasible tree
solution is optimal, then the corresponding tree is a tree of
shortest paths.
(c) Suppose all cycles have nonnegative length. If we fix pn = 0,
the dual problem has a unique solution p ? , where pi? is the
shortest path length from i to n
IOE 610: LP II, Fall 2013
Special cases and extensions
Page 245
Extension: Multicommodity flow problem
I
Data:
I
I
I
I
I
I
A directed graph G = (N , A) (matrix A)
uij 2 <+ [ +1, (i, j) 2 A
Set K of products (commodities) to be shipped
bik 2 <, i 2 N , k 2 K — supply of commodity k at node i
cijk 2 <, (i, j) 2 A, k 2 K — unit cost of shipping commodity
k on arc (i, j)
Formulation: fijk — flow of commodity k on arc (i, j)
X X
(MCFP) min
cijk fijk
s.t.
k2K (i,j)2A
Af k = bk
X
k2K
fijk
I
I
fijk uij
0
k 2K
(i, j) 2 A
(i, j) 2 A, k 2 K
Case uij = 1 8(i, j) equivalent to |K | separate NFPs
Capacitated case more complex; no integrality property
IOE 610: LP II, Fall 2013
Special cases and extensions
Page 246
© Copyright 2026 Paperzz