Chapter 2
Notation and Definitions
Data Structures
Transformations
1
Node-Arc Incidence Matrix
Consider the network in Figure 2.13, p. 32. The flowconservation constraints in the LP formulation are:
x12
x13
x12
b1
x24
x13
x32
x32
x24
b2
x43
x43
x53
x45
x45
x53
b3
x54
b4
x54
b5
Notice that these have a very special form. If we extract the
coefficients of the variables into a matrix we get:
2
1, 2 1,3 2, 4 3, 2 4,3 4,5 5,3 5, 4
1
1
1
0
0
0
0
0
0
2
1
0
1
1
0
0
0
0
3
0
1
0
1
1
0
1
0
4
0
0
1
0
1
1
0
1
5
0
0
0
0
0
1
1
1
•
•
•
•
It has a row for each node and a column for each arc (n x m)
The matrix consists of 0, +1 and –1 entries
Each column contains one +1 (tail/from) and one –1 (head/to)
The +1’s in a node’s row identify all the arcs emanating from
that node
• The –1’s in a node’s row identify all the arcs directed into it
3
Node-Node Adjacency Matrix
• The (i, j)th element of this
n x n matrix contains a 1 if
there is an arc (i, j) and a 0
otherwise
• The 1’s in a node’s row
indicate arcs emanating
from it
• The 1’s in a node’s
column identify arcs
directed into it
1 2 3 4 5
1 0 1 1 0 0
2 0 0 0 1 0
3 0 1 0 0 0
4 0 0 1 0 1
5 0 0 1 1 0
4
Adjacency List
Both the incidence and the adjacency matrix are inefficient
for sparse networks. An alternative is to use linked lists to
store the arcs that exist. Following the pointers from first(i)
identifies all the arcs emanating from node i, along with
their costs and capacities.
1
2 25 30
2
4 15 40
0
3
2 45 10
0
4
5
Array first
3 35 50
0
3 15 30
5 45 60
0
3 25 20
4 35 50
0
5
Forward Star
Similar to the adjacency list but uses fixed-size arrays rather
than linked lists.
node
point
arc
tail
head
cost
capacity
1
1
1
1
2
25
30
2
3
2
1
3
35
50
3
4
3
2
4
15
40
4
5
4
3
2
45
10
5
7
5
4
3
15
30
6
9
6
4
5
45
60
7
5
3
25
20
8
5
4
35
50
6
• Arcs are numbered in order of those directed out of node 1,
followed by those directed out of node 2, etc.
• To find all the arcs directed out of node i (along with cost &
capacity), go to point(i), which stores the index of the first
arc directed out of node i and stop when you get to
point(i+1) – 1.
• A reverse star is similar except it is organized according to
arcs directed into each node.
• Storing both the forward and reverse star means a lot of
duplicated information; it can be reduced by a compact
forward and reverse star representation.
7
Forward and Reverse Star
point
tail
head
cost
capacity
trace
rpoint
1
1
1
1
2
25
30
1
1
1
1
2
3
2
1
3
35
50
4
2
1
2
3
4
3
2
4
15
40
2
3
3
3
4
5
4
3
2
45
10
5
4
6
4
5
7
5
4
3
15
30
7
5
8
5
6
9
6
4
5
45
60
3
6
9
6
7
5
3
25
20
8
7
8
5
4
35
50
6
8
8
Network Transformations
•
•
•
•
Simplify a network
Show that two network formulations are equivalent
State in a standard form required by a solution algorithm
Transformations we will use:
– Change undirected arcs to directed arcs
– Remove lower and upper bounds
– Arc reversal (to change negative costs to positive)
• In each case, the resulting network is equivalent (w.r.t.
optimization) to original
– at least some of the optimal solutions for the original network
remain optimal in the transformed network
9
Transform Undirected Arcs to Directed
• Original undirected arc {i, j} has cost cij0 and capacity uij
(this only works if lij = 0).
– Constraint xij x ji uij
– Term in objective function cij xij cij x ji
– In some optimal solution, at least one of {xij, xji} will be zero (nonoverlapping)
• Transformed network has two directed arcs (i, j) and (j, i)
– Each has cost cij and capacity uij
– If original arc {i, j} has (non-overlapping) flow from i to j and 0
from j to i, then in transformed net, xij = , xji = 0.
– If transformed network has flows xij and xji, then original network
has flow 0 from j to i and xij x ji from i to j if this qty is > 0
0 from i to j and x ji xij from j to i if this qty is > 0
10
Remove Nonzero Lower Bounds
•
•
•
•
•
Original arc (i, j) has lower bound lij > 0
Let “excess flow” xij xij lij
Flow bound constraint becomes lij xij lij uij , or 0 xij uij lij
Effect is to decrease b(i) by lij and increase b(j) by lij
A constant amount cij lij is subtracted from the objective
function – does not affect set of optimal solutions
Fig. 2.19 should be: (direction of arc unchanged)
b(i)
i
(cij, uij )
xij
b(j)
b(i)- lij
j
i
(cij, uij - lij )
xij’
b(j)+lij
j
11
Change Negative Cost to Positive
• Reverse direction of the arc by replacing xij by uij - xji
• Effect is to replace arc (i, j) with cost cij by an arc (j, i) with
cost -cij
• Reversal subtracts uij from b(i) and adds it to b(j)
• Equivalent to sending uij units of flow across (i, j) and then
subtracting back the new flow xji
b(i)
i
(cij, uij )
xij
b(j)
b(i)- uij
j
i
(-cij, uij)
xji
b(j)+uij
j
12
Remove Arc Capacities
• Introduce a slack variable sij 0 so the upper bound
constraint becomes xij sij uij , or xij sij uij
• Interpret constraint as the conservation of flow constraint
for a new node k (flow in = demand of uij).
• Subtract this new constraint from the cons. of flow
constraint for node j.
b(i)
i
(cij, uij )
xij
b(j)
b(i)
j
i
(-cij, )
xij
-uij
k
(0, )
sij
b(j)+uij
j
13
Remove Capacities (cont.)
• If every arc in the original network is capacitated, applying
this transformation to each of them results in a bipartite
uncapacitated network.
– Each original node i becomes a supply node with b(i) k: k ,i A uki
– Each newly created node (inserted in arc (i, j)) is a demand node
with demand uij
• Original capacitated minimum cost network flow problem
with n nodes and m arcs is equivalent to uncapacitated
transportation problem with n supply nodes and m demand
nodes.
14
© Copyright 2026 Paperzz