Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dr. Grace F. Wang, Spring 2009 1 As shown in Ch2, the graphical solution procedure can be only used to solve linear programming problems involving two.

Similar presentations


Presentation on theme: "Dr. Grace F. Wang, Spring 2009 1 As shown in Ch2, the graphical solution procedure can be only used to solve linear programming problems involving two."— Presentation transcript:

1 Dr. Grace F. Wang, Spring 2009 1 As shown in Ch2, the graphical solution procedure can be only used to solve linear programming problems involving two decision variables. However, most linear programming problems are too large to be solved graphically, and an algebraic solution procedure must be employed. The most widely used algebraic procedure for solving linear programming problems is called the simplex method. 線性規劃之簡捷法 The Simplex Method of Linear Programming:

2 Dr. Grace F. Wang, Spring 2009 2 The simplex method is an iterative procedure ( 重複步驟 ) for moving from one basic feasible solution(extreme point) to another until the optimal solution is reached. Let’s use the example of the High Tech Industries ( 海德公司 ) on p.225 或英文第9版之中譯本 ( 以下簡稱中譯本 ) p.186 to illustrate the simplex method as follows:

3 Dr. Grace F. Wang, Spring 2009 3 § § 5.1 - 5.5 (pp.225-241) 1. Formulate the LP model for the High Tech problem in general form: X 1 = number of units of the Deskpro X 2 = number of units of the Portable Max 50X 1 + 40X 2 s.t. 3X 1 + 5X 2 150 Assembly time X 2 20 Portable display 8X 1 + 5X 2 300 Warehouse capacity X 1, X 2 0

4 Dr. Grace F. Wang, Spring 2009 4 Reserve for figure 5.1

5 Dr. Grace F. Wang, Spring 2009 5 2.Rewrite the LP model in the standard form: Max 50X 1 + 40X 2 + 0S 1 + 0S 2 + 0S 3 s.t. 3X 1 + 5X 2 + 1S 1 + 0S 2 + 0S 3 = 150 0X 1 + 1X 2 + 0S 1 + 1S 2 + 0S 3 = 20 8X 1 + 5X 2 + 0S 1 + 0S 2 + 1S 3 = 300 X 1, X 2, S 1, S 2, S 3 0 Return to slide 9 註:在此 model 中,每條限制式皆含有 basic variable ,意指該變數在本列之係數為 +1 , 而在其他列皆為 0 。

6 Dr. Grace F. Wang, Spring 2009 6 3.Set up the tableau form( 表格式 ): When a LP problem has a Max Objective Function with only = 0, its standard form and tableau form are the same; otherwise, they are not the same and the tableau form is developed in section 5.6 on p.242( 原文第十版 ). The purpose of tableau form is to provide an initial basic feasible solution as a starting point for the simplex method.

7 Dr. Grace F. Wang, Spring 2009 7 假設 1 個線性規劃問題含 n 個變數及 m 個方程式 ( 限制式 ) , 當 n > m 時,無法解, ( 必須 n ≤ m) , ∴先令多餘的變數為零。 若令 X 2 =0 and S 1 =0 ,則可得一個 basic solution as shown on pp.226-227: X 1 = 50 S 2 = 20 S 3 = - 100 However, this is not a basic feasible solution because S 3 is negative. In a LP model, all variables must be non- negative ( ≥ 0).

8 Dr. Grace F. Wang, Spring 2009 8 For this example, the tableau form is the same as standard form, which consists of 5 variables and 3 linear equations, where n>m. We can find an initial basic feasible solution by setting the decision variables=0 and solve for the slack variables as follows: Let X 1 = 0 X 2 = 0 (n – m = 5 – 3 = 2) nonbasic variables (m = 3) basic variables We obtain This is a basic feasible solution but not an optimal solution since the O.F. value = 50(0) + 40(0) = 0. S 1 = 150 S 2 = 20 S 3 = 300

9 Dr. Grace F. Wang, Spring 2009 9

10 10 4.Setting up the initial simplex tableau ( 起始的簡捷表 ) : C j = O.F. Coefficient for variable j b i = RHS value for constraint i a ij = Coefficient associated with variable j in constraint i Basis C B Z j C j - Z j C row A matrix b column Go to slide 4 variable

