# IEOR 4004 Midterm review (Part II) March 12, 2014.

## Presentation on theme: "IEOR 4004 Midterm review (Part II) March 12, 2014."— Presentation transcript:

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 x 1 − 2x 2 + x 3 + x 4 = 1 − x 1 + 3x 2 + 2x 3 + x 4 = 2 max z = 2x 2 − 3x 3 x 1, x 2, x 3, x 4 ≥ 0 3 21 B -1 = −B -1 N = −5 −8 −2 −3 B -1 b = 7373 x 1 = 7 − 5x 3 − 8x 4 x 2 = 3 − 2x 3 − 3x 4 z = 6 − 7x 3 − 6x 4 c N − c B B -1 N = (−7, −6) Basis: {x 1, x 2 } 1 −2 −1 3 B=B= 1 21 N=N= c B B -1 b = 6 x 1 x 2 x 3 x 4 z 0 0 7 6 6 x 1 1 0 5 8 7 x 2 0 1 2 3 3

Duality Normal form max 3x 1 + 2x 2 x 1 +x 2 ≤ 80 2x 1 +x 2 ≤ 100 x 1, x 2 ≥ 0 y 1 +2y 2 ≥ 3 y 1 +y 2 ≥ 2 y1 y2 x1 x2 min 80y 1 + 100y 2 y 1, y 2 ≥ 0 PRIMAL DUAL Primal maxDual min ≤ constraint ≥ 0 variable ≥ constraint ≤ 0 variable = constraintunrestricted var ≥ 0 variable ≥ constraint ≤ 0 variable ≤ constraint unrestricted var = constraint

Duality (Weak duality) the value of every dual solution is 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 (min) PRIMAL (max) Simplex Dual Simplex Optimal solution objective value

max 3x 1 +2x 2 x 1 + x 2 + s 1 = 80 2x 1 + x 2 + s 2 = 100 x 1, x 2, s 1, s 2 ≥ 0 Duality graphically 20 40 6080 0 20 40 60 80 x1x1 x2x2 s2s2 s1s1 max 3x 1 +2x 2 x 1 + x 2 ≤ 80 2x 1 + x 2 ≤ 100 x 1, x 2 ≥ 0 min 80y 1 +100y 2 y 1 +2y 2 − t 1 = 3 y 1 +y 2 − t 2 = 2 y 1, y 2, t 1, t 2 ≥ 0 min 80y 1 + 100y 2 y 1 + 2y 2 ≥ 3 y 1 + y 2 ≥ 2 y 1, y 2 ≥ 0 1 2 3 0 1 2 y1y1 y2y2 t2t2 t1t1 100 feasible optimal dually feasible complementary solution (shadow prices)

Complementary slackness (x 1,…,x n ) a primal solution, (y 1,…,y m ) a dual solution are complementary to one another if for every i: a)If i -th constraint in primal is not tight for values (x 1,…,x n ), then y i =0 b)if x i is positive, then the corresponding dual constraint is tight for values (y 1,…,y m ) (Complementary slackness) If both (x 1,…,x n ) and (y 1,…,y m ) are optimal, then they are complementary to one another. 80y 1 + 100y 2 = v y 1 +2y 2 ≥ 3 y 1 +y 2 ≥ 2 y 1, y 2 ≥ 0 DUAL (min) 3x 1 + 2x 2 = z x 1 +x 2 ≤ 80 2x 1 +x 2 ≤ 100 x 1, x 2 ≥ 0 PRIMAL (max) x 1 : 20 x 2 : 60 y 1 : 1 y 2 : 1 50 0 1.5 0 100 0 2 Complementary sol’s

Shadow prices π i = shadow price of i -th constraint – change in the value of z when b i changed to b i +1 every solution yields different shadow prices shadow prices = complementary dual solution PRIMAL (max) DUAL (min) x π x π feasible infeasiblefeasible infeasible If both feasible then both optimal max 3x 1 + 2x 2 π 1 : x 1 +x 2 ≤ 80 π 2 : 2x 1 +x 2 ≤ 100 x 1, x 2 ≥ 0 x 1 = 20 x 2 = 60 z = 180 solution complementary π 1 = 1 π 2 = 1

Pricing-out variables pricing-out = calculating cost in shadow prices “multiplying the column of x i by shadow prices” reduced cost = coefficient c i in z minus cost If reduced cost positive, increasing x i increases z max 3x 1 + 2x 2 x 1 + 1x 2 ≤ 80 2x 1 + 1x 2 ≤ 100 x 1, x 2 ≥ 0 x 1 = 50 x 2 = 0 z = 150 solution π 1 = \$0 π 2 = \$1.5 Price out x 2 : Reduced cost of x 2 : increasing x 2 yields a better solution positive 1 × \$0 + 1 × \$1.5 \$2 − \$1.5 = \$0.5 opportunity cost

