Title: Linear programming
1Linear programming
maximize x1 x2 x1 3x2 ? 3 3x1 x2 ? 5 x1 ?
0 x2 ? 0
2Linear programming
maximize x1 x2 x1 3x2 ? 3 3x1 x2 ? 5 x1 ?
0 x2 ? 0
x1
x2
3Linear programming
maximize x1 x2 x1 3x2 ? 3 3x1 x2 ? 5 x1 ?
0 x2 ? 0
x1
x2
4Linear programming
maximize x1 x2 x1 3x2 ? 3 3x1 x2 ? 5 x1 ?
0 x2 ? 0
x1
feasible solutions
x2
5Linear programming
maximize x1 x2 x1 3x2 ? 3 3x1 x2 ? 5 x1 ?
0 x2 ? 0
x1
optimal solution x11/2, x23/2
x2
6Can you prove it is optimal ?
maximize x1 x2 x1 3x2 ? 3 3x1 x2 ? 5 x1 ?
0 x2 ? 0
x1
optimal solution x11/2, x23/2
x2
7Can you prove it is optimal ?
maximize x1 x2 x1 3x2 ? 3 3x1 x2 ? 5 4x1
4x2 ? 8
x1
optimal solution x11/2, x23/2
x2
8Can you prove it is optimal ?
maximize x1 x2 x1 3x2 ? 3 3x1 x2 ? 5
x1x2 ? 2
x1
optimal solution x11/2, x23/2
x2
9Another linear program
maximize x1 x2 x1 2x2 ? 3 4x1 x2 ? 5 x1 ?
0 x2 ? 0
10Another linear program
maximize x1 x2 x1 2x2 ? 3 4x1 x2 ? 5 x1 ?
0 x2 ? 0
x11, x21, optimal ?
11Another linear program
maximize x1 x2 x1 2x2 ? 3
3 4x1 x2 ? 5 1 x1 ? 0 x2 ? 0
7x1 7x2 ? 14
x11, x21, optimal !
12Systematic search for the proof of optimality
maximize x1 x2 x1 2x2 ? 3
y1 4x1 x2 ? 5 y2 x1 ? 0 x2 ? 0
13Systematic search for the proof of optimality
maximize x1 x2 x1 2x2 ? 3
y1 4x1 x2 ? 5 y2 x1 ? 0 x2 ? 0
y1 ? 0 y2 ? 0
14Systematic search for the proof of optimality
maximize x1 x2 x1 2x2 ? 3
y1 4x1 x2 ? 5 y2 x1 ? 0 x2 ? 0
y1 ? 0 y2 ? 0
min 3y15y2
y1 4y2 ? 1 2y1y2 ? 1
15Systematic search for the proof of optimality
max x1x2 x1 2x2 ? 3 4x1 x2 ? 5 x1 ?
0 x2 ? 0
min 3y15y2
y1 4y2 ? 1 2y1y2 ? 1
y1 ? 0 y2 ? 0
dual linear programs
16Systematic search for the proof of optimality
max x1x2 x1 2x2 ? 3 4x1 x2 ? 5 x1 ?
0 x2 ? 0
min 3y15y2
?
y1 4y2 ? 1 2y1y2 ? 1
y1 ? 0 y2 ? 0
dual linear programs
17Linear programming duality
max x1x2 x1 2x2 ? 3 4x1 x2 ? 5 x1 ?
0 x2 ? 0
min 3y15y2
y1 4y2 ? 1 2y1y2 ? 1
y1 ? 0 y2 ? 0
18Linear programs
variables x1,x2,...,xn
linear function a1x1 a2x2 ... anxn
linear constraint equality a1x1 a2x2
... anxn b inequality a1x1 a2x2 ...
anxn ? b
19Linear programs
variables x1,x2,...,xn
linear function a1x1 a2x2 ... anxn
linear constraint equality a1x1 a2x2
... anxn b inequality a1x1 a2x2 ...
anxn ? b
max/min of a linear function subject to
collection of linear constraints
20Linear programs
variables x1,x2,...,xn
linear function a1x1 a2x2 ... anxn
max/min of a linear function subject to
collection of linear constraints
linear constraint equality a1x1 a2x2
... anxn b inequality a1x1 a2x2 ...
anxn ? b
Goal find the optimal solution (i.e., a
feasible solution with the maximum value of the
objective)
21Linear programs
one of the most important modeling tools oil
industry manufacturing marketing
circuit design
very important in theory as well
22Shortest path
23Shortest path
ds 0 du ? ds 5 dv ? ds 6 dw ? du 3 dw ?
dv 1 dt ? dw 2 dt ? dv 4
max dt
24Max-Flow
FLOW CONSERVATION CAPACITY CONSTRAINTS
? fu,v 0
v?V
fu,v ? c(u,v)
SKEW SYMMETRY
fu,v - fv,u
25Max-Flow
objective ?
u?s,t
fu,v ? c(u,v)
fu,v fv,u0
26Max-Flow
u?s,t
fu,v ? c(u,v)
fu,v fv,u0
27Linear programming duality
maximize ? minimize constraint ? variable
equality ? unrestricted ? ?
non-negative variable ? constraint
unrestricted ? equality non-negative ?
?
28Linear programming duality
max x1x2 x1x2x3x41 x12x3 ? 1 x22x4 ? 2 x1
? 0 x4 ? 0
maximize ? minimize constraint ? variable
equality ? unrestricted ? ?
non-negative variable ? constraint
unrestricted ? equality non-negative ?
?
29Linear programming duality
max x1x2 x1x2x3x41 x12x3 ? 1 x22x4 ? 2 x1
? 0 x4 ? 0
y1 y2 ? 0 y3 ? 0
maximize ? minimize constraint ? variable
equality ? unrestricted ? ?
non-negative variable ? constraint
unrestricted ? equality non-negative ?
?
DONE
30Linear programming duality
max x1x2 x1x2x3x41 x12x3 ? 1 x22x4 ? 2 x1
? 0 x4 ? 0
min y1 y2 2 y3
y1 y2 ? 0 y3 ? 0
DONE
maximize ? minimize constraint ? variable
equality ? unrestricted ? ?
non-negative variable ? constraint
unrestricted ? equality non-negative ?
?
DONE
31Linear programming duality
max x1x2 x1x2x3x41 x12x3 ? 1 x22x4 ? 2 x1
? 0 x4 ? 0
min y1 y2 2 y3
y1 y2 ? 0 y3 ? 0
DONE
maximize ? minimize constraint ? variable
equality ? unrestricted ? ?
non-negative variable ? constraint
unrestricted ? equality non-negative ?
?
DONE
y1 y2 ? 1 y1 y3 1 y1 2y2 0 y1 2y3 ? 0
DONE
32Linear programming duality
max x1x2 x1x2x3x41 x12x3 ? 1 x22x4 ? 2 x1
? 0 x4 ? 0
min y1 y2 2 y3
y2 ? 0 y3 ? 0
y1 y2 ? 1 y1 y3 1 y1 2y2 0 y1 2y3 ? 0
33 ? ? and non-negativity
a1 x1 ... an xn ? b
a1 x1 ... an xn b y, y ? 0
a1 x1 ... an xn y b, y ? 0
34 ? ?
a1 x1 ... an xn b
a1 x1 ... an xn ? b a1 x1 ... an xn
? b
a1 x1 ... an xn ? b -a1 x1 - ... -
an xn ? -b
35optimization ? feasibility
max a1x1...anxn
a1x1...anxn ? P
binary search on P
36Max-Flow
u?s,t
fu,v ? c(u,v)
fu,v fv,u0
37Max-Flow
u?s,t
yu
zu,v ? 0
fu,v ? c(u,v)
fu,v fv,u0
wu,v
38Max-Flow
min ? c(u,v)zu,v
u,v
u?s,t
yu
fu,v ? c(u,v)
zu,v
fu,v fv,u0
wu,v
zu,v ? 0
39Max-Flow
min ? c(u,v)zu,v
u,v
u?s,t
u?s,t
yu
fu,v ? c(u,v)
zu,v
0
fu,v fv,u0
wu,v
zu,v ? 0
40Max-Flow
min ? c(u,v)zu,v
u,v
u?s,t
yu zu,v wu,v 0
ys -1
zs,v ws,v 1
yt 0
zt,v wt,v 0
zu,v ? 0
41Max-Flow
min ? c(u,v)zu,v
u,v
yu zu,v wu,v 0
ys -1
yt 0
zu,v ? 0
42Max-Flow
min ? c(u,v)zu,v
u,v
yu zu,v wu,v 0
ys -1
yv zv,u wu,v 0
yt 0
zu,v ? 0
43Max-Flow
min ? c(u,v)zu,v
u,v
yu zu,v wu,v 0
ys -1
yv zv,u wu,v 0
yt 0
yu - yv zv,u - zu,v
zu,v ? 0
44Max-Flow
ys -1
yu - yv zv,u - zu,v
yt 0
zu,v ? 0
45Max-Flow
ys -1
yu - yv zv,u - zu,v
yt 0
zu,v ? 0
46Max-Flow
ys -1
yt 0
47Max-Flow Min-Cut
ys -1
one more trick achieves yu ? -1,0
yt 0
min ? c(u,v)
S,s? S t?SC
u? S,v? SC