11 Dr. Grace F. Wang, Spring 2009 11 The set of current basic variables. CBCB ZjZj C j - Z j Basis Where The corresponding O.F. coefficient for each variable in the basis. The decrease in the value of the O.F. that will result if one unit of the variable in jth column is brought into the basis. The net change in the value of the O.F. that will result if one unit of the variable in jth column is brought into the basis. It’s called “The net evaluation row ”( 淨評估列 ).

12 Dr. Grace F. Wang, Spring 2009 12 Unit columns or Unit vectors ( 單位向量 ) X1X1 X2X2 S1S1 S 2 S3S3 BasisCBCB 5040000bibi S 1 0 35100150 S 2 00101020 S 3 085001300 ZjZj 000000 C j - Z j 5040000 (O.F. Value)

13 Dr. Grace F. Wang, Spring 2009 13

14 Dr. Grace F. Wang, Spring 2009 14 To identify the pivot column, pivot row, and thus the pivot element, we apply the following criteria : (p.234) (1) Criterion for entering a new variable into the basis: - Examine the net-evaluation row, choose the variable that will cause the largest (C j – Z j ) value( 最大淨評估值 ). - In the case of a tie, choose the variable corresponding to the leftmost of the columns. (2) Criterion for removing a variable from the current basis (Minimum Ratio Test -- 最小比率檢定 ): - Compute the b i /a ij ratio for each a ij > 0. Then, choose the variable to remove that corresponds to the minimum ratio. - In the case of a tie, choose the variable corresponding to the uppermost of the rows. 5. Improve the solution:

15 Dr. Grace F. Wang, Spring 2009 15 X 1 X 2 S 1 S 2 S 3 bibi Basis C B 50 40 0 0 0 b i a ij S 1 0 3 5 1 0 0 150 150/3=50 S 2 0 0 1 0 1 0 20 --- S 3 0 8 5 0 0 1 300 300/8=37.50 ZjZj 0 0 0 0 0 0 C j - Z j 50 40 0 0 0 Min ratio pivot column( 樞紐行 ) pivot row ( 樞紐列 ) Max net evaluation Pivot element( 樞紐項 )

16 Dr. Grace F. Wang, Spring 2009 16 Our goal is to convert the pivot column in the A matrix into a unit column by using “Elementary Row Operations”( 基本的列運算法 ) --p.235 6. Compute the next simplex tableau: Old Value New Value 3 0 0 0 8 1 Pivot Column a 11 a 21 a 31 (1) 樞紐列 (Pivot row) 之計算: New pivot row = old pivot row / pivot element (2) 非樞紐列之計算 ( 若此列與 樞紐行 相交的值不等於零 ): New row = old row – 此列與樞紐行相交的值 × (New pivot row) Unit vector

17 Dr. Grace F. Wang, Spring 2009 17 (1) 樞紐列 (Pivot row) 之計算: New pivot row = old pivot row / pivot element old pivot row : 8 5 0 0 1 300 new pivot row : 1 5/8 0 0 1/8 300/8=75/2 (2) 非樞紐列之計算 ( 若此列與樞紐行相交的值不等於零 ): New row = old row – 此列與樞紐行相交的值 × (New pivot row) old 1 st row : 3 5 1 0 0 150 new 1 st row : 0 25/8 1 0 -3/8 75/2 * * 150 – 3 (75/2)=75/2

18 Dr. Grace F. Wang, Spring 2009 18 Through all of computations as shown on p.236, we obtain the second simplex tableau below: (a better solution) Became a unit column Q:What is our goal toward this pivot column?

19 Dr. Grace F. Wang, Spring 2009 19 Since X 2 has the highest positive value in the (C j - Z j ) row, we repeat the procedure as taken in steps 5 ~ 6 to obtain the third simplex tableau as follows: 7. Continue to find a better solution:  Q : Can we improve the solution even more now?

20 Dr. Grace F. Wang, Spring 2009 20 Since there is no any positive value in the net- evaluation row now,this is the final tableau, which contains the optimal solution as follows: X 1 = 30 X 2 = 12 O.F. value = 1980 S 1 = 0 S 2 = 8 S 3 = 0 How do you interpret this solution?  See Figure 5.3 for the computer output, a summary of the simplex method is provided on p.241( 原文第 十版 )

21 Dr. Grace F. Wang, Spring 2009 21 The Computer Solution for The Hightech Industries Problem

