470 likes | 487 Views
Linear programming. maximize x 1 + x 2 x 1 + 3x 2 3 3x 1 + x 2 5 x 1 0 x 2 0. Linear programming. maximize x 1 + x 2 x 1 + 3x 2 3 3x 1 + x 2 5 x 1 0 x 2 0. x 1. x 2. Linear programming. maximize x 1 + x 2 x 1 + 3x 2 3 3x 1 + x 2 5
E N D
Linear programming maximize x1 + x2 x1 + 3x2 3 3x1 + x2 5 x1 0 x2 0
Linear programming maximize x1 + x2 x1 + 3x2 3 3x1 + x2 5 x1 0 x2 0 x1 x2
Linear programming maximize x1 + x2 x1 + 3x2 3 3x1 + x2 5 x1 0 x2 0 x1 x2
Linear programming maximize x1 + x2 x1 + 3x2 3 3x1 + x2 5 x1 0 x2 0 x1 feasible solutions x2
Linear programming maximize x1 + x2 x1 + 3x2 3 3x1 + x2 5 x1 0 x2 0 x1 optimal solution x1=1/2, x2=3/2 x2
Can you prove it is optimal ? maximize x1 + x2 x1 + 3x2 3 3x1 + x2 5 x1 0 x2 0 x1 optimal solution x1=1/2, x2=3/2 x2
Can you prove it is optimal ? maximize x1 + x2 x1 + 3x2 3 3x1 + x2 5 4x1 + 4x2 8 x1 optimal solution x1=1/2, x2=3/2 x2
Can you prove it is optimal ? maximize x1 + x2 x1 + 3x2 3 3x1 + x2 5 x1+x2 2 x1 optimal solution x1=1/2, x2=3/2 x2
Another linear program maximize x1 + x2 x1 + 2x2 3 4x1 + x2 5 x1 0 x2 0
Another linear program maximize x1 + x2 x1 + 2x2 3 4x1 + x2 5 x1 0 x2 0 x1=1, x2=1, optimal ?
Another linear program maximize x1 + x2 x1 + 2x2 3 *3 4x1 + x2 5 *1 x1 0 x2 0 7x1 + 7x2 14 x1=1, x2=1, optimal !
Systematic search for the proof of optimality maximize x1 + x2 x1 + 2x2 3 * y1 4x1 + x2 5 * y2 x1 0 x2 0
Systematic 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
Systematic search for the proof of optimality maximize x1 + x2 x1 + 2x2 3 * y1 4x1 + x2 5 * y2 x1 0 x2 0 min 3y1+5y2 y1 0 y2 0 y1 + 4y2 1 2y1+y2 1
Systematic search for the proof of optimality max x1+x2 x1 + 2x2 3 4x1 + x2 5 x1 0 x2 0 min 3y1+5y2 y1 + 4y2 1 2y1+y2 1 y1 0 y2 0 dual linear programs
Systematic search for the proof of optimality max x1+x2 x1 + 2x2 3 4x1 + x2 5 x1 0 x2 0 min 3y1+5y2 y1 + 4y2 1 2y1+y2 1 y1 0 y2 0 dual linear programs
Linear programming duality max x1+x2 x1 + 2x2 3 4x1 + x2 5 x1 0 x2 0 min 3y1+5y2 = y1 + 4y2 1 2y1+y2 1 y1 0 y2 0
Linear programs variables: x1,x2,...,xn linear function: a1x1 + a2x2 + ... + anxn linear constraint: equality a1x1 + a2x2 + ... + anxn = b inequality a1x1 + a2x2 + ... + anxn b
Linear 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
Linear 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)
Linear programs one of the most important modeling tools oil industry manufacturing marketing circuit design very important in theory as well
Shortest path t 4 v 6 2 1 s w 5 3 u
Shortest path t 4 v 6 2 1 s w 5 3 u ds = 0 du ds + 5 dv ds + 6 dw du + 3 dw dv + 1 dt dw + 2 dt dv + 4 max dt
Max-Flow FLOW CONSERVATION CAPACITY CONSTRAINTS fu,v = 0 vV fu,v c(u,v) SKEW SYMMETRY fu,v = - fv,u
fu,v = 0 vV Max-Flow objective = ? us,t: fu,v c(u,v) fu,v + fv,u=0
max fs,v fu,v = 0 vV vV Max-Flow us,t: fu,v c(u,v) fu,v + fv,u=0
Linear programming duality maximize minimize constraint variable equality unrestricted non-negative variable constraint unrestricted equality non-negative
Linear programming duality max x1+x2 x1+x2+x3+x4=1 x1+2x3 1 x2+2x4 2 x1 0 x4 0 maximize minimize constraint variable equality unrestricted non-negative variable constraint unrestricted equality non-negative
Linear programming duality max x1+x2 x1+x2+x3+x4=1 x1+2x3 1 x2+2x4 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
Linear programming duality max x1+x2 x1+x2+x3+x4=1 x1+2x3 1 x2+2x4 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
Linear programming duality max x1+x2 x1+x2+x3+x4=1 x1+2x3 1 x2+2x4 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
Linear programming duality max x1+x2 x1+x2+x3+x4=1 x1+2x3 1 x2+2x4 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
“” “=” and non-negativity a1 x1 + ... + an xn b a1 x1 + ... + an xn= b + y, y 0 a1 x1 + ... + an xn – y = b, y 0
“=” “” a1 x1 + ... + an xn= b a1 x1 + ... + an xn b a1 x1 + ... + an xnb a1 x1 + ... + an xn b -a1 x1 - ... - an xn -b
optimization feasibility max a1x1+...+anxn a1x1+...+anxn P + binary search on P
max fs,v fu,v = 0 vV vV Max-Flow us,t: fu,v c(u,v) fu,v + fv,u=0
max fs,v fu,v = 0 vV vV Max-Flow us,t: yu zu,v 0 fu,v c(u,v) fu,v + fv,u=0 w{u,v}
max fs,v fu,v = 0 vV vV Max-Flow min c(u,v)zu,v u,v us,t: yu fu,v c(u,v) zu,v fu,v + fv,u=0 w{u,v} zu,v 0
max fs,v fu,v = 0 vV vV Max-Flow min c(u,v)zu,v u,v us,t us,t: yu + fu,v c(u,v) zu,v =0 + fu,v + fv,u=0 w{u,v} zu,v 0
Max-Flow min c(u,v)zu,v u,v yu + zu,v + w{u,v} =0 us,t ys = -1 zs,v + w{s,v} =1 yt = 0 zt,v + w{t,v} =0 zu,v 0
Max-Flow min c(u,v)zu,v u,v yu + zu,v + w{u,v} =0 ys = -1 yt = 0 zu,v 0
Max-Flow min c(u,v)zu,v u,v yu + zu,v + w{u,v} =0 yv + zv,u + w{u,v} =0 ys = -1 yt = 0 zu,v 0
Max-Flow min c(u,v)zu,v u,v yu + zu,v + w{u,v} =0 yv + zv,u + w{u,v} =0 ys = -1 yt = 0 yu - yv= zv,u - zu,v zu,v 0
min c(u,v)zu,v u,v Max-Flow ys = -1 yu - yv= zv,u - zu,v yt = 0 zu,v 0
min c(u,v) max{0,yu-yv} u,v Max-Flow ys = -1 yu - yv= zv,u - zu,v yt = 0 zu,v 0
min c(u,v) max{0,yu-yv} u,v Max-Flow ys = -1 yt = 0
min c(u,v) max{0,yu-yv} u,v Max-Flow = Min-Cut ys = -1 one more trick achieves yu {-1,0} yt = 0 min c(u,v) S,s S tSC u S,v SC