Upload
randell-thomas
View
280
Download
17
Embed Size (px)
Citation preview
1
Chapter 6
Sensitivity Analysis & Duality( 敏感度分析 & 對偶 )
2
Max. z = c1x1+ c2x2 +···+ cnxn
s.t. a11x1 + a12x2 +···+ a1nxn ≤ b1
a21x1 + a22x2 +···+ a2nxn ≤ b2
: : am1x1+ am2x2 +···+ amnxn ≤ bm
xi ≥ 0 (i=1,2, ···,n)
3
Different types of changes parameters change the optimal solution
1. Changing the objective function coefficient (ci) NBV (p.276) BV (p.278) Both of NBV and BV --The 100% optimal rule (p.289)
2. Changing the right-hand side of a constraint (bi). Bi (p.282) Many Bi --The 100% feasibility rule (p.292)
3. Changing the column of a (ai). NBV (p.285) BV
4. Adding a new variable or activity. (p.287)5. Adding a new constraint. (Dual Simplex p.300 )
p.262
4
6.1 A Graphical Introduction to Sensitivity Analysis
Sensitivity analysis is concerned with how changes in an LP’s parameters affect the optimal solution.
The optimal solution to the Giapetto problem was z = 180, x1 = 20, x2 = 60 (Point B) and it has x1, x2, and s3 as BV.
How would changes in the problem’s objective function coefficients or the constraint’s right-hand sides change this optimal solution?
p.262
5
Graphical Analysis of the Effect of a Change in an Objective Function Coefficient
If the isoprofit line is flatter than the carpentry constraint, Point A(0,80) is optimal.
Point B(20,60) is optimal if the isoprofit line is steeper than the carpentry constraint but flatter than the finishing constraint.
Point C(40,20) is optimal if the slope of the isoprofit line is steeper than the slope of the finishing constraint.
The isoprofit line is c1x1 + 2x2 = k, the slope of the isoprofit line is just -c1/2.
6
Graphical Analysis of the Effect of a Change in a rhs on the LP’s Optimal Solution
A graphical analysis can also be used to determine whether a change in the rhs of a constraint will make the basis no longer optimal.
In a constraint with a positive slack (or positive excess) in an LPs optimal solution, if we change the rhs of the constraint to a value in the range where the basis remains optimal, the optimal solution to the LP remains the same.
7
Shadow Prices
It is important to determine how a constraint’s rhs changes the optimal z-value.
The shadow price for the ith constraint of an LP is the amount by which the optimal z-value is improved if the rhs of the ith constraint is increased by one. This definition applies only if the change in the rhs of constraint i leaves the current basis optimal.
p.265
8
Importance of Sensitivity Analysis
Values of LP parameters might change. If a parameter changes, sensitivity analysis
shows it is unnecessary to solve the problem again.
Uncertainty about LP parameters. Even if demand is uncertain, the company can
be fairly confident that it can still produce optimal amounts of products.
9
6.2 Some Important Formulas
An LP’s optimal tableau can be expressed in terms of the LP’s parameters.
The formulas are used in the study of sensitivity analysis, duality, and advanced LP topics.
When solving a max problem that has been prepared for solution by the Big M method with the LP having m constraints and n variables. Although some of the variables may be slack, excess, or artificial, they are labeled x1, x2, …,xn.
p.267
10
The LP may then be written as
BV = {BV1, BV2, …, BVn} to be the set of basic variables in the optimal tableau.
NBV = {NBV1, NBV2, …, NBVn} the set of nonbasic variables in the optimal tableau.
cBV is the 1 x m row vector [cBV1 cBV2 ∙∙∙ cBVm].cNBV is the 1 x (n-m) row vector whose elements
are the coefficients of the nonbasic variables (in the order of NBV).
max z = c1x1 + c2x2 + … + cnxn
s.t. a11x1 + a12x2 + … + a1nxn = b1
a21x1 + a22x2 + … + a2nxn = b2
…. …. … … …
am1x1 + am2x2 + … + amnxn = bm
xi ≥ 0 (i = 1, 2, …, n)
11
The m x m matrix B is the matrix whose jth column is the column for BVj in the initial tableau.
Aj is the column (in the constraints) for the variable xj.N is the m x (n-m) matrix whose columns are the
columns for the nonbasic variables (in NBV order) in the initial tableau.
The m x 1 column vector b is the right-hand side of the constraints in the initial tableau.
Matrix algebra can be used to determine how an LP’s optimal tableau (with the set of basic variables BV) is related to the original LP.
12
max z = c1x1 + c2x2 + … + cnxn
s.t. a11x1 + a12x2 + … + a1nxn = b1
a21x1 + a22x2 + … + a2nxn = b2
…. …. … … …
am1x1 + am2x2 + … + amnxn = bm
xi ≥ 0 (i = 1, 2, …, n)
mnn2n1
2n2121
1n1211
a..aa
::::
a..aa
a..aa
..
..
naaaA
bxc
21
n
2
1
n
2
1
n21
b
:
b
b
x
:
x
x
ccc
13
NBA
x
xxccc
BVN
BVNBVBV
mnn2n1
2n2121
1n1211
a..aa
::::
a..aa
a..aa
..
..
naaaA
bxc
21
n
2
1
n
2
1
n21
b
:
b
b
x
:
x
x
ccc
14
-(1)- x cx c x
x ccZcxZ BVN NBVBV BV
BVN
BVBVN BV
(2)---bB NxB x NxBbB x
Nxb Bx b Nx Bx
bx
x NB bAx
1BVN
1BVBVN
11BV
BVNBVBVNBV
BVN
BV
bBcxcNBcZ
xcNBcbBc
xcNxBcbBc
xcNxBbBc
xcxcZ
1BVBVNNBV
1BV
BVNNBV1
BV1
BV
BVNNBVBVN1
BV1
BV
BVNNBVBVN11
BV
BVNNBVBVBV
)(
)(
)(
15
Simplex Tableau 矩陣形式
BV z XBv XNBV RHS
z 1 0 CBvB-1N-CNBV CBvB-1b
XBv 0 I B-1N B-1b
BV z X RHS
z 1 CBvB-1A-C CBvB-1b
XBv 0 B-1A B-1b
16
Simplex Tableau 矩陣形式
j
jBV
aBaBC
1j
1
j
c
x單一 NBV 之欄表示為
BV z X RHS
z 1 CBvB-1A-C CBvB-1b
XBv 0 B-1A B-1b
建議 :依數字順序計算
17
Max z=x1 + 4x2 + 0s1 + 0s2
s.t. x1 + 2x2 + 1s1 + 0s2 = 6
2x1 + x2 + 0s1 + 1s2 = 8
x1, x2,s1,s2, ≥0
Optimal Basis BV={x2 , s2}
11
02B
04 BV C
1012
0121 A
8
6 b
0041C
121
021
1B
18
121
023
021
121
1012
0121
121
021
AB 1
5
3
8
6
121
021
bB 1
0201
00410242
00411012
0121 02
00411012
0121
121
021
04cABC 1BV
12
8
6 02bBC 1
BV
BV Z X RHS
Z 1 CBvB-1A-C CBvB-1b
XBv 0 B-1A B-1b
19
121
023
021
121
AB 1
5
3 bB 1
0201 CABC 1BV 12 bB C 1
BV
5s s21
x0x21
3s0s21
x1x21
12s0s2x0xz
2121
2121
2121
BV z x1 x2 s1 s2 RHS
z 1 1 0 2 0 12
x2 0 ½ 1 ½ 0 3
s2 0 3/2 0 -½ 1 5
20
Example 1 : compute the optimal tableau
max. z=x1+4x2
s.t. x1+2x2 ≤6
2x1+x2 ≤8
x1,x2 ≥0
The optimal basis is BV={x2,s2}
p.273
max. z=x1+4x2
s.t. x1+2x2+s1 =6
2x1+x2 +s2=8
x1,x2, s1, s2 ≥0
1
0
11
02
21
21
1BB
21
21
21
21
21
1
2321
21
21
11
11
1
0
1
0
tableau optimal the in sfor column e Th
2
1
1
0aB
tableau optimal the in xfor column The 2
1a)1(
5
3
8
6
1
0bB
tableau optimal the side hand-right The 8
6b)2(
21
21
1
5ss x
3 sxx
2. rowfor BV the iss 1; rowfor BV the is x ,}s,x{BV
2121
123
121
2121
2222
22
5ss x
3 sxx
12 s2 x z
128
6 02bBC
o row stableau' optimal the of side hand-right the )4( 0. tableau optimal of 0 row in s , x tcoefficien )3(
2BC of element first
tableau optimal of 0 row in s tcoefficien )2 (
11-2
1 02caBC
tableau optimal of 0 row in x tcoefficien )1(
021
0 04BC04C
2121
123
121
2121
21
1BV
22
1BV
1
111
BV
1
21
21
1BVBV
23
Six types of changes in an LP’s parameters change the optimal solution
1.Changing the objective function coefficient of a NBV.
2.Changing the objective function coefficient of a BV.
3.Changing the right-hand side of a constraint.
4.Changing the column of a NBV.
5.Adding a new variable or activity.
6.Adding a new constraint. (Dual Simplex )
24
Example : Dakota problem (p.140)
max z = 60x1 + 30x2 + 20x3
s.t. 8x1+ 6x2 + x3 + s1 = 48
4x1+ 2x2 + 1.5x3 + s2 = 20
2x1+1.5x2 + 0.5x3 + s3 = 8
x1, x2, x3 , s1 , s2 , s3 ≥ 0
z +5x1 + 10s2 + 10s3= 280
-2x2 + s1+2s2 - 8s3 = 24
-2x2 + x3 +2s2 - 4s3 = 8
x1 + 1.25x2 - 0.5s2 +1.5s3= 2
x1, x2, x3 , s1 , s2 , s3 ≥ 0
25
z = 60x1 + 30x2 + 20x3 +0 s1 + 0s2 +0 s3
8x1+ 6x2 + x3 + s1 = 48
4x1+ 2x2 + 1.5x3 + s2 = 20
2x1+1.5x2 + 0.5x3 + s3 = 8
x1, x2, x3 , s1 , s2 , s3 ≥ 0
Optimal Basis BV={s1 , x3 , x1}
20.50
41.50
811
B
60200CBV
10050512
0105124
001168
..
.A
8
20
48
b
000203060C
51500
420
821
B 1
..
26
5150002511
420120
8210201
...
AB
10100050
00020306010100203560CABC 1
BV
2
8
24
1bB
280C 1BV bB
BV Z X RHS
Z 1 CBvB-1A-C CBvB-1b
XBv 0 B-1A B-1b
z +5x2 + 10s2 + 10s3= 280
-2x2 + s1+2s2 - 8s3 = 24
-2x2 + x3 +2s2 - 4s3 = 8
x1 + 1.25x2 - 0.5s2 +1.5s3= 2
x1, x2, x3 , s1 , s2 , s3 ≥ 0
27
BV Z X RHS
Z 1 CBvB-1A-C CBvB-1b
XBv 0 B-1A B-1b
1. Changing the objective functioncoefficient of NBV改變目標函數中“非基本變數”之係數
若 C 改變 , 則改變
Ex. c2=25
The current basis is still optimal.
[ ] [ ][ ] 0 101000100=
000202560 - 10100203560=
C-ABC -1BV
≥
28
Ex. c2=40
[ ] [ ][ ] 1010005 -0=
000204060 10100203560=
C-ABC 1-BV
Ex. For what value of c2 does the current basis remain optimal ?
[ ] [ ][ ]
22
2
2
1-BV
c 35 0 c - 35
O 101000c-350=
00020c60 - 10100203560=
C-ABC
≥⇒≥
≥
0s s x ,6.1x ,2.11x ,2.27s
288z
)278.p( 3.Table
)278.p( 2.Table
tableausimplexbuild
321231 ======
=⇒
⇒
⇒
⇒
The current basis is no longer optimal.
29
Table 2 (p.278)
BV Ratio
z -5x2 +10s2 +10s3 = 280 Z= 280
-2x2 +s1 + 2s2 - 8s3 = 24 s1= 24 None
-2x2 +x3 + 2s2 - 4s3 = 8 x3= 8 None
x1 +1.25x2 -0.5s2 +1.5s3 = 2 x1 = 2 1.6*
“ Final” (Suboptimal) Dakota Tableau ($40/Table)
30
Table 3 (p.278)
BV
z + 4x1 + 8s2 +16s3 = 288 Z= 288
1.6x1 +s1 +1.2s2 -5.6s3 = 27.2 s1= 27.2
1.6x1 +x3 +1.2s2 -1.6s3 = 11.2 x3= 11.2
0.8x1 +x2 -0.4s2 +1.2s3 = 1.6 x2 = 1.6
Optimal Dakota Tableau ($40/Table)
31300bB 1
BVC
BV Z X RHS
Z 1 CBvB-1A-C CBvB-1b
XBv 0 B-1A B-1b
2. Changing the objective function coefficient of a BV 改變目標函數中“基本變數”之係數
若 CBv 改變 ,則 改變
Ex. c1=70, CBv=[0 20 70]
0 105005.170
000203070 - 1050205.4770C-ABC 1-
BV
≥
32
Ex. For what value of c1 does the current basis remain optimal ?
80 c 560 c5.180c5.04000c25.1700
0002030cc5.180c5.040020c25.140c
0002030c
5.15.00025.11
220120
821020
c200
0002030c
1005.05.12
0105.124
001168
5.15.00
420
821
c200
1
111
11111
11
11
33
CBV
701000550
0002030100701002085100
CAB 1
Ex. c1=100 > 80
The current basis is no longer optimal.
0=s =x =x ,4=x ,4=s ,16=s
400=z
)281.p( 5.Table
)281.p( 4.Table
tableausimplexbuild
332121
⇒
⇒
⇒
⇒
34
Table 4 (p.281)
BV Ratio
z +55x2 -10s2 +70s3 = 360 Z= 360
- 2x2 +s1 +2s2 - 8s3 = 24 s1= 24 12
- 2x2 +x3 +2s2 - 4s3 = 8 x3 = 8 4*
x1 +1.25x2 -0.5s2 +1.5s3 = 2 x1 = 2 None
“ Final” (Suboptimal) Tableau if c1=100
35
Table 5 (p.281)
BV
z + 45x2 + 5x3 +50s3 = 400 Z= 400
- x3 + s1 - 4s3 = 16 s1= 16
- x2 +0.5x3 + s2 - 2s3 = 4 s2 = 4
x1 + 0.75x2 +0.25x3 +0.5s3 = 4 x1 = 4
Optimal Dakota Tableau if c1=100
36
BV Z X RHS
Z 1 CBvB-1A-C CBvB-1b
XBv 0 B-1A B-1b
3. Changing the right-hand side of a constraint 改變限制式的右邊值
若 b 改變 , 則 改變
O
4
12
28
bB 1
Ex. b2=22,
The current basis BV is not changed.
8
22
48
b
300bB 1 BVC
37
Ex. For what value of b2 does the current basis BV remain optimal ?
2416
5012
232
216
4
28
51500
420
821
2
2
2
2
21
b O
b.
b
b
b
..
bB
Ex. b2=30 > 24
The current basis is no longer optimal.
11.6chapter
)285.p(6.Table
tableausimplexbuild
3
28
44
bB 1
If the RHS of any constraint is negative, then the current basis is infeasible, a new solution must be found.
38
Table 6 (p.285)
BV
z + 5x2 +10s2 +10s3 = 380 Z= 380
- 2x2 +s1 + 2s2 - 8s3 = 24 s1 = 24
- 2x2 +x3 + 2s2 - 4s3 = 8 x3 = 8
x1 +1.25x2 -0.5s2 +1.5s3 = -3 x1 = - 3
“Final” (infeasible) Dakota Tableau if b2 = 30
39
BV z X RHS
z 1 CBvB-1A-C CBvB-1b
XBv 0 B-1A B-1b
4.Changing the column of a NBV 改變非基本變數之行係數 (ci and ai 均改變 )
若 A 改變 ,則 改變
101000100
000203060 10100204060
C
1000.522
0101.524
001158
1.50.50
420
821
60200
CABC 1BV
The current basis is still optimal.
Ex.
2
2
5
a2
p.285
40
10100030
000204360 10100204060
C
1005.022
0105.124
001158
5.15.00
420
821
60200
CABC 1BV
Ex. c2=43,
2
2
5
a2
The current basis is no longer optimal.
0ssx,1x,12x,31s
283z
)286.p(8.Table
)286.p(7.Table
tableausimplexbuild
322131
41
Table 7 (p.286)
BV Ratio
z - 3x2 +10s2 +10s3 = 280 Z= 280
- 7x2 +s1 + 2s2 - 8s3 = 24 s1= 24 None
- 4x2 +x3 + 2s2 - 4s3 = 8 x3= 8 None
x1 + 2x2 -0.5s2 +1.5s3 = 2 x1 = 2 1*
“ Final” (Suboptimal) Dakota Tableau for New Method of Making Tables
42
Table 8 (p.278)
BV
z +1.5x1 +9.25s2 +12.25s3 = 283 Z= 283
3.5x1 +s1 +0.25s2 -2.75s3 = 31 s1= 31
2x1 +x3 + s2 - s3 = 12 x3= 12
0.5x1 +x2 -0.25s2 +0.75s3 = 1 x2 = 1
Optimal Dakota Tableau for New Method of Making Tables
43
BV Z X RHS
Z 1 CBvB-1A-C CBvB-1b
XBv 0 B-1A B-1b
5. Adding a new variable or activity 增加新的活動
若 A, C 改變 ,則改變
If current basis will remain optimal if ≥0 or become nonoptimal if ≤ 0
44
Ex. c4=15,
1
1
1
4a
O 1010050100
00015203060 1010020204060
C
10015.05.12
01015.124
0011168
5.15.00
420
821
60200
CABC 1BV
The current basis is still optimal
45
Exercise: p.288 Dakota problem1. Show that the current basis remains optimal if c3 satisfies
15≤c3≤22.5. If c3=21, find the new optimal solution. Also, if c3=25, find the new optimal solution.
2. If c1=55, show that the new optimal solution does not produce any desks.
3. Show that if b1≥24, the current basis remains optimal. If b1=30, find the new optimal solution.
4.Show that if tables sell for $50 and use 1 board ft of lumber, 3 finishing hours, and 1.5 carpentry hours, the current basis will no longer be optimal. Find the new optimal solution.
5. Dakota is considering manufacturing home computer tables. It sells for $36 and uses 6 board ft of lumber , 2 finishing hours, and 2 carpentry hours. Should the company manufacture any home computer tables?
46
Type 1 BV={s1, x3 , x1}
1.5.50
420
821
1.5
2
6
Change c3 to 20 + Δ
cBVB‑1 = [0 20+Δ 60] = [0 10+2Δ 10-4Δ]
Coefficient of x2 in row 0
=cBVB‑1a2‑c2 = [0 10+2Δ 10-4Δ ] -30 = 5-2Δ
New row 0 is z + (5‑2Δ)x2+(10+2Δ)s2+(10‑4Δ)s3
Current basis remains optimal if (1) 5‑2Δ 0 iff Δ 2.5 (2) 10 + 2Δ 0 iff Δ ‑5 ‑5Δ 2.5 or20‑5 c3 20+2.5.(3)10‑4Δ 0 iff Δ 2.5
47
Thus current basis remains optimal if ‑5 Δ 2.5 or 20‑5 c3 20+2.5.If c3=21 the current solution is still optimal , z increases by 8 to z=288. If c3=25,Δ=5, the tableau for the current optimal basis becomes z ‑5x2 + 20s2 ‑ 10s3 = 320 ‑2x2 + s1 + 2s2 ‑ 8s3 = 24 ‑2x2 + x3 + 2s2 ‑ 4s3 = 8 x1 + 1.25x2 ‑ .5s2 + 1.5s3 = 2Eventually we obtain the new optimal solutionz= 1000/3, x3= 40/3, x1=x2=0.
48
The 100% Rule for Changing objective function coefficient : The 100% Rule
Case 1 – All variables whose objective function coefficients are changed have nonzero reduced costs in the optimal row 0. The current basis remains optimal if and only if
the objective function coefficient for each variable remains within the allowable range .
If the current basis remains optimal, both the values of the decision variables and objective function remain unchanged. If the objective coefficient for any variable is outside the allowable range, the current basis is no longer optimal.
Case 2 – At least one variable whose objective function coefficient is changed has a reduced cost of zero.
p.289
49
The 100% Rule for Changing Right-Hand Sides
Case 1 – All constraints whose right-hand sides are being modified are nonbinding constraints. The current basis remains optimal if and only if
each rhs remains within its allowable range.Then the values of the decision variables and
optimal objective function remain unchanged. If the rhs for any constraint is outside its allowable
range, the current basis is no longer optimal.Case 2 – At least one of the constraints whose rhs is
being modified is a binding constraint (that is, has zero slack or excess).
p.292
50
6.5 Finding the Dual of an LP
Associated with any LP is another LP called the dual. Knowledge of the dual provides interesting economic and sensitivity analysis insights.
When taking the dual of any LP, the given LP is referred to as the primal. If the primal is a max problem, the dual will be a min problem and visa versa.
To find the dual to a max problem in which all the variables are required to be nonnegative and all the constraints are ≤ constraints (called normal max problem) the problem may be written as
p.295
51
Finding the Dual of a Normal Max or Min Problem
Table 14 (p.296)
Primal LP Dual LP
Maxn 個變數
m 個限制式
Minm 個限制式
n 個變數
第 i 個限制式 第 i 個變數
第 j 個變數 第 j 個限制式
i
i
iiij
b
b
bxa
j
j
jjij
c
c
cya
0
0
i
i
i
y
y
y
不限正負
0
0
j
j
j
x
x
x
不限正負
( 相反 )
( 一致 )
p.295
52
The dual of a normal max problem is called a normal min problem.
max z = c1x1+ c2x2 +…+ cnxn
s.t. a11x1 + a12x2 + … + a1nxn ≤ b1
a21x1 + a22x2 + … + a2nxn ≤ b2
… … … …
am1x1 + am2x2 + … + amnxn ≤ bm
xj ≥ 0 (j = 1, 2, …,n)
min w = b1y1+ b2y2 +…+ bmym
s.t. a11y1 + a21y2 + … + am1ym ≥ c1
a12y1 + a22y2 + … + am2ym ≥ c2
… … … …
a1ny1 + a2ny2 + …+ amnym ≥ cn
yi ≥ 0 (i = 1, 2, …,m)
53
主要問題與對偶問題之關係
Max Min
1 限制式 ≤ ≥ 0 變 數
2 ≥ ≤ 0
3 = urs
4 變 數 ≥ 0 ≥ 限制式
5 ≤ 0 ≤
6 urs =
54
Finding the Dual of a Normal Max or Min Problem
Table 14 (p.296)Example : Dakota problem (Table 15)Example : Diet problem (Table 16)Exercise : problem 1 (p.301)
p.295
55
Table 14 (p.296)
max z0
min w (x1 ≧0) (x2 ≧0) (xn ≧0)
x1 x2 … xn
(y1 ≧ 0) y1 a11 a12 … a1n ≦ b1
(y2 ≧ 0) y2 a21 a22 … a2n ≦ b2
… … … … … … …
(ym≧ 0) ym am1 am2 … anm ≦ bm
≧ c1 ≧ c2 ≧ cn
56
Table 15 (p.296)
max z
min w (x1 ≧0) (x2 ≧0) (x3 ≧0)
x1 x2 x3
(y1 ≧ 0) y1 8 6 1 ≦ 48
(y2 ≧ 0) y2 4 2 1.5 ≦ 20
(y3≧ 0) y3 2 1.5 0.5 ≦ 8
≧60 ≧30 ≧20
57
Table 16 (p.297)
max z
min w (x1 ≧0) (x2 ≧0) (x3 ≧0) (x4 ≧0)
x1 x2 x3 x4
(y1 ≧ 0) y1 400 3 2 2 ≦ 50
(y2 ≧ 0) y2 200 2 2 4 ≦ 20
(y3 ≧ 0) y3 150 0 4 1 ≦ 30
(y4≧ 0) y4 500 0 4 5 ≦ 80
≧500 ≧6 ≧10 ≧8
58
Transforming into normal formNormal max problem : step1 ~ 3Normal min problem : step1 ~ 3
Finding the dual of a nonnormal max problemstep1 ~ 2 (p.299), Example : table17-18
Finding the dual of a nonnormal min problemstep1 ~ 2 (p.300), Example : table19-20
Exercise : problem 3, 4 (p.301)
Finding the Dual of a Nonnormal LPp.298
59
6.6 Economic Interpretation of the Dual Problem
Suppose an entrepreneur wants to purchase all of Dakota’s resources. The entrepreneur must determine the price he or she is willing to pay for a unit of each of Dakota’s resources.
To determine these prices define:y1 = price paid for 1 boards ft of lumber
y2 = price paid for 1 finishing hour
y3 = price paid for 1 carpentry hour
The resource prices y1, y2, and y3 should be determined by solving the Dakota dual.
Example : Dakota dual
p.302
60
In setting resource prices, the prices must be high enough to induce Dakota to sell.
When the primal is a normal max problem, the dual variables are related to the value of resources available to the decision maker. For this reason, dual variables are often referred to as resource shadow prices.
61
6.7 The Dual Theorem and Its Consequences
The Dual Theorem states that the primal and dual have equal optimal objective function values (if the problems have optimal solutions).
Lemma 1 : Weak duality implies that if for any feasible solution to the primal and an feasible solution to the dual, the w-value for the feasible dual solution will be at least as large as the z-value for the feasible primal solution. (p.305)
Any feasible solution to the dual can be used to develop a bound on the optimal value of the primal objective function.
p.304
62
Lemma 2 : Let
be a feasible solution to the primal and
be a feasible solution to the dual. If , then x-bar is optimal for the primal and y-bar is optimal for the dual.
Lemma 3 : If the primal is unbounded, then the dual problem is infeasible.
Lemma 4 : If the dual is unbounded, then the primal is infeasible.
nx
x
x
X2
1
myyyy 21byxc
63
The Dual Theorem*** (p.308) Suppose BV is an optimal basis for the primal.
Then cBVB-1 is an optimal solution to the dual. Also .
原題的解 (x-bar)與對偶題的解 (y-bar)存在對應關係,且二者的最佳值相等。
wz
64
6.8 Shadow Prices
The shadow price of the ith constraint is the amount by which the optimal z-value is improved (increased in a max problem and decreased in a min problem) is we increase bi by 1 (from bi to bi+1).
In short, adding points to the feasible region of a max problem cannot decrease the optimal z-value.
p.313
65
6.9 Duality and Sensitivity Analysis
Assuming that a set of basic variables BV is feasible, then BV is optimal if and only if the associated dual solution (cBVB-1) is dual feasible.
This result can be used for an alternative way of doing the following types of sensitivity analysis(6.3, p.276).Change 1 : Changing the objective function
coefficient of a nonbasic variable.
Change 4 : Changing the column of a nonbasic variable
Change 5 : Adding a new activity.
p.323
66
6.10 Complementary Slackness
Theorem 2 : Let
be a feasible primal solution andbe a feasible dual solution. Then x is primal optimal and y is dual optimal if and only if
siyi = 0 (i=1, 2, …, m)ejyj = 0 (j=1, 2, …, n)
nx
x
x
X2
1
myyyy 21
p.325
67
6.11 The Dual Simplex Method
The dual simplex method ( 對偶單體法 ) maintains a non-negative row 0 (dual feasibility) and eventually obtains a tableau in which each right-hand side is non-negative (primal feasibility).
68
The dual simplex method for a max problemStep 1:Is the right-hand side of each constraint non negative? If not, go to step 2.
Step 2:Choose the most negative basic variable as the variable to leave the basis. The row it is in will be the pivot row. To select the variable that enters the basis, computer the following ratio for each variable xj that has a negative coefficient in the pivot row:
Choose the variable with the smallest ratio as the entering variable. Now use EROs to make the entering variable a basic variable in the pivot row.
Step 3: If there is any constraint in which the right-hand side is negative and each variable has a non-negative coefficient, then the LP has no feasible solution. If no constraint infeasibility is found, return to step 1.
rowpivot in oft Coefficien
0 rowin oft Coefficien
xj
xj
69
Three uses of the dual simplex
1. Finding the new optimal solution after a constraint is added to an LP. (p.330)
2. Finding the new optimal solution after changing a right-hand side of an LP. (p.332)
3. Solving a normal min problem. (p.333)
70
When a constraint is added one of the following
three cases will occur.(p.330)The current optimal solution satisfies the new
constraint.The current optimal solution does not satisfy the
new constraint, but the LP still has a feasible solution.
The additional constraint causes the LP to have no feasible solutions.
Case 1 : x1+x2+x3 ≦ 11 (p.330)
Case 2 : x2 ≧ 1 (p.330, table 33-34)
Case 3 : x1+x2 ≧ 12 (p.331, table 35-38)
71
max z = 60x1 + 30x2 + 20x3
s.t. 8x1+ 6x2 + x3 ≤ 48
4x1+ 2x2 + 1.5x3 ≤ 20
2x1+1.5x2 + 0.5x3 ≤ 8
x1, x2, x3 ≥ 0
BV z x1 X2 x3 s1 s2 s3 RHS
z 1 0 5 0 0 10 10 280
s1 0 0 -2 0 1 2 -8 24
x3 0 0 -2 1 0 2 -4 8
x1 0 1 1.25 0 0 -0.5 1.5 2
A Constraint Is Added to an LPp.331
72
加入限制式 x1+x2+x3 ≤ 11
BV z x1 x2 x3 s1 s2 s3 s4 RHS
z 1 0 5 0 0 10 10 0 280
s1 0 0 -2 0 1 2 -8 0 24
x3 0 0 -2 1 0 2 -4 0 8
x1 0 1 1.25 0 0 -0.5 1.5 0 2
s4 0 1 1 1 0 0 0 1 11
BV z x1 x2 x3 s1 s2 s3 RHS
z 1 0 5 0 0 10 10 280
s1 0 0 -2 0 1 2 -8 24
x3 0 0 -2 1 0 2 -4 8
x1 0 1 1.25 0 0 -0.5 1.5 2
Case 1
x1+x2+x3 ≤ 11 ⇒ x1+x2+x3 +s4= 11
73
BV z x1 x2 x3 s1 s2 s3 s4 RHS
z 1 0 5 0 0 10 10 0 280
s1 0 0 -2 0 1 2 -8 0 24
x3 0 0 -2 1 0 2 -4 0 8
x1 0 1 1.25 0 0 -0.5 1.5 0 2
s4 0 1 1 1 0 0 0 1 11
BV z x1 x2 x3 s1 s2 s3 s4 RHS
z 1 0 5 0 0 10 10 0 280
s1 0 0 -2 0 1 2 -8 0 24
x3 0 0 -2 1 0 2 -4 0 8
x1 0 1 1.25 0 0 -0.5 1.5 0 2
s4 0 0 0.25 1 0 0.5 -1.5 1 9
ERO
The current optimal solution remains optimal after the constraint x1+x2+x3 ≤ 11 is added.
74
x2 ≥ 1 ⇒ -x2 +e4=- 1
TABLE 33
BV z x1 x2 x3 s1 s2 s3 e4 RHS
z 1 0 5 0 0 10 10 0 280
s1 0 0 -2 0 1 2 -8 0 24
x3 0 0 -2 1 0 2 -4 0 8
x1 0 1 1.25 0 0 -0.5 1.5 0 2
e4 0 0 -1 0 0 0 0 1 -1
BV z x1 x2 x3 s1 s2 s3 RHS
z 1 0 5 0 0 10 10 280
s1 0 0 -2 0 1 2 -8 24
x3 0 0 -2 1 0 2 -4 8
x1 0 1 1.25 0 0 -0.5 1.5 2
Case 2
加入限制式 x2 ≥ 1
75
TABLE 33 EV
BV z x1 x2 x3 s1 s2 s3 e4 RHS r
z 1 0 5 0 0 10 10 0 280
s1 0 0 -2 0 1 2 -8 0 24
x3 0 0 -2 1 0 2 -4 0 8
x1 0 1 1.25 0 0 -0.5 1.5 0 2
e4 0 0 -1 0 0 0 0 1 -1 LV
TABLE 34
BV z x1 x2 x3 s1 s2 s3 e4 RHS
z 1 0 0 0 0 10 10 5 275
s1 0 0 0 0 1 2 -8 -2 26
x3 0 0 0 1 0 2 -4 -2 10
x1 0 1 0 0 0 -1/2 3/4 5/4 3/4
x2 0 0 1 0 0 0 0 -1 1
ERO
76
Case 3
加入限制式 x1 +x2 ≥ 12
BV z x1 x2 x3 s1 s2 s3 RHS
z 1 0 5 0 0 10 10 280
s1 0 0 -2 0 1 2 -8 24
x3 0 0 -2 1 0 2 -4 8
x1 0 1 1.25 0 0 -0.5 1.5 2
x1 +x2 ≥ 12 ⇒ -x1 -x2 +e4 = - 12
TABLE 35
BV z x1 x2 x3 s1 s2 s3 e4 RHS
z 1 0 5 0 0 10 10 0 280
s1 0 0 -2 0 1 2 -8 0 24
x3 0 0 -2 1 0 2 -4 0 8
x1 0 1 1.25 0 0 -0.5 1.5 0 2
e4 0 -1 -1 0 0 0 0 1 -12
77
TABLE 36 EV
BV z x1 x2 x3 s1 s2 s3 e4 RHS
z 1 0 5 0 0 10 10 0 280
s1 0 0 -2 0 1 2 -8 0 24
x3 0 0 -2 1 0 2 -4 0 8
x1 0 1 1.25 0 0 -0.5 1.5 0 2
e4 0 0 0.25 0 0 -0.5 1.5 1 -10 LV
TABLE 35 EV
BV z x1 x2 x3 s1 s2 s3 e4 RHS
z 1 0 5 0 0 10 10 0 280
s1 0 0 -2 0 1 2 -8 0 24
x3 0 0 -2 1 0 2 -4 0 8
x1 0 1 1.25 0 0 -0.5 1.5 0 2
e4 0 -1 -1 0 0 0 0 1 -12 LV
78
TABLE 37 EV
BV z x1 x2 x3 s1 s2 s3 e4 RHS
z 1 0 10 0 0 0 40 20 80
s1 0 0 -1 0 1 0 -2 4 -16
x3 0 0 -1 1 0 0 2 4 -32 LV
x1 0 1 1 0 0 0 0 -1 12
s2 0 0 -0.5 0 0 1 -3 -2 20
TABLE 36 EV
BV z x1 x2 x3 s1 s2 s3 e4 RHS
z 1 0 5 0 0 10 10 0 280
s1 0 0 -2 0 1 2 -8 0 24
x3 0 0 -2 1 0 2 -4 0 8
x1 0 1 1.25 0 0 -0.5 1.5 0 2
e4 0 0 0.25 0 0 -0.5 1.5 1 -10 LV
79
TABLE 38
BV z x1 x2 x3 s1 s2 s3 e4 RHS
z 1 0 10 0 0 0 60 60 -240
s1 0 0 0 -1 1 0 -4 0 16
x2 0 0 1 -1 0 0 -2 -4 32
x1 0 1 0 1 0 0 2 3 -20
s2 0 0 0 -0.5 0 1 -4 -4 36
TABLE 37 EV
BV z x1 x2 x3 s1 s2 s3 e4 RHS
z 1 0 10 0 0 0 40 20 80
s1 0 0 -1 0 1 0 -2 4 -16
x3 0 0 -1 1 0 0 2 4 -32 LV
x1 0 1 1 0 0 0 0 -1 12
s2 0 0 -0.5 0 0 1 -3 -2 20
80
If the right-hand side of a constraint is changed and the current basis becomes infeasible, the dual simplex can be used to find the new optimal solution.(p.332)
-Example : finishing hours=30, table 39-40
81
max z = 60x1 + 30x2 + 20x3
s.t. 8x1+ 6x2 + x3 ≤ 48
4x1+ 2x2 + 1.5x3 ≤ 20
2x1+1.5x2 + 0.5x3 ≤ 8
x1, x2, x3 ≥ 0BV z x1 X2 x3 s1 s2 s3 RHS
z 1 0 5 0 0 10 10 280
s1 0 0 -2 0 1 2 -8 24
x3 0 0 -2 1 0 2 -4 8
x1 0 1 1.25 0 0 -0.5 1.5 2
Changing a RHS of an LPp.332
82
1.50.5-0
4-20
821
B ,
20.50
41.50
811
B
8
20
48
b ,
1005.05.12
0105.184
001168
A
60200C , 000203060C
}x,x,s{BV
1
BV
131
b2=20→30TABLE 39
BV z x1 x2 x3 s1 s2 s3 e4 RHS
z 1 0 5 0 0 10 10 0 380
s1 0 0 -2 0 1 2 -8 0 44
x3 0 0 -2 1 0 2 -4 0 28
x1 0 1 1.25 0 0 -0.5 1.5 0 -3
83
TABLE 39 EV
BV z x1 x2 x3 s1 s2 s3 RHS
z 1 0 5 0 0 10 10 380
s1 0 0 -2 0 1 2 -8 44
x3 0 0 -2 1 0 2 -4 28
x1 0 1 1.25 0 0 -0.5 1.5 -3 LV
TABLE 40
BV z x1 x2 x3 s1 s2 s3 RHS
z 1 20 30 0 0 0 40 320
s1 0 4 3 0 1 0 -2 32
x3 0 4 3 1 0 0 2 16
s2 0 -2 -2.5 0 0 1 -3 6
84
Solving a Normal Min Problem
Min z=x1+2x2
s.t. x1 -2x2 + x3 ≥ 4
2x1 + x2 - x3 ≥ 6
x1 , x2, x3 ≥ 0
p.333
Let z’=-z, z’= -x1 - 2x2
z’ + x1 + 2x2 = 0
x1 -2x2 + x3 - e1 = 4
2x1 + x2 - x3 - e2 = 6
85
1.RHS ( 負值 ) 最小離開 , e2 leaving2.ratio 最小進入 , x1entering
Solving a Normal Min Problem
Table 42
BV z x1 x2 x3 e1 e2 RHS
z 1 1 2 0 0 0 0e1 0 -1 2 -1 1 0 -4e2 0 -2 -1 1 0 1 -6
ratio |1/(-2) | |1/(-1) | min
Table 41
z’ + x1 + 2x2 = 0-x1+2x2 - x3 + e1 = -4-2x1 - x2 + x3 + e2 = -6
p.334
86
1.RHS ( 負值 ) 最小離開 , e1 leaving2.ratio 最小進入 , x3 entering
Table 43
BV z x1 x2 x3 e1 e2 RHS
z 1 0 3/2 1/2 0 1/2 -3e1 0 0 5/2 -3/2 1 -1/2 -1x1 0 1 1/2 -1/2 0 -1/2 3
ratio min31
2/32/1
12/1
2/1
Table 44
BV z x1 x2 x3 e1 e2 RHS
z 1 0 7/3 0 1/3 1/3 -10/3x3 0 0 -5/3 1 -2/3 1/3 2/3x1 0 1 -1/3 0 -1/3 - 1/3 10/3
ratio min
z’ = -10/3, z = 10/3, x1 = 10/3, x3 = 2/3, x2 = 0
87
z + 2x1 + x3 = 0
- x1 - x2 + x3 + e1 = ‑5
- x1 + 2x2 - 4x3 + e2 = -8
Exercise : p.335 #1
Use the dual simplex method to solve the following LP:
Max z=-2x1-x3
s.t. x1 + x2 - x3 ≥ 5
x1 - 2x2 + 4x3 ≥ 8
x1 , x2, x3 ≥ 0
z + 2x1 + x3 = 0
x1 +x2 - x3 - e1 = 5
x1 - 2x2 + 4x3 - e2 = 8
⇒
88
z + 2x1 + x3 = 0
- x1 - x2 + x3 + e1 = ‑5
- x1 + 2x2 - 4x3 + e2 = -8
1.RHS ( 負值 ) 最小離開 , e2 leaving2.ratio 最小進入 , x3entering
Exercise : p.335 #1
BV z x1 x2 x3 e1 e2 RHS
z 1 2 0 1 0 0 0e1 0 -1 -1 1 1 0 -5e2 0 -1 2 -4 0 1 -8
ratio |2/(-1) | |1/(-4) | min
89
BV z x1 x2 x3 e1 e2 RHS
z 1 2 0 1 0 0 0e1 0 -1 -1 1 1 0 -5e2 0 -1 2 -4 0 1 -8
ratio |2/(-1) | |1/(-4) | min
BV z x1 x2 x3 e1 e2 RHS
z 1 7/4 1/2 0 0 1/4 -2e1 0 -5/4 -1/2 0 1 1/4 -7x3 0 1/4 -1/2 1 0 -1/4 2
ratio min5
7
4/5
4/7
1
2/1
2/1
1.RHS ( 負值 ) 最小離開 , e1 leaving2.ratio 最小進入 , x2 entering
90
BV z x1 x2 x3 e1 e2 RHS
z 1 1/2 0 0 1 1/2 -9x2 0 5/2 1 0 -2 -1/2 14x3 0 3/2 0 1 -1 -1/2 9
z = ‑9, x2 = 14, x3 = 9
91
主要單體法與對偶單體法知差異(Max problem)
差異項目 主要單體法 對偶單體法
1 0 列 不受正負限制 * 均為非負值
2 RHS 均為非負值 不受正負限制 *
3 判斷最佳解 0 列均為非負值 RHS 均為非負值
4 選擇進入變數 最負 0 列 最負 RHS
5 RatioMin{RHS/ 正係數 }
Min{|0 列係數 / 負係數 |}
* 最佳解除外
92
對偶問題
Max. Z=x1 - 2x2 + 3x3
s.t. 2x1 + x2 + 4x3 - x4 ≦ - 4
-x1 + 2x2 - x3 + 4x4 ≧ 5
x1 - 3x2 + 2x3 + x4 = 6
x1≧0, x2≧0, x3 urs, x4≦0
--- y1
--- y2
--- y3
Min. w= -4y1 +5y2 + 6y3
s.t. 2y1 - y2 + y3 ≦ 1
y1 + 2y2 - 3y3 ≧ -2
4y1 - y2 + 2y3 = 3
-y1 + 4y2 + y3 ≦ 0
y1≧0, y2 ≦ 0, y3 urs
93
求線性規劃之對偶問題
0x,x
3x3x2
5x2x
3xxs.t.
x4x3Zmin
21
21
21
21
21
94
0s,u,u,x,x
3sx3x2
5ux2x
3uxxs.t.
x4x3ZZmax
32121
321
221
121
21
0s,u,u,x,x
3sx3x2
5ux2x
3uxxs.t.
0x4x3Zmax
32121
321
221
121
21
95
故 x1=1,x2=2,u1=0,u2=0,s3=7 Z 有最大值 11 ,即 Z 有最小值 11
96
利用對偶單體法求解下 LP 問題
0x,x,x
5x3x2x
5xxx
3xx3x2s.t.
x3x2xZmax
321
321
321
321
321
97
0x,x,x
5x3x2x
5xxx
5xxx
3xx3x2s.t.
x3x2xZmax
321
321
321
321
321
321
0u,u,s,s,x,x,x
5ux3x2x
5uxxx
5sxxx
3sxx3x2s.t.
0x3x2xZmax
4321321
4321
3321
2321
1321
321
98
Z x1 x2 x3 s1 s2 u3 u4 RHS
Z 1 1 2 3 0 0 0 0 0
s1 0 2 3 1 1 0 0 0 3
s2 0 1 1 1 0 1 0 0 5
u3 0 1 1 1 0 0 1 0 5
u4 0 1 2 3 0 0 0 1 5
Z 1 0 3 2 0 0 1 0 5
s1 0 0 1 1 1 0 2 0 7
s2 0 0 0 0 0 1 1 0 0
x1 0 1 1 1 0 0 1 0 5
u4 0 0 3 4 0 0 1 1 0
Z 1 0 1 0 2 0 5 0 19
x3 0 0 1 1 1 0 2 0 7
s2 0 0 0 0 0 1 1 0 0
x1 0 1 2 0 1 0 1 0 2
u4 0 0 7 0 4 0 7 1 28
Z 1 0 0 0 18
7 0 6
1
7 23
x3 0 0 0 1 3
7 0 1
1
7 3
s2 0 0 0 0 0 1 1 0 0
x1 0 1 0 0 1
7 0 1
2
7 6
x2 0 0 1 0 4
7 0 1
1
7 4
故 x1 = 6, x2 = 4, x3 = 3,
s1 = s2 = u3 = u4 =0 時,
Z 有最大值 23