Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 4.7 Alternate Optimal Solutions If an LP has more than one optimal solution, it has multiple optimal solutions ( 多重最佳解 ) or alternative optimal solutions(

Similar presentations


Presentation on theme: "1 4.7 Alternate Optimal Solutions If an LP has more than one optimal solution, it has multiple optimal solutions ( 多重最佳解 ) or alternative optimal solutions("— Presentation transcript:

1 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 2 Example : Dakota Furniture Company (p.140) max z = 60x 1 + 35x 2 + 20x 3 s.t. 8x 1 + 6x 2 + x 3 ≤ 48 (lumber constraint) 4x 1 + 2x 2 + 1.5x 3 ≤ 20 (finishing constraint) 2x 1 +1.5x 2 + 0.5x 3 ≤ 8 (carpentry constraint) x 2 ≤ 5 (table demand constraint) x 1, x 2, x 3 ≥ 0 p.152

3 3 Table 13 BVzx1x1 x2x2 x3x3 s1s1 s2s2 s3s3 s4s4 RHSRatio z1 -60-35-2000000 s1s1 0861100048 s2s2 0421.5010020 s3s3 021.50.500108 s4s4 001000015 max z = 60x 1 + 35x 2 + 20x 3 s.t. 8x 1 + 6x 2 + x 3 ≤ 48 4x 1 + 2x 2 + 1.5x 3 ≤ 20 2x 1 +1.5x 2 + 0.5x 3 ≤ 8 x 2 ≤ 5 x 1, x 2, x 3 ≥ 0 z - 60x 1 - 35x 2 - 20x 3 = 0 8x 1 + 6x 2 + x 3 + s 1 = 48 4x 1 + 2x 2 + 1.5x 3 + s 2 = 20 2x 1 +1.5x 2 + 0.5x 3 + s 3 = 8 x 2 + s 4 = 5 x 1, x 2, x 3, s 1, s 2, s 3, s 4 ≥ 0

4 4 Table 13 BVzx1x1 x2x2 x3x3 s1s1 s2s2 s3s3 s4s4 RHSRatio Z1 -60-35-2000000 s1s1 08611000488 s2s2 0421.50100205 s3s3 021.50.5001084 LV s4s4 001000015 EV Table 14 BVzx1x1 x2x2 x3x3 s1s1 s2s2 s3s3 s4s4 RHSRatio Z1 010-500300240 s1s1 00010-4016 None s2s2 000.501-2048 LV x1x1 010.750.25000.50416 s4s4 001000015 None EV

5 5 Table 15 BVzx1x1 x2x2 x3x3 s1s1 s2s2 s3s3 s4s4 RHSBV Z 1000010 0280z=280 s1s1 00-2012-8024 s 1 =24 x3x3 00-2102-408 x 3 =8 x1x1 011.2500-0.51.502 x 1 =2 s4s4 001000015 s 4 =5 Table 16 BVzx1x1 x2x2 x3x3 s1s1 s2s2 s3s3 s4s4 RHSBV Z 1000010 0280z=280 s1s1 01.60011.2-5.6027.2s 1 =27.2 x3x3 01.60101.2-1.6011.2x 3 =11.2 x2x2 00.8100-0.41.201.6x 1 =1.6 s4s4 0-0.80000.4-1.213.4 s 4 =3.4

6 6 Any point on the line segment joining two optimal extreme points will also be optimal.

7 7 Exercise, p.154, 5 min Exercise 1 Exercise 2 Exercise 3 Exercise 4 Exercise 5

8 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 9 Example 3. Breadco Bakeries x 1 =number of loaves of French bread baked x 2 =number of loaves of sourdough bread baked x 3 =number of yeast packets purchased x 4 =number of ounces of flour purchased Objective function : Revenue = 36x 1 +30x 2, Costs = 3x 3 + 4x 4 z = Revenue – Costs = 36x 1 + 30x 2 - 3x 3 - 4x 4 Constraints : x 1 +x 2 ≤ 5 + x 3 x 1 +x 2 - x 3 ≤ 5 6x 1 + 5x 2 ≤ 10 + x 4 6x 1 + 5x 2 - x 4 ≤ 10 Max z = 36x 1 + 30x 2 - 3x 3 - 4x 4 s.t. x 1 + x 2 - x 3 ≤ 5 6x 1 + 5x 2 - x 4 ≤ 10 x 1, x 2, x 3, x 4 ≥0 p.154

10 10 max z = 36x 1 + 30x 2 – 3x 3 – 4x 4 s.t. x 1 + x 2 – x 3 ≤ 5 6x 1 + 5x 2 –x 4 ≤ 10 x 1, x 2, x 3, x 4 ≥ 0 max z = 36x 1 + 30x 2 – 3x 3 – 4x 4 s.t. x 1 + x 2 – x 3 + s 1 =5 6x 1 + 5x 2 –x 4 + s 2 =10 x 1, x 2, x 3, x 4, s 1, s 2 ≥ 0 Table 19 BVzx1x1 x2x2 x3x3 x4x4 s1s1 s2s2 RHSBVRatio z1 -36-3034000z=0 s1s1 0110105 s 1 =55 s2s2 06500110 s 2 =105/3

11 11 Table 20 BVzx1x1 x2x2 x3x3 x4x4 s1s1 s2s2 RHSRatio Z 1003-20660 s1s1 001/61/61-1/610/320LV x1x1 015/60-1/601/65/3 none EV Table 19 BVzx1x1 x2x2 x3x3 x4x4 s1s1 s2s2 RHSRatio Z1 -36-3034000 s1s1 01101055 s2s2 0650 011010/6LV EV Table 21 BVzx1x1 x2x2 x3x3 x4x4 s1s1 s2s2 RHSRatio Z 102-90124100 x4x4 001-61620 none x1x1 011-30105 none

12 12 Exercise, p.158, 5 min Exercise 1 Exercise 2 Exercise 3 Exercise 4 Exercise 5 Exercise 6

13 13 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

14 14 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

15 15 Example : Degenerate LP max z = 5x 1 + 2x 2 s.t. x 1 + x 2 ≤ 6 x 1 – x 2 ≤ 0 x 1, x 2 ≥ 0 max z = 5x 1 + 2x 2 s.t. x 1 + x 2 + s 1 = 6 x 1 – x 2 + s 2 = 0 x 1, x 2, s 1, s 2 ≥ 0 Table 29 BVzx1x1 x2x2 s1s1 s2s2 RHS Z1 -5-2000 s1s1 011106 s2s2 01010 p.169

16 16 Table 29 BVzx1x1 x2x2 s1s1 s2s2 RHSRatio z1 -5-2000 s1s1 0111066 s2s2 010100 LV EV Table 30 BVzx1x1 x2x2 s1s1 s2s2 RHSRatio z 10-7050 s1s1 002166/2 LV x1x1 01010 None EV Table 31 BVzx1x1 x2x2 s1s1 s2s2 RHSRatio z 1003.51.521 x2x2 0010.5-0.53 x1x1 0100.5 3

17 17 Figure 12 (p.171) There are 3 sets of BVs that correspond to 1 extrem point. Table 32 BVBFSExtreme point x 1, x 2 x 1 = 3, x 2 = 3, s 1 = s 2 = 0D x1, s1x1, s1 x 1 = 0, s 1 = 6, x 2 = s 2 = 0C x 1, s 2 x 1 = 6, s 2 =-6, x 2 = s 1 = 0Infeasible x 2, s 1 x 2 = 0, s 1 = 6, x 1 = s 2 = 0C x 2, s 2 x 2 = 6, s 2 = 6, x 1 = s 1 = 0B s 1, s 2 s 1 = 6, s 2 = 0, x 1 = x 2 = 0C

18 18 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)