22 Dr. Grace F. Wang, Spring 2009 22 Tableau Form: The General Case 一般情況下之表格式 ( pp.242-248) ≥ ( 1 ) A LP model with “ ≥ ” constraints ( 2 ) A LP model with “ = ” constraints ( 3 ) A LP model with negative RHS values What if one or more constraint(s) of a LP model is(are) not “≤” or RHS(s) is(are) negative ? For example: § 5.6

23 Dr. Grace F. Wang, Spring 2009 23 ( 1 ) A LP model with “ ” constraints Max 50X 1 + 40X 2 s.t. 3X 1 + 5X 2 150 1X 2 20 8X 1 + 5X 2 300 X1, X2 0 1X 1 + 1X 2 25 General Form Since Suppose that the management of High Tech Industries wanted to ensure that the total production for both models would be at least 25 units. Thus, the new model will be as follows:

24 Dr. Grace F. Wang, Spring 2009 24 Max 50X 1 + 40X 2 + 0S 1 + 0S 2 + 0S 3 + 0S 4 s.t. 3X 1 + 5X 2 + 1S 1 = 150 1X 2 + 1S 2 = 20 8X 1 + 5X 2 + 1S 3 = 300 1X 1 + 1X 2 - 1S 4 = 25 Standard Form X 1, X 2, S 1, S 2, S 3, S 4 0

25 Dr. Grace F. Wang, Spring 2009 25 Max 50X 1 + 40X 2 + 0S 1 + 0S 2 + 0S 3 + 0S 4 - Ma 4 s.t. 3X 1 + 5X 2 + 1S 1 = 150 1X 2 + 1S 2 = 20 8X 1 + 5X 2 + 1S 3 = 300 1X 1 + 1X 2 - 1S 4 + 1a 4 = 25 Tableau Form 由於第四個方程式缺少基本變數,我們需要加入一個人工變數 (Artificial Variable) 。若無此項,無法踏出第一步以產生 起始的簡捷表。

26 Dr. Grace F. Wang, Spring 2009 26 P.244 ~ 246 The Initial Simplex Tableau : Basis C B S1S1 S2S2 S3S3 a4a4 0 0 0 -M ZjZj Cj - ZjCj - Zj X1X1 X2X2 S1S1 S2S2 S3S3 S4S4 a4a4 3 5 1 0 0 0 0 150 150/3 = 50 50 40 0 0 0 0 -M 0 1 0 1 0 0 0 20 - 8 5 0 0 1 0 0 300 300/8 = 37.5 1 1 0 0 0 -1 1 25 25/1 = 25 -M -M 0 0 0 M -M -25M 50+M 40+M 0 0 0 -M 0 - bibi - - - bibi a ij Max Min ( 代表第一個基本解 ) Pivot Column Phase I ( 第一階段 ) : Pivot Row

27 Dr. Grace F. Wang, Spring 2009 27 P.244 ~ 246 Basis C B S1S1 S2S2 S3S3 X1X1 0 0 0 50 ZjZj Cj - ZjCj - Zj X1X1 X2X2 S1S1 S2S2 S3S3 S4S4 a4a4 0 2 1 0 0 3 -3 75 75/3 = 25 50 40 0 0 0 0 -M 0 1 0 1 0 0 0 20 -- 0 -3 0 0 1 8 -8 100 100/8 = 12.50 1 1 0 0 0 -1 1 25 -- 50 50 0 0 0 -50 50 1250 0 -10 0 0 0 50 -M-50 - bibi - - - bibi a ij Max Min Phase II ( 第二階段 ) – 在 Basis 中不含人工變數之後 Pivot Column Pivot Row

28 Dr. Grace F. Wang, Spring 2009 28 P.244 ~ 246 Basis C B S1S1 S2S2 S4S4 X1X1 0 0 0 50 ZjZj Cj - ZjCj - Zj X1X1 X2X2 S 1 S 2 S 3 S 4 0 25/8 1 0 -3/8 0 75 / 2 (75/2) / (25/8) = 12 50 40 0 0 0 0 0 1 0 1 0 0 20 20 / 1 = 20 0 -3/8 0 0 1/8 1 25 / 2 - 1 5/8 0 0 1/8 0 75 / 2 (75/2) / (8/5) = 60 50 250/80 0 0 50/8 0 1875 0 70/8 0 0 -50/8 0 - bibi - - - bibi a ij Max Min

