ieor 4004 midterm review (part ii) march 12, 2014
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
x1 − 2x2 + x3 + x4 = 1 − x1 + 3x2 + 2x3 + x4 = 2max z = 2x2 − 3x3
x1, x2, x3, x4 ≥ 0
3 21 1B-1=−B-1N = −5 −8−2 −3B-1b = 73
x1 = 7 − 5x3 − 8x4 x2 = 3 − 2x3 − 3x4 z = 6 − 7x3 − 6x4 cN − cBB-1N = (−7, −6)
Basis: {x1, x2}B NcB cN bxB xN1 −2−1 3B= 1 211
N=
cBB-1b = 6
x1 x2 x3 x4 z 0 0 7 6 6 x1 1 0 5 8 7 x2 0 1 2 3 3
Duality
• Normal formmax 3x1 + 2x2x1 + x2 ≤ 802x1 + x2 ≤ 100x1, x2 ≥ 0
y1 + 2y2 ≥ 3y1 + y2 ≥ 2y1y2 x1x2min 80y1 + 100y2
y1, y2 ≥ 0PRIMAL
DUAL
Primal max Dual min ≤ constraint ≥ 0 variable ≥ constraint ≤ 0 variable= constraint unrestricted var ≥ 0 variable ≥ constraint ≤ 0 variable ≤ constraintunrestricted 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
DualSimplex
Optimalsolution
objectivevalue
max 3x1 +2x2x1 + x2 + s1 = 802x1 + x2 + s2 = 100x1, x2, s1, s2 ≥ 0
Duality graphically
20 40 60 800
20
40
60
80
x1 x2s2
s1
max 3x1 +2x2x1 + x2 ≤ 802x1 + x2 ≤ 100x1, x2 ≥ 0 min 80y1 +100y2y1 + 2y2 − t1 = 3y1 + y2 − t2 = 2y1, y2, t1, t2 ≥ 0
min 80y1 + 100y2y1 + 2y2 ≥ 3y1 + y2 ≥ 2y1, y2 ≥ 0
1 2 30
1
2
y1 y2t2t1
100
feasible
optimal
duallyfeasible
complementarysolution
(shadow prices)
Complementary slackness(x1,…,xn) a primal solution, (y1,…,ym) a dual solution are complementary to one another if for every i:a) If i-th constraint in primal is not tight for values (x1,…,xn),
then yi=0b) if xi is positive, then the corresponding dual constraint is tight
for values (y1,…,ym)(Complementary slackness) If both (x1,…,xn) and (y1,…,ym) are optimal, then they are complementary to one another.80y1 + 100y2 = vy1 + 2y2 ≥ 3y1 + y2 ≥ 2y1, y2 ≥ 0
DUAL (min)
3x1 + 2x2 = zx1 + x2 ≤ 802x1 + x2 ≤ 100x1, x2 ≥ 0PRIMAL (max)
x1 : 20x2 : 60y1 : 1y2 : 1
50001.5010002
Complementary sol’s
Shadow prices
• πi = shadow price of i-th constraint– change in the value of z when bi changed to bi+1
• every solution yields different shadow prices• shadow prices = complementary dual solution
PRIMAL(max)
DUAL(min)
x πx π
feasible
infeasible feasible
infeasible
If both feasiblethen both optimal
max 3x1 + 2x2π1: x1 + x2 ≤ 80π2: 2x1 + x2 ≤ 100x1, x2 ≥ 0x1 = 20x2 = 60z = 180
solution
complementary
complementary
π1 = 1π2 = 1
Pricing-out variables
• pricing-out = calculating cost in shadow prices“multiplying the column of xi by shadow prices”
• reduced cost = coefficient ci in z minus cost
• If reduced cost positive, increasing xi increases zmax 3x1 + 2x2 x1 + 1x2 ≤ 80 2x1 + 1x2 ≤ 100x1, x2 ≥ 0
x1 = 50x2 = 0z = 150solutionπ1 = $0π2 = $1.5Price out x2:
Reduced cost of x2:
increasing x2 yields a better solution positive
1 × $0 + 1 × $1.5$2 − $1.5 = $0.5
opportunitycost
x1 = 20 + s1 − s2
x2 = 60 − 2s1 + s2
z = 180 −s1 − s2
Complementary dictionary
x1x2s1s2
t1t2y1y2
values objective
BasicNon-basic
Non-basicBasic
rotate
replacecomplementary
variables
− y1 =− y2 =
t2 t1
−1 − 2t2 +t1−1 +t2 − t1y1 = 1 + 2t2 − t1y2 = 1 − t2 + t1
(min) v = 180+60t2+20t1Complementarydual dictionary
(dual basis)
x1 = 20 + s1 − s2x2 = 60 − 2s1 + s2z = 180 −s1 − s2
Primaldictionary
(basis)(max)primal
vars
primalslack
dualslack
dualvars
Complementarityrules
Complementarity - summary
Max cx Min by Ax + s = b yA − t = c x, s ≥ 0 y, t ≥ 0• primal and dual bases are complementary• If (xB,sB) is a primal basis then (yN,tN) is the
corresponding complementary dual basis.xi × ti = 0 yj × sj = 0(complementarity)• values and reduced costs switch roles
Sensitivity analysis
• Determining the effect of changes in the input (coefficients) on the (optimal) solution
Problem
Modifiedproblem
Optimal(modified)
basis
Optimalsolution
Optimal(modified)
solution
Optimalbasis
Sensitivity analysis
x1 − 2x2 + x3 + x4 = 1 − x1 + 3x2 + 2x3 + x4 = 2max z = 2x2 − 3x3
x1, x2, x3, x4 ≥ 03 21 1B-1= −B-1N = −7 −5−3 −2B-1b = 73
x1 = 7 − 7x3 − 5x4 x2 = 3 − 3x3 − 2x4 z = 2x2 − 3x3= 6 − 9x3 − 4x4
x1 = 7 + 3Δ ≥ 0x2 = 3 + 1Δ ≥ 0Changing rhs b1=1 to (1+Δ)
− 9 − 3Δ ≤ 0− 4 − 2Δ ≤ 0
Changing z from 2x2 to (2+Δ)x2
cN − cBB-1N = (−9, −4)
1 −2−1 3B= Optimal basis:{x1, x2}
− 9 + Δ ≤ 0− 3x3 to (− 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
max 2x1 + 2x2 x1 + x2 ≤ 80 2x1 + x2 ≤ 100x1, x2 ≥ 0
optimal (basic) solutions: (0,80) and (20,60) x1 = 20 + s1 − s2x2 = 60 − 2s1 + s2z = 180 − 2s1
x1 = 20 − Δx2 = 60 + Δ 0 ≤ Δ ≤ 20
(x1, x2) = λ(0,80)+(1 − λ) (20,60)x1 = 20 − 20 λ x2 = 60 + 20 λ
Goal ProgrammingConstraints:x1 + x2 ≤ 802x1 + x2 ≤ 100x1, x2 ≥ 0
Goals#1: 3x1 + 2x2 ≥ 140#2: 3x1 + 4x2 ≤ 130#3: x1 ≤ 40Penalties:
#1: pay $1.2/unit#2: pay $0.8/unit#3: pay $3/unitfor each missing unit
Introduce slack (unrestricted)#1: 3x1 + 2x2 − s1 = 140#2: 3x1 + 4x2 + s2 = 130#3: x1 + s3 = 40
We pay penalty onlyif slack is negative
s1 = s1+ − s1−s2 = s2+ − s2−s3 = s3+ − s3−
Penalties:1.2s1−0.8s2−3s3−Positive part
Negative part
Minimize total penalty!
Minimize 1.2s1− + 0.8s2− + 3s3−3x1 + 2x2 − s1+ + s1− = 1403x1 + 4x2 + s2+ − s2− = 130x1 + s3+ − s3− = 40x1 + x2 ≤ 802x1 + x2 ≤ 100x1, x2, s1+, s1−, s2+, s2−, s3+, s3− ≥ 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)