19 19 Exercise : Degenerate LP max z = 7x 1 + 8x 2 s.t. x 1 + 2x 2 ≤ 10 3x 1 + 2 x 2 ≤ 18 x 2 ≤ 5 x 1, x 2 ≥ 0 max z = 7x 1 + 8x 2 s.t. x 1 + 2x 2 + s 1 = 10 3x 1 + 2x 2 + s 2 = 18 2x 2 + s 3 = 5 x 1, x 2, s 1, s 2 ≥ 0 BVzx1x1 x2x2 s1s1 s2s2 s3s3 RHSRatio z 1-7-80000 s1s1 012100105 s2s2 032010189 s3s3 00100155

20 20 BVzx1x1 x2x2 s1s1 s2s2 s3s3 RHSRatio z 1-7000840 s1s1 01010-200 s2s2 03001 88/3 x2x2 0010015 - BVzx1x1 x2x2 s1s1 s2s2 s3s3 RHSRatio z 1-7-80000 s1s1 012100105 s2s2 032010189 s3s3 00100155 BVzx1x1 x2x2 s1s1 s2s2 s3s3 RHSRatio z 10070-640 x1x1 01010-200 s2s2 000-31482 x2x2 00100155

21 21 BVzx1x1 x2x2 s1s1 s2s2 s3s3 RHSRatio z1 0070-640 x1x1 01010-20 - s2s2 000-3148 2 x2x2 0010015 5 BVzx1x1 x2x2 s1s1 s2s2 s3s3 RHSRatio z1 005/23/2052 x1x1 010-1/21/204 s3s3 000-3/41/418 x2x2 0013/4-1/403