29 Dr. Grace F. Wang, Spring 2009 29 P.244 ~ 246 Basis C B X2X2 S2S2 S4S4 X1X1 40 0 0 50 ZjZj Cj - ZjCj - Zj X1X1 X2X2 S 1 S 2 S 3 S 4 0 1 8/25 0 -3/25 0 12 50 40 0 0 0 0 0 0 -8/25 1 3/25 0 8 0 0 3/25 0 2/25 1 17 1 0 -5/25 0 5/25 0 30 50 40 14/5 0 26/5 0 1980 0 0 -14/5 0 -26/5 0 - bi Q : Is this the final simplex tableau ?

30 Dr. Grace F. Wang, Spring 2009 30 ( 2 ) A LP model with “ = ” constraints without basic variables For example, 6X 1 + 4X 2 – 5X 3 = 30 We would simply add an artificial variable a 1 to create a basic feasible solution in the initial simplex tableau. 6X 1 + 4X 2 – 5X 3 + 1a 1 = 30 Then, the simplex method proceeds exactly as before.

31 Dr. Grace F. Wang, Spring 2009 31 ( 3 ) A LP model with negative RHS values If X 2 X 1 – 5, then -X 1 + X 2 – 5 Thus, multiply by –1 to obtain X 1 – X 2  5 Then, X 1 – X 2 – S 1 = 5 If X 1 is not a basic variable of this constraints, we need to add an artificial variable a 1 as follows: X 1 – X 2 – S 1 +a 1 = 5

32 Dr. Grace F. Wang, Spring 2009 32 Solving a Minimization Problem (pp.249-250 )§ 5.7 Min 2X 1 + 3X 2 s.t. 1X 1 ≥ 125 Demand for product A 1X 1 + 1X 2 ≥ 350 Total production 2X 1 + 1X 2 ≤ 600 Processing time X 1, X 2 ≥ 0 Max - 2X 1 - 3X 2 s.t. 1X 1 ≥ 125 Demand for product A 1X 1 + 1X 2 ≥ 350 Total production 2X 1 + 1X 2 ≤ 600 Processing time X 1, X 2 ≥ 0 To solve this problem using the simplex method, we first multiply the objective function by -1 to convert the minimization problem into the following equivalent maximization problem:

33 Dr. Grace F. Wang, Spring 2009 33 The final simplex tableau is shown on p.250. Max - 2X 1 - 3X 2 + 0S 1 + 0S 2 + 0S 3 – Ma 1 – Ma 2 s.t. 1X 1 - 1S 1 +1a 1 = 125 1X 1 + 1X 2 - 1S 2 + 1 a 2 = 350 2X 1 + 1X 2 + 1S 3 = 600 X 1, X 2, S 1, S 2, S 3, a 1, a 2 ≥ 0 The tableau form for this problem is as follows:

34 Dr. Grace F. Wang, Spring 2009 34 X1X1 X2X2 S1S1 S 2 S3S3 BasisCBCB -2-3000bibi x 1 -2 10011250 x 2 -3010-2100 s 1 000111125 ZjZj -2-3041-800 C j - Z j 000-4 Note: The value of O. F. -800 must be multiplied by -1 to obtain the value of the objective function for the original minimization problem. Thus, the minimum total cost of the optimal solution is $800.

35 Dr. Grace F. Wang, Spring 2009 35 § 5.8 Special Cases Infeasibility Unboundedness Alternative Optimal Solution Degeneracy

36 Dr. Grace F. Wang, Spring 2009 36 Infeasibility Infeasibility is detected in the simplex method when an artificial variable remains positive in the final tableau. n LP Formulation MAX 2 x 1 + 6 x 2 MAX 2 x 1 + 6 x 2 s. t. 4 x 1 + 3 x 2 < 12 s. t. 4 x 1 + 3 x 2 < 12 2 x 1 + x 2 > 8 2 x 1 + x 2 > 8 x 1, x 2 > 0 x 1, x 2 > 0

37 Dr. Grace F. Wang, Spring 2009 37 Example: Infeasibility Final Tableau

