EMIS 8374:
Network Flows
“Easy” Integer Programming
Problems: Network Flow Problems
updated 4 April 2004
Basic Feasible Solutions
max
z 5x 8 y
x y 6
5 x 9 y 45
s.t.
x,
max
s.t.
y
1
2
0
Standard Form
z 5x 8 y
y
5x 9 y
x,
s,
x
y,
1
s
s
s
1
2
2
6
45
0
slide 1
Basic Feasible Solutions
max
z 5x 8 y
s.t.
y
5x 9 y
x,
s,
x
y,
1
s
s
s
1
2
2
6
45
0
Non-Basic Variables Basic Variables Intersection
BFS 1 S1 = S2 = 0
x = 2.25, y = 3.75 Constraints (1) and (2)
BFS 2 y = S1 = 0
x = 6, S2 = 15
Constraint (1) and x-axis
BFS 3 x = S2 = 0
y= 5, S1 = 1
Constraint (2) and y-axis
BFS 4 x = y = 0
S1 = 6, S2 = 45
x-axis and y-axis
slide 2
Vector-Matrix Representation
x
y s s
1 1 1 0
A
5 9 0 1
1
B
x , y
B
x , s
B
2
y , s
1
B s , s
1
2
1
AB 5
1
AB 5
1
AB 9
1
AB 0
2
1
9
0
1
1
0
0
1
6
b
45
2.25
AB b 3.75
6
1
AB b 15
5
1
AB b 1
6
1
AB b 45
1
slide 3
LP Formulation of Shortest Path
Example
min
8x 10 x 4 x 9 x 5x
6 x 2 x 3x 4 x 5x
x x
x x x x
x x x x
x x x x
x x x x
x x
0 x 1
12
13
34
st
35
23
45
12
13
23
24
25
12
34
35
13
23
45
46
24
34
56
25
35
45
46
56
24
46
25
56
1
0
0
0
0
1
ij
slide 4
Matrix Representation
x x x
12
13
23
x
24
x
25
x
34
x
35
x
45
x
46
x
56
1 0
0
0
0
0
0
0
0
1
1
1 0
0
1
1
1 0
0
0
0
0
0
1
1 0
0
0
0 1 1 0
0
A
, b
0
0
0
1
0
1
0
1
1
0
0
0
0
0
0
0 1 0 1 1 0
1
0
0
0
0
0
0
0
0
1
1
1
Observation: The last row of the matrix is equal to –1 times
the sum of the other rows.
MCNF LPs always have one redundant row.
slide 5
Matrix Representation without
the constraint for node 6
x x x
12
13
23
x
24
x
25
x
34
x
35
x
45
1 0
0
0
0
0
0
1
1 0
1
1
1 0
0
0
A 0 1 1 0
0
1
1 0
0
0 1 0 1 0
1
0
0
0
0
0 1 0 1 1
x
46
x
56
0 0
1
0
0 0
0 0, b 0
1 0
0
0
0 1
A BFS: B = {x12, x13, x24, x35, x56}
slide 6
Solving for the BFS
Constraints after non-basic variables are removed:
x x
x x
x x
x
x x
1
12
13
24
12
35
13
0
35
0
24
56
0
0
Solution: x24 = 0, x12 = 0, x13 = 1, x35 = 1, x56 = 1
slide 7
Solving for the BFS with Matrix
Algebra
x x
12
13
1
1
1 0
AB 0 1
0
0
0
0
x
24
x
35
0
0
1
0
0
1
1
0
0
1
x
56
0
1
0
0
0, b 0
0
0
0
1
0 x12
1
x13
1
x B AB b 0 x24
1 x35
1 x56
slide 8
Kramer’s (a.k.a Cramer’s) Rule
Component j of x = A-1b is
x
j
det B j
det A
aij
, Bj
a
n1
a
12
1
a
b
n2
ann
b a
n
1n
Take the matrix A and replace
column j with the vector b.
slide 9
Total Unimodularity
• A square, integer matrix is unimodular if its determinant is
1 or -1.
• An integer matrix A is called totally unimodular (TU) if
every square, nonsingular submatrix of A is unimodular.
• From Cramer’s rule, it follows that if A is TU and b is an
integer vector, then every BFS of the constraint system Ax
= b is integer.
• Examples:
– The matrix AB from the shortest path example is TU.
– The matrix A from the shortest path example is TU.
– The constraint matrix for any MCNF LP is TU.
slide 10
TU Theorem
• An integer matrix A is TU if
– All entries are -1, 0 or 1
– At most two non-zero entries appear in any column
– The rows of A can be partitioned into two disjoint sets
such that
• If a column has two entries of the same sign, their rows are in
different sets.
• If a column has two entries of different signs, their rows are in
the same set.
• The matrix A is TU if and only if is AT TU.
• The matrix A is TU if and only if [A, I] is TU.
Where I is the identity matrix.
slide 11
MCNF LPs are TU
x12
1
1
0
0
1
0
0
0
0
x
13
x
23
x
24
1
0
0
0
1
1
1
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
x
0
0
1
1
0
0
0
0
1
34
b
5
0
3
5
5
2
2
3
3
Flow Balance:
A is TU, so AT is TU.
Capacity
A
M .
I
M
A
T
T
A I .
I is TU.
T
M is TU.
slide 12
© Copyright 2026 Paperzz