x 1 = 20 + s 1 − s 2 x 2 = 60 − 2s 1 + s 2 z = 180 −s 1 − s 2 Complementary dictionary x1x2s1s2x1x2s1s2 t1t2y1y2t1t2y1y2 values objective Basic Non-basic Basic rotate replace complementary variables − y 1 = − y 2 = t2t2 t1t1 −1− 2t 2 +t 1 −1+t 2 − t 1 y 1 = 1 + 2t 2 − t 1 y 2 = 1 − t 2 + t 1 (min) v =180+60t 2 +20t 1 Complementary dual dictionary (dual basis) x 1 = 20 + s 1 − s 2 x 2 = 60 − 2s 1 + s 2 z = 180 −s 1 − s 2 Primal dictionary (basis) (max) primal vars primal slack dual slack dual vars Complementarity rules

Complementarity - summary Max cx Min by Ax + s = byA − t = c x, s ≥ 0y, t ≥ 0 primal and dual bases are complementary If ( x B,s B ) is a primal basis then ( y N,t N ) is the corresponding complementary dual basis. x i × t i = 0y j × s j = 0 (complementarity) values and reduced costs switch roles

Sensitivity analysis Determining the effect of changes in the input (coefficients) on the (optimal) solution Problem ModifiedproblemOptimal(modified)basis Optimalsolution Optimal(modified)solution Optimalbasis

Sensitivity analysis x 1 − 2x 2 + x 3 + x 4 = 1 − x 1 + 3x 2 + 2x 3 + x 4 = 2 max z = 2x 2 − 3x 3 x 1, x 2, x 3, x 4 ≥ 0 3 21 B -1 = −B -1 N = −7 −5 −3 −2 B -1 b = 7373 x 1 = 7 − 7x 3 − 5x 4 x 2 = 3 − 3x 3 − 2x 4 z = 2x 2 − 3x 3 = 6 − 9x 3 − 4x 4 x 1 = 7 + 3Δ ≥ 0 x 2 = 3 + 1Δ ≥ 0 Changing rhs b 1 =1 to (1+Δ) − 9 − 3Δ ≤ 0 − 4 − 2Δ ≤ 0 Changing z from 2x 2 to (2+Δ)x 2 c N − c B B -1 N = (−9, −4) 1 −2 −1 3 B=B= Optimal basis: {x 1, x 2 } − 9 + Δ ≤ 0 − 3x 3 to (− 3+Δ)x 3

Alternative solutions Every LP has 0, 1, or ∞ optimal solutions If (x 1,x 2 ) and (x 1 ’, x 2 ’) are optimal solutions then so is every convex combination (x 1 ’’,x 2 ’’) = λ(x 1,x 2 ) + (1 − λ) (x 1 ’, x 2 ’) where 0 ≤ λ ≤ 1 max 2x 1 + 2x 2 x 1 +x 2 ≤ 80 2x 1 +x 2 ≤ 100 x 1, x 2 ≥ 0 optimal (basic) solutions: (0,80) and (20,60) x 1 = 20 + s 1 − s 2 x 2 = 60 − 2s 1 + s 2 z = 180 − 2s 1 x 1 = 20 − Δ x 2 = 60 + Δ 0 ≤ Δ ≤ 20 (x 1, x 2 ) = λ(0,80) +(1 − λ) (20,60) x 1 = 20 − 20 λ x 2 = 60 + 20 λ

Goal Programming Constraints: x 1 +x 2 ≤ 80 2x 1 +x 2 ≤ 100 x 1, x 2 ≥ 0 Goals #1: 3x 1 +2x 2 ≥ 140 #2: 3x 1 +4x 2 ≤ 130 #3: x 1 ≤ 40 Penalties: #1: pay \$1.2 /unit #2: pay \$0.8 /unit #3: pay \$3 /unit for each missing unit Introduce slack (unrestricted) #1: 3x 1 +2x 2 − s 1 = 140 #2: 3x 1 +4x 2 + s 2 = 130 #3: x 1 + s 3 = 40 We pay penalty only if slack is negative s 1 = s 1 + − s 1 − s 2 = s 2 + − s 2 − s 3 = s 3 + − s 3 − Penalties: 1.2s 1 − 0.8s 2 − 3s 3 − Positive part Negative part Minimize total penalty! Minimize 1.2s 1 − + 0.8s 2 − + 3s 3 − 3x 1 +2x 2 − s 1 + + s 1 − = 140 3x 1 +4x 2 + s 2 + − s 2 − = 130 x1 + s 3 + − s 3 − = 40 x 1 +x 2 ≤ 80 2x 1 +x 2 ≤ 100 x 1, x 2, s 1 +, s 1 −, s 2 +, s 2 −, s 3 +, s 3 − ≥ 0

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) Write your answers clearly !!! (for the questions asked)