22 22 Exercise, p.170, 5 min Exercise 1 Exercise 2

23 23 Summery (1) 1. 進入變數平手 指 2 個 NBV 具有相同且最負的 z 列係數。 任意選一個為進入變數 ( 無有效方法 ) 。 2. 離開變數平手 --- 退化解 有 2 個以上相同之最小比率。 未被選擇離開之 BV ,其值為 0 ,該 BV 即 degenerate BV ,含 degenerate BV 之 bfs 即是 degenerate bfs 。 理論上,退化 bfs 易產生 cycle ,使得 z 值不變,即 bfs1  bfs2  bfs3  bfs1 而無法求得最佳解。 ( 有書專門討論此類問題 )

24 24 3. 無離開變數 --- 無窮解 進入變數之欄無正值,使得無離開變數。 實務上,遇到此情況,代表該 LP 之模式有誤。 ( 若 z 代表利潤,則 z 不可能 ∞) 4. 最佳單形表含 z 列係數為 0 之 NBV --- 多重最佳解 有任何 NBV 之 z 列係數為 0 若讓為 0 之 NBV 為進入變數,則下一個 z 值不 會改變,但 BFS 將由不同之 BV 組成。 亦即不同之解,卻有相同之目標函數值。

25 25 LP 的各種變形與解法 Standard Form Min:(1)Method 1 (Z=-Z) (2)Method 2 變形 2: “ ≧ ” Unrestricted-in-sign (urs) variable: Let 變形 1: Min 變形 3: “urs” (1)Big-M Method (2)Two-Phase Method

26 26 Artificial Variables ( 人工變數 ) 為使 simplex method 得以繼續沿用,以人工變數 對「 ≥ 」之「 = 」之限制式進行轉換。 處裡人工變數之方法有二: Big M method ( 大 M 法 ) Two-phase Simplex method ( 雙階法 ) 目的在盡量使人工變數為 0, 使得到之人工問題最佳 解即為原問題之最佳解。

27 27 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

28 28 Description of the Big M Method 1.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 a i ≥ 0. 4.Let M denote a very large positive number. Add (for each artificial variable) Ma i to min problem objective functions or -Ma i 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.

29 29 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 20 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

30 30 Example 4: Solution x 1 = number of ounces of orange soda in a bottle of Oranj x 2 = number of ounces of orange juice in a bottle of Oranj The LP is: min z = 2x 1 + 3x 2 s.t.0.5x 1 + 0.25x 2 ≤ 4 (sugar constraint) x 1 + 3x 2 ≥ 20 (Vitamin C constraint) x 1 + x 2 = 10 (10 oz in 1 bottle of Oranj) x 1, x 2 ≥ 0 Step 1

31 31 The LP in standard form has z and s 1 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 - 2x 1 - 3x 2 = 0 Row 1: 0.5x 1 + 0.25x 2 + s 1 = 4 Row 2: x 1 + 3x 2 - e 2 = 20 Row 3: x 1 + x 2 = 10 Step 2

