Upload
marilyn-wells
View
328
Download
0
Embed Size (px)
Citation preview
1
4.7 Alternate Optimal Solutions
If an LP has more than one optimal solution, it has multiple optimal solutions ( 多重最佳解 ) or alternative optimal solutions(擇一最佳解 ).
If there is no NBV with a zero coefficient in row 0 of the optimal tableau, the LP has a unique optimal solution.
Even if there is a NBV with a zero coefficient in row 0 of the optimal tableau, it is possible that the LP may not have alternative optimal solutions.
p.152
2
Example:
Dakota Furniture Company (p.140)
max z = 60x1 + 35x2 + 20x3
s.t. 8x1+ 6x2 + x3 ≤ 48 (lumber constraint)
4x1+ 2x2 + 1.5x3 ≤ 20 (finishing constraint)
2x1+1.5x2 + 0.5x3 ≤ 8 (carpentry constraint)
x2 ≤ 5 (table demand constraint)
x1, x2, x3 ≥ 0
p.152
3
Table 13
BV z x1 x2 x3 s1 s2 s3 s4 RHS Ratio
z 1 -60 -35 -20 0 0 0 0 0
s1 0 8 6 1 1 0 0 0 48
s2 0 4 2 1.5 0 1 0 0 20
s3 0 2 1.5 0.5 0 0 1 0 8
s4 0 0 1 0 0 0 0 1 5
max z = 60x1 + 35x2 + 20x3
s.t. 8x1+ 6x2 + x3 ≤ 48
4x1+ 2x2 + 1.5x3 ≤ 20
2x1+1.5x2 + 0.5x3 ≤ 8
x2 ≤ 5
x1, x2, x3 ≥ 0
z - 60x1 - 35x2 - 20x3 = 0
8x1+ 6x2 + x3 + s1 = 48
4x1+ 2x2 + 1.5x3 + s2 = 20
2x1+1.5x2 + 0.5x3 + s3 = 8
x2 + s4 = 5
x1, x2, x3 , s1, s2, s3, s4 ≥ 0
4
Table 13
BV z x1 x2 x3 s1 s2 s3 s4 RHS Ratio
z 1 -60 -35 -20 0 0 0 0 0
s1 0 8 6 1 1 0 0 0 48 6
s2 0 4 2 1.5 0 1 0 0 20 5
s3 0 2 1.5 0.5 0 0 1 0 8 4 LV
s4 0 0 1 0 0 0 0 1 5 -
EV
Table 14
BV z x1 x2 x3 s1 s2 s3 s4 RHS Ratio
z 1 0 10 -5 0 0 30 0 240
s1 0 0 0 -1 1 0 -4 0 16 -
s2 0 0 -1 0.5 0 1 -2 0 4 8 LV
x1 0 1 0.75 0.25 0 0 0.5 0 4 16
s4 0 0 1 0 0 0 0 1 5 -
EV
5
Table 15
BV z x1 x2 x3 s1 s2 s3 s4 RHS BV
z 1 0 0 0 0 10 10 0 280 z=280
s1 0 0 -2 0 1 2 -8 0 24 s1=24
x3 0 0 -2 1 0 2 -4 0 8 x3=8
x1 0 1 1.25 0 0 -0.5 1.5 0 2 x1=2
s4 0 0 1 0 0 0 0 1 5 s4=5
Table 16
BV z x1 x2 x3 s1 s2 s3 s4 RHS BV
z 1 0 0 0 0 10 10 0 280 z=280
s1 0 1.6 0 0 1 1.2 -5.6 0 27.2 s1=27.2
x3 0 1.6 0 1 0 1.2 -1.6 0 11.2 x3=11.2
x2 0 0.8 1 0 0 -0.4 1.2 0 1.6 x2=1.6
s4 0 -0.8 0 0 0 0.4 -1.2 1 3.4 s4=3.4
6
Any point on the line segment joining two optimal extreme points will also be optimal.
1 c 0for
3.2c11.2
1.6c1.6
2c
11.2
1.6
0
c)(1
8
0
2
c
x
x
x
11.2
1.6
0
x
x
x
point2 extreme Optimal
8
0
2
x
x
x
point1 extreme Optimal
3
2
1
3
2
1
3
2
1
7
Exercise : p.154 #1~#41. Show that if a toy soldier sold for $28, then the Giapetto
problem would have alternative optimal solutions.2. Show that the following LP has alternative optimal solutions; find
three of them.max z = -3x1 + 6x2
s.t. 5x1 + 7x2 ≤ 35 -x1 + 2x2 ≤ 2 x1, x2 ≥ 0
3. Find alternative optimal solutions to the following LP : max z = x1 + x2
s.t. x1 + x2 + x3 ≤ 1 x1 +2x3 ≤ 1 x1, x2, x3 ≥ 0
4. Find all optimal solutions to the following LP :max z = 3x1 + 3x2
s.t. x1 + x2 ≤ 1 x1, x2 ≥ 0
8
4.8 Unbounded LPs
For some LPs, there exist points in the feasible region for which z assumes arbitrarily large (in max problems) or arbitrarily small (in min problems) values. The LP is unbounded solution(無限解 ).
An unbounded LP occurs in a max problem if there is a NBV with a negative coefficient in row 0 and there is no constraint that limits how large we can make this NBV.
Specifically, an unbounded LP for a max problem occurs when a variable with a negative coefficient in row 0 has a non positive coefficient in each constraint.
p.154
9
Example 3. Breadco Bakeries x1=number of loaves of French bread baked
x2=number of loaves of sourdough bread baked x3=number of yeast packets purchased x4=number of ounces of flour purchased
Objective function : Revenue = 36x1+30x2, Costs = 3x3 + 4x4
z = Revenue – Costs = 36x1 + 30x2 - 3x3 - 4x4
Constraints : x1 +x2 ≤ 5 + x3 x1 +x2 - x3 ≤ 5
6x1 + 5x2 ≤ 10 + x4 6x1 + 5x2 - x4 ≤ 10
Max z = 36x1 + 30x2 - 3x3 - 4x4
s.t. x1 + x2 - x3 ≤ 5
6x1 + 5x2 - x4 ≤ 10
x1, x2 , x3 , x4 ≥0
p.154
10
max z = 36x1 + 30x2 – 3x3 – 4x4
s.t. x1 + x2 – x3 ≤ 5
6x1 + 5x2 –x4 ≤ 10
x1, x2, x3, x4 ≥ 0
max z = 36x1 + 30x2 – 3x3 – 4x4
s.t. x1 + x2 – x3 + s1 =5
6x1 + 5x2 –x4 + s2 =10
x1, x2, x3, x4 , s1, s2 ≥ 0
Table 19
BV z x1 x2 x3 x4 s1 s2 RHS BV Ratio
z 1 -36 -30 3 4 0 0 0 z=0s1 0 1 1 -1 0 1 0 5 s1=5 5
s2 0 6 5 0 -1 0 1 10 s2=10 5/3
11
Table 20
BV z x1 x2 x3 x4 s1 s2 RHS Ratio
z 1 0 0 3 -2 0 6 60
s1 0 0 1/6 -1 1/6 1 -1/6 10/3 20 LV
x1 0 1 5/6 0 -1/6 0 1/6 5/3 -
EV
Table 19
BV z x1 x2 x3 x4 s1 s2 RHS Ratio
z 1 -36 -30 3 4 0 0 0
s1 0 1 1 -1 0 1 0 5 5
s2 0 6 5 0 -1 0 1 10 10/6 LV
EV
Table 21
BV z x1 x2 x3 x4 s1 s2 RHS Ratio
z 1 0 2 -9 0 12 4 100
x4 0 0 1 -6 1 6 -1 20 -
x1 0 1 1 -3 0 1 0 5 -
12
Exercise : p.158 #1~#5
1. Show that the following LP is unbounded : max z = 2x2
s.t. x1 - x2 ≤ 4
-x1 + x2 ≤ 1
x1,x2 ≥ 0
Find a point in the feasible region with z ≥ 10,000.
2. State a rule that can be used to determine if a min problem has an unbounded optimal solution (that is, z can be made arbitrarily small). Use the rule to show that max z = -2x1 - 3x2
s.t. x1 - x2 ≤ 1
x1 - 2x2 ≤ 2
x1,x2 ≥ 0
is an unbounded LP.
13
3. Suppose that in solving an LP, we obtain the tableau in Table 22. Although x1 can enter the basis, this LP is unbounded. Why?
4. Show that the following LP is unboundedmax z = x1 + 2x2
s.t. -x1 + x2 ≤ 2
-2x1 + x2 ≤ 1
x1,x2 ≥ 0
5. Show that the following LP is unboundedmax z = -x1 - 3x2
s.t. x1 - 2x2 ≤ 4
-x1 + x2 ≤ 3
x1,x2 ≥ 0
z x1 x2 x3 x4 RHS
1 -3 -2 0 0 0
0 1 -1 1 0 3
0 2 0 0 1 4
14
4.11 Degeneracy and Convergence of the Simplex Algorithm
Theoretically, the simplex algorithm can fail to find an optimal solution to an LP.
The following are facts: If (value of entering variable in new bfs) > 0,
then (z-value for new bfs) > (z-value for current bfs) If (value of entering variable in new bfs) = 0,
then (z-value for new bfs) = (z-value for current bfs)
p.168
15
Assume that in each of the LP’s bfs all BV are
positive. An LP is a nondegenerate (非退化 ) LP. An LP is degenerate(退化 ) if it has at least one bfs
where a BV is equal 0. Any bfs that has at least one BV equal to zero is a
degenerate bfs(退化基本可行解 ). When the same bfs is encountered twice it is called
cycling(循環 ). If cycling occurs, then we will loop, or cycle,
forever among a set of basic feasible solutions and never get to an optimal solution.
p.169
16
Example : Degenerate LP
max z = 5x1 + 2x2
s.t. x1 + x2 ≤ 6
x1 – x2 ≤ 0
x1, x2 ≥ 0
max z = 5x1 + 2x2
s.t. x1 + x2 + s1 = 6
x1 – x2 + s2 = 0
x1, x2 , s1, s2 ≥ 0
Table 29
BV z x1 x2 s1 s2 RHS
z 1 -5 -2 0 0 0
s1 0 1 1 1 0 6
s2 0 1 -1 0 1 0
p.169
17
Table 29
BV z x1 x2 s1 s2 RHS Ratio
z 1 -5 -2 0 0 0
s1 0 1 1 1 0 6 6
s2 0 1 -1 0 1 0 0 LV
EVTable 30
BV z x1 x2 s1 s2 RHS Ratio
z 1 0 -7 0 5 0
s1 0 0 2 1 -1 6 6/2 LV
x1 0 1 -1 0 1 0 -
EVTable 31
BV z x1 x2 s1 s2 RHS Ratio
z 1 0 0 3.5 1.5 21
x2 0 0 1 0.5 -0.5 3
x1 0 1 0 0.5 0.5 3
18
Fig. 12 (p.171)
There are 3 sets of BVs that correspond to 1 extreme pt.
Table 32
BV BFS Extreme point
x1 , x2 x1 = 3, x2 = 3, s1 = s2 = 0 D
x1 , s1 x1 = 0, s1 = 6, x2 = s2 = 0 C
x1 , s2 x1 = 6, s2 =-6, x2 = s1 = 0 Infeasible
x2 , s1 x2 = 0, s1 = 6, x1 = s2 = 0 C
x2 , s2 x2 = 6, s2 = 6, x1 = s1 = 0 B
s1 , s2 s1 = 6, s2 = 0, x1 = x2 = 0 C
19
If an LP has many degenerate BFS (or many BV equal zero), then the simplex algorithm is often inefficient.
Some degenerate LPs have a special structure that enables us to solve them by methods other than the simplex. (chapter 7)
20
Exercise : Degenerate LP
max z = 7x1 + 8x2
s.t. x1 + 2x2 ≤ 10
3x1 + 2 x2 ≤ 18
x2 ≤ 5
x1, x2 ≥ 0
max z = 7x1 + 8x2
s.t. x1 + 2x2 + s1 = 10
3x1 + 2x2 + s2 = 18
2x2 + s3 = 5
x1, x2 , s1, s2 ,s3≥ 0
BV z x1 x2 s1 s2 s3 RHS Ratio
z 1 -7 -8 0 0 0 0
s1 0 1 2 1 0 0 10 5
s2 0 3 2 0 1 0 18 9
s3 0 0 1 0 0 1 5 5
21
BV z x1 x2 s1 s2 s3 RHS Ratio
z 1 -7 0 0 0 8 40
s1 0 1 0 1 0 -2 0 0
s2 0 3 0 0 1 -2 8 8/3
x2 0 0 1 0 0 1 5 -
BV z x1 x2 s1 s2 s3 RHS Ratio
z 1 -7 -8 0 0 0 0
s1 0 1 2 1 0 0 10 5
s2 0 3 2 0 1 0 18 9
s3 0 0 1 0 0 1 5 5
BV z x1 x2 s1 s2 s3 RHS Ratio
z 1 0 0 7 0 -6 40
x1 0 1 0 1 0 -2 0 -
s2 0 0 0 -3 1 4 8 2
x2 0 0 1 0 0 1 5 5
22
BV z x1 x2 s1 s2 s3 RHS Ratio
z 1 0 0 7 0 -6 40
x1 0 1 0 1 0 -2 0 -
s2 0 0 0 -3 1 4 8 2
x2 0 0 1 0 0 1 5 5
BV z x1 x2 s1 s2 s3 RHS Ratio
z 1 0 0 5/2 3/2 0 52
x1 0 1 0 -1/2 1/2 0 4
s3 0 0 0 -3/4 1/4 1 8
x2 0 0 1 3/4 -1/4 0 3
23
Exercise : p.170 #1~#2
1. Even if an LP’s initial tableau is nondegenerate, later tableaus may exhibit degeneracy. Degenerate tableaus often occur in the tableau following a tie in the ration test. To illustrate this, solve the following LP: max z = 5x1 + 3x2
s.t. 4x1 + 2x2≤ 12
4x1 + x2≤ 10
x1 + x2≤ 4
x1, x2 ≥ 0
Also graph the feasible region and show which extreme points correspond to more than one set of basic variables.
2. Find the optimal solution to the following LP:max z = –x1 – x2
s.t. x1 + x2 ≤ 1
–x1 + x2 ≤ 0
x1, x2 ≥ 0
24
Summery (1)
1.進入變數平手指 2 個 NBV 具有相同且最負的 z列係數。任意選一個為進入變數( 無有效方法 ) 。
2.離開變數平手 ---退化解有 2 個以上相同之最小比率。未被選擇離開之 BV,其值為 0 ,該 BV 即degenerate BV ,含 degenerate BV 之 bfs 即是degenerate bfs。
理論上,退化 bfs 易產生 cycle,使得 z值不變,即 bfs1bfs2bfs3 bfs1而無法求得最佳解。 (有書專門討論此類問題 )
25
3.無離開變數 ---無窮解 進入變數之欄無正值,使得無離開變數。 實務上,遇到此情況,代表該 LP 之模式有誤。
( 若 z代表利潤,則 z不可能∞ )4.最佳單形表含 z 列係數為 0 之 NBV ---多重最佳解 有任何 NBV 之 z列係數為 0 若讓為 0 之 NBV 為進入變數,則下一個 z值不
會改變,但 BFS 將由不同之 BV 組成。亦即不同之解,卻有相同之目標函數值。
26
LP的各種變形與解法
Standard Form
0x
bAX .t.s
CXZ Max
i
Min: Method 1 (Z=-Z) or Method 2
變形 2
Unrestricted-in-sign (urs) variable:Let xi=xi’-xi” xi’, xi” ≥ 0
變形 1
變形 3
AX ≥ B(1)Big –M Method(2)Two Phase Method
27
Artificial Variables (人工變數 )
為使 simplex method 得以繼續沿用,以人工變數對「≥」之「 = 」之限制式進行轉換。
處裡人工變數之方法有二: Big M method (大M法 ) Two-phase Simplex method (雙階法 )
目的在盡量使人工變數為 0, 使得到之人工問題最佳解即為原問題之最佳解。
28
4.12 The Big M Method( 大 M 法 )
The simplex method requires a starting bfs. Previous problems have found starting bfs by
using the slack variables as BV. If an LP have ≥ or = constraints, however,
a starting bfs may not be readily apparent. In such a case, the Big M method may be used to
solve the problem.
p.172
29
Description of the Big M Method1.Modify the constraints so that the rhs of each
constraint is nonnegative. Identify each constraint that is now an = or ≥ constraint.
2.Convert each inequality constraint to standard form (add a slack variable for ≤ constraints, add an excess variable for ≥ constraints).
3.For each ≥ or = constraint, add artificial variables. Add sign restriction ai ≥ 0.
4.Let M denote a very large positive number. Add (for each artificial variable) Mai to min problem objective functions or -Mai to max problem objective functions
5.Since each artificial variable will be in the starting basis, all artificial variables must be eliminated from row 0 before beginning the simplex. Remembering M represents a very large number, solve the transformed problem by the simplex.
30
Example 4: Bevco
Bevco manufactures an orange-flavored soft drink called Oranj by combining orange soda and orange juice. Each orange soda contains 0.5 oz of sugar and 1 mg of vitamin C.
Each ounce of orange juice contains 0.25 oz of sugar and 3 mg of vitamin C.
It costs Bevco 2¢ to produce an ounce of orange soda and 3¢ to produce an ounce of orange juice.
Bevco’s marketing department has decided that each 10-oz bottle of Oranj must contain at least 30 mg of vitamin C and at most 4 oz of sugar.
Use LP to determine how Bevco can meet the marketing department’s requirements at min cost.
p.172
31
Example 4: Solution
x1 = number of ounces of orange soda in a bottle of Oranj
x2 = number of ounces of orange juice in a bottle of Oranj
The LP is:min z = 2x1 + 3x2
s.t. 0.5x1 + 0.25x2 ≤ 4 (sugar constraint)
x1 + 3x2 ≥ 20 (Vitamin C constraint)
x1 + x2 = 10 (10 oz in 1 bottle of Oranj)
x1, x2 ≥ 0
Step 1
32
The LP in standard form has z and s1 which could be used for BVs but row 2 would violate sign restrictions and row 3 no readily apparent BV.
In order to use the simplex method, a bfs is needed. Artificial variables ( 人工變數 ) are created.
Row 0: z - 2x1 - 3x2 = 0
Row 1: 0.5x1 + 0.25x2 + s1 = 4
Row 2: x1 + 3x2 - e2 = 20
Row 3: x1 + x2 = 10
Step 2
33
In the optimal solution, all artificial variables must be set equal to zero. For a min LP, a term Mai is added to the objective
function for each artificial variable ai.
For a max LP, the term –Mai is added to the objective function for each ai.
M represents some very large number.
Row 0: z - 2x1 - 3x2 = 0
Row 1: 0.5x1 + 0.25x2 + s1 = 4
Row 2: x1 + 3x2 - e2 + a2 = 20
Row 3: x1 + x2 + a3 = 10
Step 3
34
The modified Bevco LP in standard form then becomes:
Modifying the objective function this way makes it extremely costly for an artificial variable to be positive. The optimal solution should force a2 = a3 =0.
Row 0: z - 2x1 - 3x2 -Ma2 - Ma3 = 0
Row 1: 0.5x1 + 0.25x2 + s1 = 4
Row 2: x1 + 3x2 - e2 + a2 = 20
Row 3: x1 + x2 + a3 = 10
Step 4
35
Because a2 and a3 are in starting BFS, they must be eliminated from row 0.
Replace row0 by row0 +M(row2)+M(row3)
Row 0: z - 2x1 - 3x2 -Ma2 - Ma3 = 0
Row 1: 0.5x1 + 0.25x2 + s1 = 4
Row 2: x1 + 3x2 - e2 + a2 = 20
Row 3: x1 + x2 + a3 = 10
Row 0’: z + (2M - 2)x1 + (4M - 3)x2 - Me2 = 30M
Step 5
36
Table 33
BV z x1 x2 s1 e2 a2 a3 RHS Ratio
z 1 2M-2 4M-3 0 -M 0 0 30M
s1 0 1/2 1/4 1 0 0 0 4 16
a2 0 1 3 0 -1 1 0 20 20/3 LV
a3 0 1 1 0 0 0 1 10 10
EVTable 34
BV z x1 x2 s1 e2 a2 a3 RHS Ratio
z 1 0 0 0
s1 0 5/12
0 1 1/12 -1/12 07/3 28/5
x2 0 1/3 1 0 -1/3 1/3 0 20/3 20
a3 0 2/3 0 0 1/3 -1/3 1 10/3 5 LV
EV
332 M
33M
3
M43 31060 M
37
Table 35
BV z x1 x2 s1 e2 a2 a3 RHS Ratio
z 1 0 0 0 -1/2 25
s1 0 0 0 1 -1/8 1/8 -5/8 1/4
x2 0 0 1 0 -1/2 1/2 -1/2 5
x1 0 1 0 0 1/2 -1/2 3/2 5
221 M
223 M
The optimal solution for Bevco is z=25, x1 = x2 = 5, s1 = 1/4, e2 = 0.
This means that Bevco can hold the cost of producing a 10-oz. bottle of Oranj to $.25 by mixing 5 oz of orange soda and 5 oz of orange juice.
38
Example 4’:
min z = 2x1 + 3x2
s.t. 0.5x1 + 0.25x2 ≤ 4 (sugar constraint)
x1 + 3x2 ≥ 36 (Vitamin C constraint)
x1 + x2 = 10 (10 oz in 1 bottle of Oranj)
x1, x2 ≥ 0
Row 0: z - 2x1 - 3x2 -Ma2 - Ma3 = 0
Row 1: 0.5x1 + 0.25x2 + s1 = 4
Row 2: x1 + 3x2 - e2 + a2 = 36
Row 3: x1 + x2 + a3 = 10
Row 0’: z + (2M - 2)x1 + (4M - 3)x2 - Me2 = 46M
p.177
39
Table 36
BV z x1 x2 s1 e2 a2 a3 RHS Ratio
z 1 2M-2 4M-3 0 -M 0 0 46M
s1 0 1/2 1/4 1 0 0 0 4 16
a2 0 1 3 0 -1 1 0 36 12
a3 0 1 1 0 0 0 1 10 10 LV
EV
Table 37
BV z x1 x2 s1 e2 a2 a3 RHS
z 1 1-2M 0 0 -M 0 3-4M 30+6M
s1 0 1/4 0 1 0 0 -1/4 3/2
a2 0 -2 0 0 -1 1 -3 6
x2 0 1 1 0 0 -0 1 10
40
If all artificial variables equal zero in the optimal
solution, the solution is optimal. (exercise 4) If any artificial variables are positive in the optimal
solution, the solution is infeasible. Then the original LP has no feasible solution.
(exercise 5)
由於M為一相當大的值,對電腦而言,易產生數值上的問題 ( 極大數與極小數相加,後果? ) ,因此商業軟體少用此法,而多使用 Two-Phase method.
41
Exercise : p.178 #1~#6
1. min z = 4x1 + 4x2 + x3
s.t. x1 + x2 + x3 ≤ 2
2x1 + x2 ≤ 3
2x1 + x2 + 3x3 ≥ 3
x1 , x2 , x3 ≥ 0
min z = 4x1 + 4x2 + x3 + Ma3
s.t. x1 + x2 + x3 + s1 = 2
2x1 + x2 + s2 = 3
2x1 + x2 + 3x3 ‑ e3 + a3 = 3
x1, x2, x3, s1, s2, e3, a3≥ 0
42
Eliminating the BV a3 from z ‑ 4x1 ‑ 4x2 ‑ x3 ‑ Ma3 = 0
z + (2M ‑ 4)x1 + (M ‑ 4)x2 + (3M ‑ 1)x3 ‑ Me3 = 3M.
z x1 x2 x3 s1 s2 e3 a3 rhs
1 2M‑4 M‑4 3M‑ 1 0 0 ‑M 0 3M
0 1 1 1 1 0 0 0 20 2 1 0 0 1 0 0 30 2 1 3 0 0 -1 1 3
min z = 4x1 + 4x2 + x3 + Ma3
s.t. x1 + x2 + x3 + s1 = 2
2x1 + x2 + s2 = 3
2x1 + x2 + 3x3 ‑ e3 + a3 = 3 ×(-M)
x1 , x2 , x3 , s1, s2, e3, a3 ≥ 0
43
z x1 x2 x3 s1 s2 e3 a3 rhs r
1 2M‑4 M‑4 3M‑ 1 0 0 ‑M 0 3M
0 1 1 1 1 0 0 0 2 20 2 1 0 0 1 0 0 3 none
0 2 1 3 0 0 -1 1 3 1
z x1 x2 x3 s1 s2 e3 a3 rhs
1 -10/3 -11/3 0 0 0 ‑1/3 1/3-M 10 1/3 2/3 0 1 0 1/3 ‑1/3 10 2 1 0 0 1 0 0 30 2/3 1/3 1 0 0 -1/3 1/3 1
The optimal solution is z = 1, s1 = 1, s2 = 3, x3 = 1, x2 = x1 = e3 = 0.
44
2. min z = 2x1 + 3x2
s.t. 2x1 + x2 ≥ 4 x1 – x2 ≥ -1 x1,x2 ≥ 0
3. max z = 3x1 + x2
s.t. x1 + x2 ≥ 3 2x1 + x2 ≤ 4 x1 + x2 = 3 x1,x2 ≥ 0
4. min z = 3x1
s.t. 2x1 + x2 ≥ 6 3x1 + 2x2 = 4 x1,x2 ≥ 0
5. min z = x1 + x2
s.t. 2x1 + x2 + x3 = 4 x1 + x2 + 2x3 = 2 x1,x2,x3 ≥ 0
6. min z = x1 + x2
s.t. x1 + x2 = 2 2x1 + 2x2 = 4 x1,x2 ≥ 0
45
4.13 Two-Phase Simplex Method
Phase I 之目標函數僅考慮人工變數。 (p.178)無論 Min or Max 問題,最好之 z值為 0 ,故不可能為無窮解
讓所有原始變數為 0 即為一可行解,故不可能為無可行解所以必有最佳解。
當得到最佳解時,若所有人工變數均為 0 ,則至 phase II ;若有任何人工變數不為 0 ,則原問題無可行解。
Phase II 中:刪除全部人工變數,若人工變數仍為 BV ,則保留。以 phase I 之最佳解做為 phase II 之起始 bfs ,並回復原問題之目標函數係數
p.178
46
Phase I LP
In this method, artificial variables are added to the same constraints, then a bfs to the original LP is found by solving Phase I LP.
The objective function is to minimize the sum of all artificial variables.
At completion, reintroduce the original LP’s objective function and determine the optimal solution to the original LP.
47
Phase II LP
Because each ai ≥ 0, solving the Phase I LP will result in one of the following three cases:
Case 1.The optimal value of w’ is greater than zero.The original LP has no feasible solution.
Case 2.The optimal value of w’ is equal to zero, and no AVs are in the optimal Phase I basis.
Drop all columns in the optimal Phase I tableau that correspond to the artificial variables.
Now combine the original objective function with the constraints from the optimal Phase I tableau.
Case 3. The optimal value of w’ is equal to zero and at least one AV is in the optimal Phase I basis.
48
Example 5 : case 2
min z = 2x1 + 3x2
s.t. 0.5x1 + 0.25x2 ≤ 4 x1 + 3x2 ≥ 20 x1 + x2 = 10 x1, x2 > 0
min w’ = a2 + a3 (w’ - a2- a3=0) ---- (1)
s.t. 0.5x1 + 0.25x2 + s1 = 4
x1 + 3x2 – e2 + a2 = 20 ---- (2)
x1 + x2 + a3 = 10 ---- (3)
x1, x2, s1, e2, a2, a3 > 0
(1) + (2) + (3) min w’ + 2x1 + 4x2 - e2 = 30
p.179
49
Table 38
BV w’ x1 x2 s1 e2 a2 a3 RHS Ratio
w’ 1 2 4 0 -1 0 0 30
s1 0 1/2 1/4 1 0 0 0 4 16
a2 0 1 3 0 -1 1 0 20 20/3 LV
a3 0 1 1 0 0 0 1 10 10
EV
Table 39
BV w’ x1 x2 s1 e2 a2 a3 RHS Ratio
w’ 1 2/3 0 0 1/3 -4/3 0 3/10
s1 0 5/12
0 1 1/12 - /12 07/3 28/5
x2 0 1/3 1 0 -1/3 1/3 0 20/3 20
a3 0 2/3 0 0 1/3 -1/3 1 10/3 5 LV
EV
50
Table 40
BV w’ x1 x2 s1 e2 a2 a3 RHS
w’ 1 0 0 0 0 -1 -1 0
s1 0 0 0 1 -1/8 1/8 -5/8 1/4
x2 0 0 1 0 -1/2 1/2 -1/2 5
x1 0 1 0 0 1/2 -1/2 3/2 5
Drop all AVs.
The optimal solution is z=25, x1=5, x2=5, s1=1/4, e2=0
51
Example 6 : case 1
min z = 2x1 + 3x2
s.t. 0.5x1 + 0.25x2 ≤ 4 x1 + 3x2 ≥ 36 x1 + x2 = 10 x1, x2 > 0
min w’ = a2 + a3 (w’ - a2- a3=0) ---- (1)
s.t. 0.5x1 + 0.25x2 + s1 = 4
x1 + 3x2 – e2 + a2 = 36 ---- (2)
x1 + x2 + a3 = 10 ---- (3)
x1, x2, s1, e2, a2, a3 > 0(1) + (2) + (3) min w’ + 2x1 + 4x2 - e2 = 46
p.181
52
Table 41
BV w’ x1 x2 s1 e2 a2 a3 RHS Ratio
w’ 1 2 4 0 -1 0 0 46
s1 0 1/2 1/4 1 0 0 0 4 16
a2 0 1 3 0 -1 1 0 36 12
a3 0 1 1 0 0 0 1 10 10 LV
EVTable 42
BV w’ x1 x2 s1 e2 a2 a3 RHS Ratio
w’ 1 -2 0 0 -1 0 -4 6
s1 0 1/4 0 1 0 0 -1/4 3/2
a2 0 -2 0 0 -1 1 -3 6
x2 0 1 1 0 0 -0 1 10
w’ =6 > 0, so the original LP has no feasible solution.
53
Example 7 : case 3
max z = 40x1 + 10x2 + 7x5 + 14x6
s.t. x1 - x2 +2x5 = 0 -2x1 + x2 - 2x5 = 0
x1 + x3 + x5 - x6 = 3 2x2 + x3 + x4 + 2x5 + x6 = 4
x1, x2, x3, x4, x5, x6 > 0
(1) + (2) + (3) + (4) min w’ +x3 + x5 - x6 = 3
min w’-a1-a2-a3 = 0 ----(1)s.t. x1 - x2 + 2x5 + a1 = 0 ----(2) -2x1 + x2 - 2x5 + a2 = 0 ----(3)
x1 + x3 + x5 - x6 + a3 = 3 ----(4) 2x2 + x3 + x4 + 2x5 + x6 = 4
x1, x2, x3, x4, x5, x6, a1, a2, a3 > 0
p.183
54
Table 43
BV w’ x1 x2 x3 x4 x5 x6 a1 a2 a3 RHS R
w’ 1 0 0 1 0 1 -1 0 0 0 3
a1 0 1 -1 0 0 2 0 1 0 0 0
a2 0 -2 1 0 0 -2 0 0 1 0 0
a3 0 1 0 1 0 1 -1 0 0 1 3 3 LV
x4 0 0 2 1 1 2 1 0 0 0 4 4
EVTable 44
BV w’ x1 x2 x3 x4 x5 x6 a1 a2 a3 RHS R
w’ 1 -1 0 0 0 0 0 0 0 -1 0
a1 0 1 -1 0 0 2 0 1 0 0 0
a2 0 -2 1 0 0 -2 0 0 1 0 0
x3 0 1 0 1 0 1 -1 0 0 1 3
x4 0 -1 2 0 1 1 2 0 0 -1 1
55
Table 44
BV w’ x1 x2 x3 x4 x5 x6 a1 a2 a3 RHS Ratio
w’ 1 -1 0 0 0 0 0 0 0 -1 0
a1 0 1 -1 0 0 2 0 1 0 0 0
a2 0 -2 1 0 0 -2 0 0 1 0 0
x3 0 1 0 1 0 1 -1 0 0 1 3
x4 0 -1 2 0 1 1 2 0 0 -1 1
Table 44’ ---- drop x1 and a3
BV w’ x1 x2 x3 x4 x5 x6 a1 a2 a3 RHS Ratio
w’ 1 0 0 0 0 0 0 0 0
a1 0 -1 0 0 2 0 1 0 0
a2 0 1 0 0 -2 0 0 1 0
x3 0 0 1 0 1 -1 0 0 3
x4 0 2 0 1 1 2 0 0 1
56
Table 45
BV z x2 x3 x4 x5 x6 a1 a2 RHS Ratio
z 1 -10 0 0 -7 -14 0 0 0
a1 0 -1 0 0 2 0 1 0 0
a2 0 1 0 0 -2 0 0 1 0
x3 0 0 1 0 1 -1 0 0 3
x4 0 2 0 1 1 2 0 0 1
Table 44’
BV w’ x2 x3 x4 x5 x6 a1 a2 RHS
w’ 1 0 0 0 0 0 0 0 0
a1 0 -1 0 0 2 0 1 0 0
a2 0 1 0 0 -2 0 0 1 0
x3 0 0 1 0 1 -1 0 0 3
x4 0 2 0 1 1 2 0 0 1
57
Table 45
BV z x2 x3 x4 x5 x6 a1 a2 RHS Ratio
z 1 -10 0 0 -7 -14 0 0 0
a1 0 -1 0 0 2 0 1 0 0
a2 0 1 0 0 -2 0 0 1 0
x3 0 0 1 0 1 -1 0 0 3
x4 0 2 0 1 1 2 0 0 1 1/2 LV
EVTable 46
BV z x2 x3 x4 x5 x6 a1 a2 RHS Ratio
z 1 4 0 7 0 0 0 0 7
a1 0 0 0 0 2 0 1 0 0
a2 0 1 0 0 0 0 0 1 0
x3 0 1 1 1/2 3/2 0 0 0 7/2
x6 0 0 0 1/2 1/2 1 0 0 1/2
The optimal solution is z=7, x3 =7/2, x6 =1/2, x2 = x4 = x5 =0
58
Exercise : p.184 #1~#2
1. Use the two-phase simplex method to solve the Section 4.12 problems.
2. 2. Explain why the Phase I LP will usually have alternative optimal solutions.
59
4.14 Unrestricted-in-Sign Variables
An LP with an unrestricted-in-sign (urs) variable can be transformed to non-negative.For each urs variable, define two new variables x’
i and xn
i.
Then substitute x’i - xn
i for xi in each constraint and in the objective function. Also add the sign restrictions.
The effect of this substitution is to express xi as the difference of the two nonnegative variables x’
i and xni.
No basic feasible solution can have both x’i ≥ 0
and xni ≥ 0.
p.184
60
For any basic feasible solution, each URS variable
xi must fall into one of the following three cases.
1. x’i > 0 and xn
i = 0
2. x’i = 0 and xn
i > 0
3. x’i = xn
i = 0
61
Example 8 : Using urs vars
x1 = number of loaves of bread baked x2 = number of ounces by which flour supply
is increased by
Let x2 = x’2 – x”2
Max z = 30x1 - 4 x’2 – 4x”2
s.t. 5x1 ≤ 30 + x’2 – x”2 (Flour constraint) x1 ≤ 5 (Yeast constraint)
x1 ≥ 0 , x’2 , x”2 ≥ 0
Max z = 30x1 - 4x2
s.t. 5x1 ≤ 30 + x2 (Flour constraint) x1 ≤ 5 (Yeast constraint)
x1 ≥ 0 , x2 urs
p.185
62
Table 47
BV z x1 x ’2 x”2 s1 s2 RHS Ratio
z 1 -30 4 -4 0 0 0
s1 0 5 -1 1 1 0 30 6
s2 0 1 0 0 0 1 5 5 LV
EV
Max z = 30x1 - 4 x’2 + 4x”2
s.t. 5x1 –x’2 + x”2 + s1 = 30 x1 + s1 = 5
x1 ≥ 0 , x’2 , x”2 ≥ 0 ,s1, s2 ≥ 0
Table 48
BV z x1 x ’2 x”2 s1 s2 RHS Ratio
z 1 0 4 -4 0 30 150
s1 0 0 -1 1 1 -5 5 5 LV
x1 0 1 0 0 0 1 5 none
EV
63
Table 49
BV z x1 x ’2 x”2 s1 s2 RHS Ratio
z 1 0 0 0 4 10 170
x”2 0 0 -1 1 1 -5 5
x1 0 1 0 0 0 0 5
The optimal solution is z= 170, x1= 5, x”2= 5, x2’= 0, s1= s2= 0.
x2= x’- x”2 = -5
Because x2 = -5, the baker should sell 5 oz of flour.
64
其它形式
x’ = x – 3
x’ = x – 2
x ≧ 3
2 ≦ x ≦ 5
x’ ≧0
x’, x” ≧0
x” = 5 – x
x’ = 6 – xx ≦ 6 x’ ≧0