38 Dr. Grace F. Wang, Spring 2009 38 Example: Infeasibility In the previous slide we see that the tableau is the final tableau because all c j - z j < 0. However, an artificial variable is still positive, so the problem is infeasible.

39 Dr. Grace F. Wang, Spring 2009 39 Unboundedness A linear program has an unbounded solution if all entries in an entering column are non-positive. n LP Formulation MAX 2 x 1 + 6 x 2 MAX 2 x 1 + 6 x 2 s. t. 4 x 1 + 3 x 2 > 12 s. t. 4 x 1 + 3 x 2 > 12 2 x 1 + x 2 > 8 2 x 1 + x 2 > 8 x 1, x 2 > 0 x 1, x 2 > 0

40 Dr. Grace F. Wang, Spring 2009 40 Example: Unboundedness

41 Dr. Grace F. Wang, Spring 2009 41 Example: Unboundedness In the previous slide we see that c 4 - z 4 = 4 (is positive), but its column is all non-positive. This indicates that the problem is unbounded.

42 Dr. Grace F. Wang, Spring 2009 42 Alternative Optimal Solution A linear program has alternate optimal solutions if the final tableau has a c j - z j value equal to 0 for a non-basic variable. Final Tableau Final Tableau x 1 x 2 x 3 s 1 s 2 s 3 s 4 x 1 x 2 x 3 s 1 s 2 s 3 s 4 Basis c B 2 4 6 0 0 0 0 Basis c B 2 4 6 0 0 0 0 s 3 0 0 0 2 4 -2 1 0 8 s 3 0 0 0 2 4 -2 1 0 8 x 2 4 0 1 2 2 -1 0 0 6 x 2 4 0 1 2 2 -1 0 0 6 x 1 2 1 0 -1 1 2 0 0 4 x 1 2 1 0 -1 1 2 0 0 4 s 4 0 0 0 1 3 2 0 1 12 s 4 0 0 0 1 3 2 0 1 12 z j 2 4 6 10 0 0 0 32 c j – z j 0 0 0 -10 0 0 0 c j – z j 0 0 0 -10 0 0 0

43 Dr. Grace F. Wang, Spring 2009 43 Example: Alternative Optimal Solution In the previous slide we see that the optimal solution is: x 1 = 4, x 2 = 6, x 3 = 0, and z = 32 Note that x 3 is non-basic and its c 3 - z 3 = 0. This 0 indicates that if x 3 were increased, the value of the objective function would not change. Another optimal solution can be found by choosing x 3 as the entering variable and performing one iteration of the simplex method. The new tableau on the next slide shows an alternative optimal solution is: x 1 = 7, x 2 = 0, x 3 = 3, and z = 32

44 Dr. Grace F. Wang, Spring 2009 44 Example: Alternative Optimal Solution New Tableau x 1 x 2 x 3 s 1 s 2 s 3 s 4 Basis c B 2 4 6 0 0 0 0 s 3 00 -1 0 2 -1 1 0 2 x 3 60.5 1 1 -.5 0 0 3 x 1 21.5 0 2 1.5 0 0 7 s 4 00 -.5 0 2 2.5 0 1 9 z j 2 4 6 10 0 0 0 32 c j - z j 0 0 0 -10 0 0 0

45 Dr. Grace F. Wang, Spring 2009 45 Degeneracy( 退化解 ) 假設海德公司之線性規劃模式修改如下: Max50x 1 +40x 2 s.t.

46 Dr. Grace F. Wang, Spring 2009 46 The simplex tableau after one iteration is as follows:

47 Dr. Grace F. Wang, Spring 2009 47 ` Tie

48 Dr. Grace F. Wang, Spring 2009 48

49 Dr. Grace F. Wang, Spring 2009 49 Degeneracy( 退化解 ) A degenerate solution to a linear program is one in which at least one of the basic variables equals 0. This can occur at formulation or if there is a tie for the minimizing value in the ratio test to determine the leaving variable. When degeneracy occurs, an optimal solution may have been attained even though some c j – z j > 0. Thus, the condition that c j – z j < 0 is sufficient for optimality, but not necessary.

50 Dr. Grace F. Wang, Spring 2009 50 End of Chapter 5


Download ppt "Dr. Grace F. Wang, Spring 2009 1 As shown in Ch2, the graphical solution procedure can be only used to solve linear programming problems involving two."

Similar presentations


Ads by Google