32 32 In the optimal solution, all artificial variables must be set equal to zero. For a min LP, a term Ma i is added to the objective function for each artificial variable a i. For a max LP, the term –Ma i is added to the objective function for each a i. M represents some very large number. Row 0:z - 2x 1 - 3x 2 = 0 Row 1: 0.5x 1 + 0.25x 2 + s 1 = 4 Row 2: x 1 + 3x 2 - e 2 + a 2 = 20 Row 3: x 1 + x 2 + a 3 = 10 Step 3

33 33 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 a 2 = a 3 =0. Row 0:z - 2x 1 - 3x 2 -Ma 2 - Ma 3 = 0 Row 1: 0.5x 1 + 0.25x 2 + s 1 = 4 Row 2: x 1 + 3x 2 - e 2 + a 2 = 20 Row 3: x 1 + x 2 + a 3 = 10 Step 4

34 34 Because a 2 and a 3 are in starting BFS, they must be eliminated from row 0. Replace row0 by row0 +M(row2)+M(row3) Row 0:z - 2x 1 - 3x 2 -Ma 2 - Ma 3 = 0 Row 1: 0.5x 1 + 0.25x 2 + s 1 = 4 Row 2: x 1 + 3x 2 - e 2 + a 2 = 20 Row 3: x 1 + x 2 + a 3 = 10 Row 0 ’ :z + (2M - 2)x 1 + (4M - 3)x 2 - Me 2 = 30M Step 5

35 35 Table 33 BVzx1x1 x2x2 s1s1 e2e2 a2a2 a3a3 RHSRatio Z 12M-24M-30-M00 30M s1s1 01/21/41000 416 a2a2 01301020 20/3LV a3a3 011000110 EV Table 34 BVzx1x1 x2x2 s1s1 e2e2 a2a2 a3a3 RHSRatio Z 1000 s1s1 05/12011/12-1/1207/328/5 x2x2 01/310-1/31/3020/320 a3a3 02/3001/3-1/3110/35LV EV

36 36 Table 35 BVzx1x1 x2x2 s1s1 e2e2 a2a2 a3a3 RHSRatio z1000-1/2 25 s1s1 0001-1/81/8-5/8 1/4 x2x2 0010-1/21/2-1/25 x1x1 01001/2-1/23/25 The optimal solution for Bevco is z=25, x 1 = x 2 = 5, s 1 = 1/4, e 2 = 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.

37 37 Example 4’: min z = 2x 1 + 3x 2 s.t.0.5x 1 + 0.25x 2 ≤ 4(sugar constraint) x 1 + 3x 2 ≥ 36(Vitamin C constraint) x 1 + x 2 = 10(10 oz in 1 bottle of Oranj) x 1, x 2 ≥ 0 Row 0:z - 2x 1 - 3x 2 -Ma 2 - Ma 3 = 0 Row 1: 0.5x 1 + 0.25x 2 + s 1 = 4 Row 2: x 1 + 3x 2 - e 2 + a 2 = 36 Row 3: x 1 + x 2 + a 3 = 10 Row 0 ’ :z + (2M - 2)x 1 + (4M - 3)x 2 - Me 2 = 46M p.177

38 38 Table 36 BVzx1x1 x2x2 s1s1 e2e2 a2a2 a3a3 RHSRatio z 12M-24M-30-M00 46M s1s1 01/21/41000 416 a2a2 01301036 12 a3a3 011000110 LV EV Table 37 BVzx1x1 x2x2 s1s1 e2e2 a2a2 a3a3 RHS z 11-2M00-M03-4M 30+6M s1s1 01/40100-1/43/2 a2a2 0-2001-36 x2x2 01100-0110

39 39 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.

40 40 Exercise : p.178 #1~#6 min z = 4x 1 + 4x 2 + x 3 s.t. x 1 + x 2 + x 3 ≤ 2 2x 1 + x 2 ≤ 3 2x 1 + x 2 + 3x 3 ≥ 3 x 1, x 2, x 3 ≥ 0 min z = 4x 1 + 4x 2 + x 3 + Ma 3 s.t. x 1 + x 2 + x 3 + s 1 = 2 2x 1 + x 2 + s 2 = 3 2x 1 + x 2 + 3x 3 ‑ e 3 + a 3 = 3 x 1, x 2, x 3, s 1, s 2, e 3, a 3 ≥ 0

