Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 4 The Simplex Algorithm PART 2 Prof. Dr. M. Arslan ÖRNEK.

Similar presentations


Presentation on theme: "1 Chapter 4 The Simplex Algorithm PART 2 Prof. Dr. M. Arslan ÖRNEK."— Presentation transcript:

1 1 Chapter 4 The Simplex Algorithm PART 2 Prof. Dr. M. Arslan ÖRNEK

2 2

3 3 ISE203/IE251

4 4

5 5

6 6

7 7

8 8

9 9

10 10 ISE203/IE251

11 11 ISE203/IE251

12 12 ISE203/IE251

13 13 ISE203/IE251

14 14 ISE203/IE251

15 15 ISE203/IE251

16 16 ISE203/IE251

17 17 ISE203/IE251

18 18 ISE203/IE251

19 19 4.6 – The Simplex Algorithm (min LPs) Two different ways the simplex method can be used to solve minimization problems. min z = 2x 1 – 3x 2 s.t. x 1 + x 2 ≤ 4 x 1 – x 2 ≤ 6 x 1, x 2 ≥ 0 max -z = -2x 1 + 3x 2 s.t. x 1 + x 2 ≤ 4 x 1 – x 2 ≤ 6 x 1, x 2 ≥ 0 Method 1

20 20 4.6 – The Simplex Algorithm (min LPs) Use –z as the basic variable in row 0.

21 21 4.6 – The Simplex Algorithm (min LPs) The optimal solution (to the max problem) is -z = 12, x 2 = 4, s 2 = 10, x 1 = s 1 = 0. Then the optimal solution to the min problem is z = -12, x 2 =4, s 2 = 10, x 1 = s 2 = 0.  z = 2x 1 -3x 2 =2(0) – 3 (4) = -12. In summary, multiply the objective function for the min problem by -1 and solve the problem as a maximization problem with the objective function –z. (optimal z-value for the min problem) = - (optimal z-value for the max problem).

22 22 4.6 – The Simplex Algorithm (min LPs) Method 2 A simple modification of the simplex algorithm can be used to solve min problems directly. Modify Step 3 of the simplex algorithm as follows: If all nonbasic variables (NBV) in row 0 have nonpositive coefficients, the current bfs is optimal. If any nonbasic variable has a positive coefficient, choose the variable with the “most positive” coefficient in row 0 as the entering variable.

23 23 4.7 – Alternative Optimal solutions If an LP has more than one optimal solution, it has multiple optimal solutions. If all nonbasic variables (NBV) have nonzero coefficients in row 0 of the optimal tableau, the LP has a unique optimal solution. Otherwise, the LP may have alternative optimal solutions.

24 24 ISE203/IE251

25 25

26 26 4.8 – Unbounded LPs An unbounded LP occurs in a max problem if l There is a nonbasic variable with a negative coefficient in row 0 and l There is no constraint that limits how large we can make this NBV. An unbounded LP for a max problem occurs when a variable with a negative coefficient in row 0 has a nonpositive coefficient in each constraint.

27 27 ISE203/IE251

28 28 Example 3: Breadco Bakeries-An Unbounded LP

29 29 Solution:

30 30

31 31

32 32 4.11 Degeneracy and the Convergence of the Simplex Algorithm l Theoretically, the simplex algorithm can fail to find an optimal solution to an LP. l The following are facts (for Max LP): –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). l Up to now, we have seen that in each of the LP’s BFS, all basic variables are positive.

33 33 l An LP with this property is a nondegenerate LP. l An LP is degenerate if it has at least one bfs in which a basic variable is equal to zero. l Any bfs that has at least one basic variable equal to zero is a degenerate bfs. l When the same bfs is encountered twice it is called cycling (looping). –If cycling occurs, then we will loop, or cycle, forever among a set of basic feasible solutions and never get to an optimal solution.

34 34 ISE203/IE251

35 35 4.12 The Big M Method l The simplex algorithm requires a starting (initial) bfs. l Previous problems have found starting bfs by using the slack variables as our basic variables. –If an LP have ≥ or = constraints, however, a starting bfs cannot be found easily. l In such a case, the Big M method is used to obtain a starting bfs and solve the problem.

36 36 Example 4: Bevco (A Blending Problem) l Bevco manufactures an orange-flavored soft drink called Oranj by combining orange soda and orange juice. –Each oz of orange soda contains 0.5 oz of sugar and 1 mg of vitamin C. –Each oz 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. l Use linear programming to determine how Bevco can meet the marketing department’s requirements at minimum cost.

37 37 Letting 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 st 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 Example 4: Bevco

38 38 4.10 – The Big M Method 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 What will be the BV in row 2? Row 3? Row 2 would violate sign restrictions Row 3 no readily apparent basic variable. To find a bfs, we create artificial variables. The variables will be labeled according to the row in which they are used. Row 1:z - 2x 1 - 3x 2 = 0 Row 2: 0.5x 1 + 0.25x 2 + s 1 = 4 Row 3: x 1 + 3x 2 - e 2 + a 2 = 20 Row 4: x 1 + x 2 + a 3 = 10

39 39 4.10 – The Big M Method In the optimal solution, all artificial variables must be equal to zero. To accomplish this, in a min LP, a term +Ma i is added to the objective function for each 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. The modified Bevco LP in standard form then becomes: 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 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.

40 40 4.10 – The Big M Method Description of the Big M Method: 1.Modify the constraints so that the rhs of each constraint is nonnegative. 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 function. 5.Since each artificial variable will be in the starting basis, all artificial variables must be eliminated from row 0 before beginning the simplex.

41 41 4.10 – The Big M Method If all artificial variables in the optimal solution equal zero, the solution is optimal. If any artificial variables are positive in the optimal solution, the problem is infeasible. The Bevco example continued: Initial Tableau

42 42 4.10 – The Big M Method

43 43 4.10 – The Big M Method

44 44 Wyndor Problem - modified ISE203/IE251

45 45 Nonzero coefficient of x 5 in the objective function row. We should make it zero. ISE203/IE251

46 46 ISE203/IE251

47 47 ISE203/IE251

48 48 ISE203/IE251

49 49 ISE203/IE251

50 50 ISE203/IE251

51 51 ISE203/IE251

52 52 ISE203/IE251

53 53 ISE203/IE251

54 54 4.14 Unrestricted-in-Sign Variables l If some variables are allowed to be unrestricted in sign (urs), the ratio test and therefore the simplex algorithm are no longer valid. l An LP with an unrestricted-in-sign variable can be transformed into an LP in which all variables are non- negative. –For each urs variable x i, define two new variables x + i and x - i. –Then substitute ( x + i - x - i ) for x i in each constraint and in the objective function. –Also add the sign restrictions.

55 55 l So we express x i as the difference of the two nonnegative variables x + i and x - i. l No basic feasible solution can have both x + i ≥ 0 and x - i ≥ 0. l x + i and x - i will never be both basic variables. –The column of one is equal to the negative column of the other l 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 - i = 0 2.x + i = 0 and x - i > 0 3.x + i = x - i = 0

56 56 Example 8 (Using urs Variables):

57 57 Solution:

58 58

59 59


Download ppt "1 Chapter 4 The Simplex Algorithm PART 2 Prof. Dr. M. Arslan ÖRNEK."

Similar presentations


Ads by Google