160 likes | 306 Vues
IEOR 4004 Midterm review (Part II). March 12 , 2014. Summary. Matrices, Tableaux, and Dictionaries Duality Shadow prices Complementary slackness Sensitivity analysis Multiple solutions Goal Programming. Matrices, Tableaux and Dictionaries. Basis: {x 1 , x 2 }. c B. c N.
E N D
IEOR 4004 Midterm review(Part II) March 12, 2014
Summary • Matrices, Tableaux, and Dictionaries • Duality • Shadow prices • Complementary slackness • Sensitivity analysis • Multiple solutions • Goal Programming
Matrices, Tableaux and Dictionaries Basis: {x1, x2} cB cN x1 = 7 − 5x3 − 8x4 x2 = 3 − 2x3− 3x4 z = 6 − 7x3− 6x4 max z = 2x2 − 3x3 b N B x1 − 2x2 + x3 + x4 = 1 − x1 + 3x2 + 2x3 + x4= 2 x1 x2 x3 x4 z 0 0 7 6 6 x1 1 0 5 8 7 x2 0 1 2 3 3 xB xN x1, x2, x3, x4 ≥ 0 N= 1 −2 −1 3 B= 3 2 1 1 7 3 −B-1N = B-1= B-1b = 1 2 1 1 −5 −8 −2 −3 cN − cBB-1N = (−7, −6) cBB-1b = 6
Duality • Normal form DUAL max 3x1 + 2x2 x1 + x2 ≤ 80 2x1 + x2 ≤ 100 x1, x2 ≥ 0 min 80y1 + 100y2 y1 + 2y2≥ 3 y1 + y2≥ 2 y1 y2 x1 x2 y1, y2 ≥ 0 PRIMAL Primal maxDual min ≤ constraint ≥ 0 variable ≥ constraint ≤ 0 variable = constraint unrestricted var ≥ 0 variable ≥ constraint ≤ 0 variable ≤ constraint unrestricted var= constraint
Duality DUAL (min) • (Weak duality) the value of every dual solutionis an upper bound on the value of every primal solution (for maximization) • (Strong duality) if both primal and dual are feasible, then each have an optimal solution of the same value (no gap) Dual Simplex objective value Optimal solution Simplex PRIMAL (max)
Duality graphically max 3x1 +2x2 x1 + x2 ≤ 80 2x1 + x2 ≤ 100 x1, x2 ≥ 0 max 3x1 +2x2 x1 + x2 + s1 = 80 2x1 + x2 + s2 = 100 x1, x2, s1, s2 ≥ 0 min 80y1 + 100y2 y1 + 2y2≥ 3 y1 + y2≥ 2 y1, y2 ≥ 0 min 80y1 +100y2 y1 + 2y2− t1 = 3 y1 + y2− t2 = 2 y1, y2, t1, t2 ≥ 0 100 dually feasible 80 optimal complementary solution (shadow prices) 60 2 40 s1 feasible x1 s2 1 t1 20 t2 x2 y1 y2 0 0 20 60 80 40 1 3 2
Complementary slackness (x1,…,xn)a primalsolution, (y1,…,ym)a dualsolution are complementaryto one another if for every i: • If i-thconstraintin primal is nottightfor values (x1,…,xn), then yi=0 • if xi is positive, then the corresponding dual constraint is tightfor values (y1,…,ym) (Complementary slackness) If both (x1,…,xn) and (y1,…,ym)are optimal, then they are complementaryto one another. 3x1 + 2x2 = z x1 +x2 ≤ 80 2x1 + x2 ≤ 100 x1, x2 ≥ 0 PRIMAL (max) 80y1 + 100y2 = v y1 + 2y2≥ 3 y1 + y2≥ 2 y1, y2 ≥ 0 DUAL (min) Complementary sol’s x1 : 20 x2 : 60 y1 : 1 y2 : 1 0 100 0 2 50 0 0 1.5
max 3x1 + 2x2 π1:x1 + x2 ≤ 80 π2: 2x1 + x2 ≤ 100 x1, x2 ≥ 0 solution Shadow prices x1 = 20 x2 = 60 z = 180 π1 = 1 π2 = 1 • πi =shadow price of i-th constraint • change in the value of z when bi changed to bi+1 • every solutionyields different shadow prices • shadow prices = complementary dual solution DUAL (min) infeasible feasible complementary π x feasible infeasible complementary x π If both feasible then both optimal PRIMAL (max)
opportunity cost Pricing-out variables • pricing-out = calculating costin shadow prices“multiplying the column of xi by shadow prices” • reduced cost= coefficient ciin zminus cost • If reduced cost positive, increasing xi increases z solution x1 = 50 x2 = 0 z = 150 max 3x1 + 2x2 x1 + 1x2 ≤ 80 2x1 + 1x2 ≤ 100 x1, x2 ≥ 0 π1 = $0 π2 = $1.5 Price out x2: 1 × $0 + 1 × $1.5 Reduced cost of x2: $2 − $1.5 = $0.5 increasing x2 yields a better solution positive
Complementary dictionary Basic Non-basic Non-basic Basic x1 = 20 + s1− s2 x2 = 60 − 2s1 + s2 z = 180 − s1 − s2 t1 t2 x1 x2 s1 s2 objective values t1 t2 y1 y2 rotate Primal dictionary (basis) dual slack primal vars x1 = 20 + s1− s2 x2 = 60 − 2s1 + s2 z = 180 − s1 − s2 (max) (min) v = 180 +60t2 +20t1 dual vars primal slack − y1 = −1 − 2t2 +t1 y1 = 1 + 2t2 − t1 Complementarity rules Complementary dual dictionary (dual basis) − y2 = −1 +t2 − t1 y2 = 1 − t2 + t1 replace complementary variables
Complementarity - summary Max cx Min by Ax + s = b yA− t = c x, s ≥ 0 y, t ≥ 0 • primal and dualbases are complementary • If (xB,sB) is a primal basis then (yN,tN) is the corresponding complementarydual basis. xi × ti= 0yj × sj = 0 (complementarity) • values and reducedcosts switch roles
Sensitivity analysis • Determining the effect of changes in the input (coefficients) on the (optimal) solution Problem Optimal basis Optimal solution Modified problem Optimal (modified) basis Optimal (modified) solution
Sensitivity analysis Optimal basis: {x1, x2} B= x1 = 7 − 7x3 − 5x4 x2 = 3 − 3x3− 2x4 z = 2x2 − 3x3 = 6 − 9x3− 4x4 max z = 2x2 − 3x3 x1 − 2x2 + x3 + x4 = 1 − x1 + 3x2 + 2x3 + x4= 2 x1, x2, x3, x4 ≥ 0 cN − cBB-1N = (−9, −4) −B-1N = B-1= B-1b = 1 −2 −1 3 3 2 1 1 7 3 Changing rhsb1=1 to (1+Δ) Changing z from 2x2 to (2+Δ)x2 x1 = 7 + 3Δ ≥ 0 x2 = 3 + 1Δ ≥ 0 −7 −5 −3 −2 − 9 − 3Δ ≤ 0 − 4− 2Δ≤ 0 − 9 + Δ ≤ 0 − 3x3to (− 3+Δ)x3
Alternative solutions • Every LP has 0, 1, or ∞ optimal solutions • If (x1,x2) and (x1’ , x2’) are optimal solutions then so is every convex combination (x1’’,x2’’) = λ(x1,x2) + (1 − λ) (x1’ , x2’) where 0 ≤ λ≤ 1 optimal(basic) solutions: (0,80) and (20,60) (x1, x2) = λ(0,80) +(1 − λ) (20,60) x1 = 20 − 20 λ x2 = 60 + 20λ max 2x1 + 2x2 x1 + x2 ≤ 80 2x1 + x2 ≤ 100 x1, x2 ≥ 0 x1 = 20 + s1− s2 x2 = 60 − 2s1 + s2 z = 180 −2s1 x1 = 20 − Δ x2 = 60 + Δ 0 ≤ Δ ≤ 20
Goal Programming Minimize 1.2s1− + 0.8s2− + 3s3− 3x1+ 2x2 − s1++ s1− = 140 3x1+ 4x2 + s2+− s2− = 130 x1 + s3+− s3−= 40 x1 + x2 ≤ 80 2x1 + x2 ≤ 100 x1, x2, s1+, s1−, s2+, s2−, s3+, s3−≥ 0 Constraints: x1 + x2 ≤ 80 2x1 + x2 ≤ 100 x1, x2 ≥ 0 Goals #1: 3x1 + 2x2 ≥ 140 #2: 3x1 + 4x2 ≤ 130 #3: x1 ≤ 40 Penalties: #1: pay $1.2/unit #2: pay $0.8/unit #3: pay $3/unit for each missing unit Introduce slack (unrestricted) #1: 3x1 + 2x2 − s1 = 140 #2: 3x1 + 4x2+ s2 = 130 #3: x1 + s3 = 40 s1 = s1+− s1− Penalties: 1.2s1− 0.8s2− 3s3− Minimize total penalty! s2 = s2+− s2− s3 = s3+− s3− We pay penalty only if slack is negative Negative part Positive part
Notes • Substitute variables if it helps • Use variants of Simplex if it helps • Solve the dual if it is easier • Optimal basis is all you need to find out • Shadow prices = dual variables • Pricing out = checking dual constraints • Any feasible dual solution is an upper (lower) bound if we maximize (minimize) in primal • LP has 0,1,or ∞ solutions • If both primal and dual are feasible then they both have optimal solutions Write your answers clearly !!! (for the questions asked)