41 41 Eliminating the BV a 3 from z ‑ 4x 1 ‑ 4x 2 ‑ x 3 ‑ Ma 3 = 0 z + (2M ‑ 4)x 1 + (M ‑ 4)x 2 + (3M ‑ 1)x 3 ‑ Me 3 = 3M. zx1x1 x2x2 x3x3 s1s1 s2s2 e3e3 a3a3 rhs 1 2M‑42M‑4M‑4M‑43M ‑ 1 00 ‑M‑M 03M 011110002 021001003 02130013 min z = 4x 1 + 4x 2 + x 3 + Ma 3 s.t. x 1 + x 2 + x 3 + s 1 = 2 2x 1 + x 2 + s 2 = 3 2x 1 + x 2 + 3x 3 ‑ e 3 + a 3 = 3 ×(-M) x 1, x 2, x 3, s 1, s 2, e 3, a 3 ≥ 0

42 42 zx1x1 x2x2 x3x3 s1s1 s2s2 e3e3 a3a3 rhsr 1 2M‑42M‑4M‑4M‑43M ‑ 1 00 ‑M‑M 03M 0111100022 021001003none 021300131 zx1x1 x2x2 x3x3 s1s1 s2s2 e3e3 a3a3 rhs 1-10/3-11/3000 ‑ 1/3 1/3-M1 01/32/30101/3 ‑ 1/3 1 021001003 02/31/3100-1/31/31 The optimal solution is z = 1, s 1 = 1, s 2 = 3, x 3 = 1, x 2 = x 1 = e 3 = 0.

43 43 Exercise, p.178, 15min Exercise 1 (Z=1, x 1 =0, x 2 =0, x 3 =1) Exercise 2 Exercise 3 (Z=5, x 1 =1, x 2 =2,s 1 =0) Exercise 4 (Infeasible LP) Exercise 5 (Z=2, x 1 =2, x 2 =0, x 3 =0) Exercise 6 (Z=2, x 1 =2, x 2 =0)

44 44 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

45 45 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.

46 46 Phase II LP Because each a i ≥ 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.

47 47 Example 5 : case 2 min z = 2x 1 + 3x 2 s.t.0.5x 1 + 0.25x 2 ≤ 4 x 1 + 3x 2 ≥ 20 x 1 + x 2 = 10 x 1, x 2 > 0 min w’ = a 2 + a 3 ( w’ - a 2 - a 3 =0) ---- (1) s.t.0.5x 1 + 0.25x 2 + s 1 = 4 x 1 + 3x 2 – e 2 + a 2 = 20 ---- (2) x 1 + x 2 + a 3 = 10 ---- (3) x 1, x 2, s 1, e 2, a 2, a 3 > 0 (1) + (2) + (3) min w’ + 2x 1 + 4x 2 - e 2 = 30 p.179

48 48 Table 38 BVw’x1x1 x2x2 s1s1 e2e2 a2a2 a3a3 RHSRatio w’ 124000 30 s1s1 01/21/41000 416 a2a2 01301020 20/3LV a3a3 011000110 EV Table 39 BVw’x1x1 x2x2 s1s1 e2e2 a2a2 a3a3 RHSRatio w’ 12/3001/3-4/30 3/10 s1s1 05/12011/12- /1207/328/5 x2x2 01/310-1/31/3020/320 a3a3 02/3001/3-1/3110/35LV EV

49 49 Table 40 BVw’x1x1 x2x2 s1s1 e2e2 a2a2 a3a3 RHS w’ 10000 0 s1s1 0001-1/81/8-5/8 1/4 x2x2 0010-1/21/2-1/25 x1x1 01001/2-1/23/25 Drop all AVs. Phase II: reintroduce Z, reduce the BV’s of Row 0, The optimal solution is z=25, x 1 =5, x 2 =5, s 1 =1/4, e 2 =0

50 50 Example 6 : case 1 min z = 2x 1 + 3x 2 s.t.0.5x 1 + 0.25x 2 ≤ 4 x 1 + 3x 2 ≥ 36 x 1 + x 2 = 10 x 1, x 2 > 0 min w’ = a 2 + a 3 (w’ - a 2 - a 3 =0) ---- (1) s.t.0.5x 1 + 0.25x 2 + s 1 = 4 x 1 + 3x 2 – e 2 + a 2 = 36 ---- (2) x 1 + x 2 + a 3 = 10 ---- (3) x 1, x 2, s 1, e 2, a 2, a 3 > 0 (1) + (2) + (3) min w’ + 2x 1 + 4x 2 - e 2 = 46 p.181

51 51 Table 41 BVw’x1x1 x2x2 s1s1 e2e2 a2a2 a3a3 RHSRatio w’ 124000 46 s1s1 01/21/41000 416 a2a2 01301036 12 a3a3 011000110 LV EV Table 42 BVw’x1x1 x2x2 s1s1 e2e2 a2a2 a3a3 RHSRatio w’1-2000-4 6 s1s1 01/40100-1/43/2 x2x2 0-2001-36 a3a3 01100-0110 w’ =6 > 0, so the original LP has no feasible solution.

52 52 Example 7 : case 3 max z = 40x 1 + 10x 2 + 7x 5 + 14x 6 s.t.x 1 - x 2 +2x 5 = 0 -2x 1 + x 2 - 2x 5 = 0 x 1 + x 3 + x 5 - x 6 = 3 2x 2 + x 3 + x 4 + 2x 5 + x 6 = 4 x 1, x 2, x 3, x 4, x 5, x 6 > 0 (1) + (2) + (3) + (4) min w’ –x 3 – x 5 + x 6 = 0 min w’-a 1 -a 2 -a 3 = 0 ----(1) s.t. x 1 - x 2 + 2x 5 + a 1 = 0 ----(2) -2x 1 + x 2 - 2x 5 + a 2 = 0 ----(3) x 1 + x 3 + x 5 - x 6 + a 3 = 3 ----(4) 2x 2 + x 3 + x 4 + 2x 5 + x 6 = 4 x 1, x 2, x 3, x 4, x 5, x 6, a 1, a 2, a 3 > 0 p.183

53 53 Table 43 BV w’x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 a1a1 a2a2 a3a3 RHSR w’ 100101000 3 a1a1 01 0020100 0 a2a2 0-2100 00100 a3a3 01010100133LV x4x4 002112100044 EV Table 44 BV w’x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 a1a1 a2a2 a3a3 RHSR w’10000000 0 a1a1 01 00201000 a2a2 0-2100 00100 x3x3 0101010013 x4x4 0 2011200 1

54 54 Table 44 BV w’x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 a1a1 a2a2 a3a3 RHS Ratio w’ 10000000 0 a1a1 01 0020100 0 a2a2 0-2100 00100 x3x3 0101010013 x4x4 0 2011200 1 Table 44’ ---- drop x 1 and a 3 BV w’x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 a1a1 a2a2 a3a3 RHS Ratio w’100000000 a1a1 00020100 a2a2 0100-20010 x3x3 00101003 x4x4 020112001

55 55 Table 45 BV zx2x2 x3x3 x4x4 x5x5 x6x6 a1a1 a2a2 RHS Ratio z 1-1000-7-1400 0 a1a1 0002010 0 a2a2 0100-20010 x3x3 00101003 x4x4 020112001 Table 44’ BV w’x2x2 x3x3 x4x4 x5x5 x6x6 a1a1 a2a2 RHS w’100000000 a1a1 00020100 a2a2 0100-20010 x3x3 00101003 x4x4 020112001

56 56 Table 45 BV zx2x2 x3x3 x4x4 x5x5 x6x6 a1a1 a2a2 RHS Ratio z 1-1000-7-1400 0 a1a1 0002010 0 a2a2 0100-20010 x3x3 00101003 x4x4 0201120011/2LV EV Table 46 BV zx2x2 x3x3 x4x4 x5x5 x6x6 a1a1 a2a2 RHS Ratio z140700007 a1a1 000020100 a2a2 010000010 x3x3 0111/23/20007/2 x6x6 0001/2 100 The optimal solution is z=7, x 3 =7/2, x 6 =1/2, x 2 = x 4 = x 5 =0

57 57 Exercise, p.184(p.178), 15min Exercise 1 Exercise 2 Exercise 3 Exercise 4 Exercise 5 Exercise 6

58 58 LP 的各種變形與解法 Standard Form Min:(1)Method 1 (Z=-Z) (2)Method 2 變形 2: “ ≧ ” Unrestricted-in-sign (urs) variable: Let 變形 1: Min 變形 3: “urs” (1)Big-M Method (2)Two-Phase Method

59 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 x n i. Then substitute x ’ i - x n i for x i in each constraint and in the objective function. Also add the sign restrictions. The effect of this substitution is to express x i as the difference of the two nonnegative variables x ’ i and x n i. No basic feasible solution can have both x ’ i ≥ 0 and x n i ≥ 0. p.184

60 60 For any basic feasible solution, each URS variable x i must fall into one of the following three cases. 1.x ’ i > 0 and x n i = 0 2.x ’ i = 0 and x n i > 0 3.x ’ i = x n i = 0

61 61 Example 8 : Using urs vars x 1 = number of loaves of bread baked x 2 = number of ounces by which flour supply is increased by Let x 2 = x’ 2 – x” 2 Max z = 30x 1 - 4 x ’ 2 – 4x ” 2 s.t.5x 1 ≤ 30 + x ’ 2 – x ” 2 (Flour constraint) x 1 ≤ 5 (Yeast constraint) x 1 ≥ 0, x ’ 2, x ” 2 ≥ 0 Max z = 30x 1 - 4x 2 s.t.5x 1 ≤ 30 + x 2 (Flour constraint) x 1 ≤ 5 (Yeast constraint) x 1 ≥ 0, x 2 urs p.185

62 62 Table 47 BVzx1x1 x ’ 2 x” 2 s1s1 s2s2 RHSRatio z 1 - 30 4-400 0 s1s1 05110 306 s2s2 0100015 5LV EV Max z = 30x 1 - 4 x’ 2 – 4x” 2 s.t.5x 1 –x’ 2 + x” 2 + s 1 = 30 x 1 + s 1 = 5 x 1 ≥ 0, x’ 2, x” 2 ≥ 0,s 1, s 2 ≥ 0 Table 48 BVzx1x1 x ’ 2 x” 2 s1s1 s2s2 RHSRatio z104-4030150 s1s1 0011-555LV x1x1 0100015none EV

63 63 Table 49 BVzx1x1 x ’ 2 x” 2 s1s1 s2s2 RHSRatio z1000410 170 x” 2 0011-5 5 x1x1 0100005 The optimal solution is z= 170, x 1 = 5, x” 2 = 5, x 2 ’= 0, s 1 = s 2 = 0. x 2 = x’- x” 2 = -5 Because x 2 = -5, the baker should sell 5 oz of flour.

64 64 Exercise : p.189 #4 Note that in any BFS, z’and z” cannot both be positive. If 2x 1 -3x 2 >0,then z”=0 and the objective function will equal z=z’+z”=z’=2x 1 -3x 2 =|2x 1 -3x 2 |. If 2x 1 -3x 2 <0,z’=0 and z”=|2x 1 -3x 2 | so the objective function will equal z=z’+z”=z”=|2x 1 -3x 2 |. max z = |2x 1 -3x 2 | s.t. 4x 1 +x 2 ≤ 4 2x 1 –x 2 ≤ 0.5 x 1, x 2 ≥ 0 max z = z’ + z'' s.t. 4x 1 +x 2 ≤ 4 2x 1 -x 2 ≤ 0.5 2x 1 -3x 2 = z’–z” x 1, x 2, z’, z” ≥ 0 

65 65 其它形式 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

66 66 Using the simplex algorithm to solve different type of problems

67 67 (1) Max. z = c 1 x 1 + c 2 x 2 +···+ c n x n s.t. a 11 x 1 + a 12 x 2 +···+ a 1n x n ≤ b 1 a 21 x 1 + a 22 x 2 +···+ a 2n x n ≤ b 2 : a m1 x 1 + a m2 x 2 +···+ a mn x n ≤ b m x i ≥ 0 (i=1,2, ···,n) Max. z = c 1 x 1 + c 2 x 2 +···+ c n x n s.t. a 11 x 1 + a 12 x 2 +···+ a 1n x n + s 1 = b 1 a 21 x 1 + a 22 x 2 +···+ a 2n x n + s 2 = b 2 : a m1 x 1 + a m2 x 2 +···+ a mn x n + s n = b m x i, s i ≥ 0 (i=1,2, ···,n)

68 68 (2) Min. z = c 1 x 1 + c 2 x 2 +···+ c n x n s.t. a 11 x 1 + a 12 x 2 +···+ a 1n x n ≤ b 1 a 21 x 1 + a 22 x 2 +···+ a 2n x n ≤ b 2 : a m1 x 1 + a m2 x 2 +···+ a mn x n ≤ b m x i ≥ 0 (i=1,2, ···,n) Max. -z = c 1 x 1 + c 2 x 2 +···+ c n x n s.t. a 11 x 1 + a 12 x 2 +···+ a 1n x n ≤ b 1 a 21 x 1 + a 22 x 2 +···+ a 2n x n ≤ b 2 : a m1 x 1 + a m2 x 2 +···+ a mn x n ≤ b m x i a i ≥ 0 (i=1,2, ···,n)

69 69 (3) Max. z = c 1 x 1 + c 2 x 2 +···+ c n x n s.t. a 11 x 1 + a 12 x 2 +···+ a 1n x n ≤ b 1 a 21 x 1 + a 22 x 2 +···+ a 2n x n ≤ b 2 : a j1 x 1 + a j2 x 2 +···+ a jn x n ≥ b j : a k1 x 1 + a k2 x 2 +···+ a kn x n = b k : a m1 x 1 + a m2 x 2 +···+ a mn x n ≤ b m x i ≥ 0 (i =1, 2, ···, n), 1 ≤ j, k ≤ m Max. z = c 1 x 1 + c 2 x 2 +···+ c n x n s.t. a 11 x 1 + a 12 x 2 +···+ a 1n x n + s 1 = b 1 a 21 x 1 + a 22 x 2 +···+ a 2n x n + s 2 = b 2 : a j1 x 1 + a j2 x 2 +···+ a jn x n - e j + a j = b j : a k1 x 1 + a k2 x 2 +···+ a kn x n + a k = b k : a m1 x 1 + a m2 x 2 +···+ a mn x n + s m = b m x i, s i, a i ≥ 0 (i= 1, 2, ···, n), 1 ≤ j, k ≤ m

70 70 (4) Max. z = c 1 x 1 + c 2 x 2 +···+ c n x n s.t. a 11 x 1 + a 12 x 2 +···+ a 1n x n ≤ b 1 a 21 x 1 + a 22 x 2 +···+ a 2n x n ≤ b 2 : a m1 x 1 + a m2 x 2 +···+ a mn x n ≤ b m x i ≥ 0, x j urs (0 ≤ i, j ≤ n, i ≠ j) Max. z = c 1 x 1 + c 2 x 2 +···+ c j (x’ j - x” j )+···+ c n x n s.t. a 11 x 1 + a 12 x 2 +···+ c j (x’ j - x” j )+···+ a 1n x n ≤ b 1 a 21 x 1 + a 22 x 2 +···+ c j (x’ j - x” j )+···+ a 2n x n ≤ b 2 : a m1 x 1 + a m2 x 2 +···+c j (x’ j - x” j )+···+ a mn x n ≤ b m x i ≥ 0, x’ j,x” j ≥ 0 (0 ≤ i, j ≤ n, i ≠ j) x j = x’ j - x” j


Download ppt "1 4.7 Alternate Optimal Solutions If an LP has more than one optimal solution, it has multiple optimal solutions ( 多重最佳解 ) or alternative optimal solutions("

Similar presentations


Ads by Google