The Graphical Method & Algebraic Technique for Solving LP s. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 1

Size: px
Start display at page:

Download "The Graphical Method & Algebraic Technique for Solving LP s. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 1"

Transcription

1 The Graphical Method & Algebraic Technique for Solving LP s Métodos Cuantitativos M. En C. Eduardo Bustos Farías

2 The Graphical Method for Solving LP s If LP models have only two variables, they can be solved graphically: Plot all constraints by first plotting the equality relationship between resource usage and availability (the boundary), then determine the direction of the inequality if necessary Plot the objective function and move it parallel to itself, in the direction of optimization, until it last touches the feasible solution space. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 2

3 An Example LP Problem Blue Ridge Hot Tubs produces two types of hot tubs: Aqua-Spas & Hydro-Luxes. Aqua-Spa Hydro-Lux Pumps Labor 9 hours 6 hours Tubing 2 feet 6 feet Unit Profit $35 $3 There are 2 pumps, 566 hours of labor, and 288 feet of tubing available. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 3

4 LP Model for Blue Ridge Hot Tubs MAX: 35X + 3X 2 S.T.: X + X 2 <= 2 9X + 6X 2 <= 566 2X + 6X 2 <= 288 X >= X 2 >= Métodos Cuantitativos M. En C. Eduardo Bustos Farías 4

5 Solving LP Problems: An Intuitive Approach Idea: Each Aqua-Spa (X ) generates the highest unit profit ($35), so let s make as many of them as possible! How many would that be? Let X 2 = st constraint: X <= 2 2nd constraint: 9X <=566 or X <=74 3rd constraint: 2X <= 288 or X <= 24 If X 2 =, the maximum value of X is 74 and the total profit is $35*74 + $3* = $6,9 This solution is feasible, but is it optimal? No! Métodos Cuantitativos M. En C. Eduardo Bustos Farías 5

6 Solving LP Problems: A Graphical Approach The constraints of an LP problem defines its feasible region. The best point in the feasible region is the optimal solution to the problem. For LP problems with 2 variables, it is easy to plot the feasible region and find the optimal solution. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 6

7 X 2 Plotting the First Constraint (, 2) boundary line of pump constraint X + X 2 = 2 5 (2, ) Métodos Cuantitativos M. En C. Eduardo Bustos Farías 7 X

8 X Plotting the Second Constraint (, 26) boundary line of labor constraint 9X + 6X 2 = (74, ) Métodos Cuantitativos M. En C. Eduardo Bustos Farías 8 X

9 X 2 25 Plotting the Third Constraint (, 8) 2 5 boundary line of tubing constraint 2X + 6X 2 = Feasible Region (24, ) Métodos Cuantitativos M. En C. Eduardo Bustos Farías 9 X

10 X 2 Plotting A Level Curve of the Objective Function (, 6.67) objective function 35X + 3X 2 = 35 5 (, ) Métodos Cuantitativos M. En C. Eduardo Bustos Farías X

11 X 2 A Second Level Curve of the Objective Function (, 75) objective function 35X + 3X 2 = 35 objective function 35X + 3X 2 = (5, ) Métodos Cuantitativos M. En C. Eduardo Bustos Farías X

12 X 2 Using A Level Curve to Locate the Optimal Solution 25 2 objective function 35X + 3X 2 = optimal solution objective function 35X + 3X 2 = Métodos Cuantitativos M. En C. Eduardo Bustos Farías 2 X

13 Calculating the Optimal Solution The optimal solution occurs where the pumps and labor constraints intersect. This occurs where: X + X 2 = 2 () and 9X + 6X 2 = 566 (2) From () we have, X 2 = 2 -X (3) Substituting (3) for X 2 in (2) we have, So the optimal solution is, 9X + 6 (2 -X ) = 566 which reduces to X = 22 X =22, X 2 =2-X =78 Total Profit = $35*22 + $3*78 = $66, Métodos Cuantitativos M. En C. Eduardo Bustos Farías 3

14 Enumerating The Corner Points X obj. value = $54, (, 8) Note: This technique will not work if the solution is unbounded. 5 obj. value = $64, (8, 2) obj. value = $66, (22, 78) 5 obj. value = $ obj. value = $6,9 (, ) (74, ) Métodos Cuantitativos M. En C. Eduardo Bustos Farías 4 X

15 Summary of Graphical Solution to LP Problems. Plot the boundary line of each constraint 2. Identify the feasible region 3. Locate the optimal solution by either: a. Plotting level curves b. Enumerating the extreme points (corner points) Métodos Cuantitativos M. En C. Eduardo Bustos Farías 5

16 Graphing 2-Dimensional LPs Example : y Optimal Solution 4 Maximize x + y Subject to: x + 2 y 2 x Feasible Region y 4 x y 2 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 6 3 x

17 Graphing 2-Dimensional LPs Example 2: 4 y Multiple Optimal Solutions! Minimize ** x - y Subject to: /3 x + y x + 2 y 4 x 3 x y 2 Feasible Region 2 3 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 7 x

18 Graphing 2-Dimensional LPs Example 3: y Minimize x + /3 y Subject to: x + y 2-2 x + 5 y Feasible Region x 5 x y Optimal Solution 2 Métodos Cuantitativos M. En C. Eduardo Bustos Farías x

19 Do We Notice Anything From These 3 Examples? 4 y 4 y 4 y x 2 3 x x Métodos Cuantitativos M. En C. Eduardo Bustos Farías 9

20 A Fundamental Point 4 y 4 y 4 y x 2 3 x x If an optimal solution exists, there is always a corner point optimal solution! Métodos Cuantitativos M. En C. Eduardo Bustos Farías 2

21 Graphing 2-Dimensional LPs Example : Second Corner pt. y Optimal Solution 4 Maximize x + y Subject to: x + 2 y 2 x Feasible Region y 4 x y Initial Corner pt. 2 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 2 3 x

22 And We Can Extend this to Higher Dimensions Métodos Cuantitativos M. En C. Eduardo Bustos Farías 22

23 Then How Might We Solve an LP? The constraints of an LP give rise to a geometrical shape - we call it a polyhedron. If we can determine all the corner points of the polyhedron, then we can calculate the objective value at these points and take the best one as our optimal solution. The Simplex Method intelligently moves from corner to corner until it can prove that it has found the optimal solution. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 23

24 Exercise : Formulating an LP-Problem Advertising Media Selection An advertising company wishes to plan an advertising campaign in three different media television, radio, and magazines. The purpose of the advertising program is to reach as many potential customers as possible. Result of a market study are given below: TV, TV, day time prime time Radio Magazines Cost of an Advertising unit, in $ # of potential customers reached/unit # of women customers reached/unit The company does not want to spend more than $8 on advertising. It further requires that () at least 2 million exposures take place among women; (2) advertising on TV Métodos be limited Cuantitativos to $5 ; (3) M. at En least C. Eduardo 3 advertising Bustos Farías units be bought on day time 24 TV, and two units during prime time; and (4) the number of advertising units on radio and

25 Solving Linear Programming Problems Graphical Technique First graph the constraints: the solution set of the system is that region (or set of ordered pairs), which satisfies ALL the constraints. This region is called the feasible set Métodos Cuantitativos M. En C. Eduardo Bustos Farías 25

26 Solving Linear Programming Problems: Graphical Technique continued Locate all the corner points of the graph: the coordinates of the corners will be determined algebraically It is important to note that the optima is obtained at the boundary of the solution set and furthermore at the corner points. For linear programs, it can be shown that the optima will always be obtained at corner points. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 26

27 Solving Linear Programming Problems: Graphical Technique continued Determine the optimal value: test all the corner points to see which yields the optimum value for the objective function Objective function Feasible set Optimum Métodos Cuantitativos M. En C. Eduardo Bustos Farías 27

28 Example 2 Suppose a company produces two types of widgets, manual and electric. Each requires in its manufacture the use of three machines; A, B, and C. A manual widget requires the use of the machine A for 2 hours, machine B for hour, and machine C for hour. An electric widget requires hour on A, 2 hours on B, and hour on C. Furthermore, suppose the maximum numbers of hours available per month for the use of machines A, B, and C are 8, 6, and, respectively. The profit on a manual widget is $4 and on electric widget it is $6. See the table below for a summary of data. If the company can sell all the widgets it can produce, how many of each type should it make in order to maximize the monthly profit? Manual Electric Hours available A 2 8 B 2 6 C profit $4 $6 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 28

29 Example 2 continued Step I Identify decision variables: x = number of manual widgets y = number of electric widgets Step II Identify constraints: 2x + y 8 x + 2y 6 x + y x y Métodos Cuantitativos M. En C. Eduardo Bustos Farías 29

30 Example 2 continued Step III Define objective function: Solving P for y gives max P = 4x + 6y y = -2/3 + P/3. This defines a so-called family of parallel lines, isoprofit lines. Each line gives all possible combinations of x and y that yield the same profit. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 3

31 Example 2 continued Métodos Cuantitativos M. En C. Eduardo Bustos Farías 3

32 Example 2 continued Métodos Cuantitativos M. En C. Eduardo Bustos Farías 32

33 Special Conditions in LP Models A number of special conditions may occur in LP problems: Alternate Optimal Solutions Redundant Constraints Unbounded Solutions Infeasibility Métodos Cuantitativos M. En C. Eduardo Bustos Farías 33

34 Example of Alternate Optimal Solutions X What if the price of Aqua-Spas generates a profit of $45 instead of $35? objective function level curve 45X + 3X 2 = alternate optimal solutions Métodos Cuantitativos M. En C. Eduardo Bustos Farías 34 X

35 Example of a Redundant Constraint X What if 225 pumps are avaivale instead of 2? X + X2 <= 225 Pumps boundary line of tubing constraint boundary line of pump constraint 5 boundary line of labor constraint 5 Feasible Region Métodos Cuantitativos M. En C. Eduardo Bustos Farías 35 X

36 Example of an Unbounded Solution Consider the following problem: MAX: Z= X + X2 S.T.:X + X2 >= 4 -X + 2X2 <= 4 X >= X2 >= Métodos Cuantitativos M. En C. Eduardo Bustos Farías 36

37 Example of an Unbounded Solution X objective function X + X 2 = 6 objective function X + X 2 = 8 -X + 2X 2 = X + X 2 = Métodos Cuantitativos M. En C. Eduardo Bustos Farías 37 X

38 Example of Infeasibility Consider the following problem: MAX: Z= X + X2 S.T.:X + X2 <= 5 X + X2 >= 2 X >= X2 >= Métodos Cuantitativos M. En C. Eduardo Bustos Farías 38

39 Example of Infeasibility X X + X 2 = 2 feasible region for second constraint 5 feasible region for first constraint X + X 2 = Métodos Cuantitativos M. En C. Eduardo Bustos Farías 39 X

40 Prototype Example The WYNDOR GLASS CO. produces high-quality glass products including windows and galss doors. It has three plants. Aluminum frames and hardware are made in Plant, wood frames in Plant 2, and Plant 3 produces the glass and assembles the products. Because of declining earnings, top management has decided to revamp the company s product line. Unprofitable products are being discontinued, releasing production capacity to launch two new products having large sales potential. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 4

41 Prototype Example The two new products are: Product : An 8-foot glass door with aluminum framing Product 2: A 4 x 6 foot double-hung wood-framed window An OR team has been assembled to recommend the product mix of these two new products which will maximize the profit from their sales. The team has assembled the data in the following table: Métodos Cuantitativos M. En C. Eduardo Bustos Farías 4

42 Prototype Example Production Time/Batch (hrs.) Product Plant 2 Available Production Time/Week (hrs.) Profit per batch $3, $5, Métodos Cuantitativos M. En C. Eduardo Bustos Farías 42

43 Max Z = 3x + 5x st.. x 2 x 2 3x + 2x 8 2 x, x Example x x Métodos Cuantitativos M. En C. Eduardo Bustos Farías 43

44 Example Problem Maximize Z = 5x + 2x 2 + x 3 subject to x + 3x 2 - x 3 6, x 2 + x 3 4, 3x + x 7, 2 x, x 2, x 3. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 44

45 Simplex and Example Problem Step. Convert to Standard Form a x + a 2 x a n x n b, a 2 x + a 22 x a 2n x n b 2, a m x + a m2 x a mn x n b m, a x + a 2 x a n x n + x n+ = b, a 2 x + a 22 x a 2n x n - x n+2 = b 2, a m x + a m2 x a mn x n + x n+k = b m, In our example problem: x + 3x 2 - x 3 6, x 2 + x 3 4, 3x + x 7, 2 x, x 2, x 3. x + 3x 2 - x 3 + x 4 = 6, x 2 + x 3 + x 5 = 4, 3x + x + x 2 6 = 7, x, x 2, x 3, x 4, x 5, x 6. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 45

46 Simplex: Step 2 Step 2. Start with an initial basic feasible solution (b.f.s.) and set up the initial tableau. In our example Maximize Z = 5x + 2x 2 + x 3 x + 3x 2 - x 3 + x 4 = 6, x 2 + x 3 + x 5 = 4, 3x + x 2 + x 6 = 7, x, x 2, x 3, x 4, x 5, x 6. c B Basis c j Constants 5 2 x x 2 x 3 x 4 x 5 x 6 x x 5 4 x c row 5 2 Z= Métodos Cuantitativos M. En C. Eduardo Bustos Farías 46

47 Step 2: Explanation Adjacent Basic Feasible Solution If we bring a nonbasic variable x s into the basis, our system changes from the basis, x b, to the following (same notation as the book): x + ā s x s = x r + ā rs x r = x m + ā ms x s = b b r b s s i is i= Métodos Cuantitativos M. En C. Eduardo Bustos Farías 47 x i = x s = x j = bi a is for i =,, m for j=m+,..., n and j s The new value of the objective function becomes: Z = m i= c i (b i a is ) + c Thus the change in the value of Z per unit increase in x s is c s = new value of Z - old value of Z m m = ci (bi ais ) + cs cibi = i= c m c a i= s This is the Inner Product rule

48 Simplex: Step 3 Use the inner product rule to find the relative profit coefficients c B Basis c j Constants 5 2 x x 2 x 3 x 4 x 5 x 6 x x 5 4 x c row 5 2 Z= c j = c j c B P j c = 5 - () - () - (3) = 5 -> largest positive c 2 =. c 3 =. Step 4: Is this an optimal basic feasible solution? Métodos Cuantitativos M. En C. Eduardo Bustos Farías 48

49 Simplex: Step 5 Apply the minimum ratio rule to determine the basic variable to leave the basis. The new values of the basis variables: x i = b a i is x s for i =,..., m In our example: max x s b min ais a = > is c B Basis c j Constants 5 2 x x 2 x 3 x 4 x 5 x 6 x x 5 4 x c row 5 2 Z= i Row Basic Variable Ratio x x 5-3 x 6 7/3 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 49

50 Simplex: Step 6 Perform the pivot operation to get the new tableau and the b.f.s. c B Basis c j Constants 5 2 x x 2 x 3 x 4 x 5 x 6 x x 5 4 x c row 5 2 Z= New iteration: find entering variable: c j = c j c B c B = ( 5) P j c 2 = 2 - () 8/3 - () - (5) /3 = /3 c 3 = - () (-) - () - (5) = c 6 = - () - () - (5) /3 = -5/3 c B Basis c j Constants 5 2 x x 2 x 3 x 4 x 5 x 6 x 4 8/3 - /3 x x /3 /3 7/3 c row /3-5/3 Z=35/3 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 5

51 Final Tableau c B Basis c j Constants 5 2 x x 2 x 3 x 4 x 5 x 6 x 4 8/3 - /3 x x /3 /3 7/3 c row /3-5/3 Z=35/3 x 3 enters basis, x 5 leaves basis Wrong value! 4 should be /3 c B Basis c j Constants 5 2 x x 2 x 3 x 4 x 5 x 6 x /3 x x /3 /3 7/3 c row -2/3 - -5/3 Z=47/3 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 5

52 Exercise: Solving an LP-problem: A California vintner has available 66 lbs of Cabernet Sauvignon (CS) grapes, 86 lbs of Pinot Noir (PN) grapes, and 2 lbs of Barbera (B) grapes. The vintner makes a Pinot Noir (PN) wine, which contains 2% CS, 6% PN, and 2% B grapes and sells $3 a bottle, and a Barbera (B) wine, which contains % CS, 2% PN, and 7% B grapes and sells for $2 a bottle. Assuming each bottle of wine requires 3 lbs of grapes, determine how many bottles of each type of wine should be produced to maximize income. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 52

53 Solving an LP-problem continued: Algebraic Technique The graphical method solving linear programming problems can be used for problems with two variables (with some difficulty three) However, for problems were the number of variables might run into hundreds or thousands, algebraic techniques must be used The simplex method, with the aid of the computer, can solve these problems Métodos Cuantitativos M. En C. Eduardo Bustos Farías 53

54 As with the graphical procedure, the simplex method finds the optimal cornerpoint solution of the set of feasible solutions. Regardless of the number of decision variables and regardless of the number of constraints, the simplex method uses the key property of a linear programming problem, which is: Métodos Cuantitativos M. En C. Eduardo Bustos Farías 54

55 A linear programming problem always has an optimal solution occurring at a corner-point solution Simplex method begins with a feasible solution and tests whether or not it is optimum. If not optimum, the method proceeds to a better solution. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 55

56 Solution of a maximum-type linear programming problem by the simplex algorithm involves the following steps:. Adding slack variables to convert the inequalities into equations In the case of less-than-or-equal-to constraints, slack variables are used to increase the left-hand side to equal the righthand side limits of the constraint conditions. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 56

57 Example: max Z = 3x + x 2 st. 2x + x 2 8 2x + 3x 2 2 adding slacks and rewriting the object row: 2x + x 2 + s = 8 2x + 3x 2 + s 2 = 2-3x x 2 + Z = where x, x 2, s and s 2 are non-negative. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 57

58 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 58 2x + x 2 + s = 8 2x + 3x 2 + s 2 = 2-3x x 2 + Z = 2. Setting up the initial simplex tableau Form an augmented coefficient matrix: Z s s Z s s x x

59 3. Finding an initial feasible solution Simplex algorithm starts always from origin. In our case it means that the initial feasible solution is: x =, x 2 =, s = 8, s 2 = 2. Simplex method proceeds from this corner point to an adjacent corner point. Such corner points are called basic feasible solutions. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 59

60 4. Introducing basic and nonbasic variables as the natural way to express basic feasible solutions For any basic feasible solution (B.F.S.), the variables held zero are called nonbasic variables and the other are called basic variables. Moving form one B.F.S. to another means that one basic variable (we call it a departing or exiting variable) becomes nonbasic and a nonbasic variable (entering variable) becomes a basic variable. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 6

61 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 6

62 5. Choosing the proper pivot element to advance the solution and maintain the non-negativity of all variables How to decide which variable to make basic and which nonbasic (in other words in which direction to move from the current B.F.S.)? Métodos Cuantitativos M. En C. Eduardo Bustos Farías 62

63 The natural direction is the one in which the value of the objective function increases the most: If in Z = 3x + x 2, x is allowed to become basic, x 2 remains at and Z = 3x ; thus for each oneunit increase in x, Z increases by 3 units. On the other hand, if x 2 is allowed to become basic, Z will increase only by one unit if x 2 is increased by one unit. This is one way to determine the pivot column. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 63

64 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 64 Choosing the proper pivot element continued Another way to determine the pivot column is to examine the bottom row of the simplex tableau: Z s s Z s s x x indicators entering variable

65 The bottom row entries to the left of the vertical line are called indicators. We choose the column with the most negative indicator as the pivot column. Having chosen the pivot column, we must now determine the pivot row in order to know which element in our simplex tableau is the pivoting element. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 65

66 For that purpose we divide the right hand side entries of the simplex tableau by corresponding entries of the pivot column. Of the resulting quotients we choose the smallest (minimum quotient). So the pivot element is the intersection of the pivot column and pivot row. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 66

67 The pivot element is the intersection of the pivot column and pivot row: departing variable s s 2 Z x x 2 s s 2 Z Quotients 8 2 = 4 (smaller) 2 2 = 6 entering variable (most negative indicator) Métodos Cuantitativos M. En C. Eduardo Bustos Farías 67

68 Since x and s 2 will be the basic variables in our new B.F.S, it would be convenient to change our previous tableau by elementary row operations into a form where the values of x, s 2, and Z can be read off with ease just as in the initial basic solution. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 68

69 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 69 To do this we want to find a matrix which is equivalent to the tableau above but which has the form:????????? 2 2 Z s s x x where the question marks represent numbers to be determined.

70 6. Pivoting, which is done column wise. We must transform the tableau to an equivalent matrix that has a at the place of the pivot element (pivot entry) and s elsewhere in the column x. departing variable s s 2 Z x x s * entering variable 2 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 7 s 2 Z

71 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 7 By elementary row operations, we have: Z s s x x Z s s x x ½R -2R + R 2 3R + R 3

72 7. Continuing and recognizing when the algorithm terminates. General termination rule: all values in the indicator row are non-negative. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 72

73 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 73 We have a new simplex tableau: Z s x Z s s x x indicators All values in the indicator row are nonnegative. Hence, we have found the optimal solution for the problem. The solution is: x = 4, x 2 = and Z= 2

74 Linear Programs in higher dimensions maximize z = -4x + x 2 - x 3 + x 4 subject to -7x + 5x 2 + x 3 + x 4 = 8-2x + 4x 2 + 2x 3 - x 4 = x, x 2, x 3, x 4 We will describe LPs that start with the following form: equality constraints non-negative RHS nonnegative variables Métodos Cuantitativos M. En C. Eduardo Bustos Farías 74

75 Basic Feasible Solutions maximize z = -4x + x 2 - x 3 + x 4 subject to -7x + 5x 2 + x 3 + x 4 = 8-2x + 4x 2 + 2x 3 - x 4 = x, x 2, x 3, x 4 Suppose there are m constraints, n variables A basic solution is found by setting n-m variables to and solving the remaining system with n variables and n constraints. The n m variables are called non-basic variables The m variables are called basic variables Métodos Cuantitativos M. En C. Eduardo Bustos Farías 75

76 Basic Feasible Solutions maximize z = -4x + x 2 - x 3 + x 4 subject to -7x + 5x 2 + x 3 + x 4 = 8-2x + 4x 2 + 2x 3 - x 4 = x, x 2, x 3, x 4 -z x x 2 x 3 x = -7 5 = = Métodos Cuantitativos M. En C. Eduardo Bustos Farías 76

77 Basic Feasible Solutions -z x x 2 x 3 x = = = -6 Example: Suppose we want the solution with basic variables x 3 and x 4, and thus x and x 2 are non-basic. We then perform pivot operations. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 77

78 Basic Feasible Solutions Next pivot on the 3. -z x x 2 x 3 x = = = -62 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 78

79 reduced costs Basic Feasible Solutions Canonical form: basic variables have a single one in the column. -z x x 2 x 3 x = = = -62 The basic solution is found by setting non-basic variables to. We get x =, x 2 =, x 3 =6, x 4 =2. This solution also satisfies x. It is called a basic feasible solution. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 79

80 More on Basic Feasible Solutions Each corner point solution of the polyhedron is a basic feasible solution. The simplex method is a systematic way of moving from one basic feasible solution to another, always improving the solution, until the optimum solution is obtained. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 8

81 The Simplex Algorithm -z x x 2 x 3 x 4 z = -3x + 2x = = = 2 The entering variable for a max problem is a variable with positive reduced cost. The pivot element is chosen uniquely in the column of Métodos Cuantitativos M. En C. Eduardo Bustos Farías 8 the entering variable so that the next basis is feasible.

82 The Simplex Algorithm The pivot element is chosen according to a min ratio rule. -z x x 2 x 3 x = = = 2 A pivot is carried out, leading to the next bfs. Variable x 4 has left the basis. The new basis consists of x 2 and x 3. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 82

83 The Simplex Algorithm Pivots are carried out until the bfs is optimal. -z x x 2 x 3 x /3 -/2 = / /2 = /3 -/2.5 = 2 3 z = -x 3 /3 x 4 /2 + 3 This new bfs is optimal. Increasing x 3 or x 4 makes the solution worse. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 83

84 The Simplex Algorithm -z x x 2 x 3 x /3 -/2 = / /2 = /3 -/2.5 = 2 3 Optimality conditions for a maximization problem: all reduced costs are non-positive. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 84

85 Simplex Method in Matrix Form x B : basic variables of final tableau x L : non-basic variables of final tableau Rearranging columns, we can express the LP as: A = [B L]: the original constraint matrix c = [c B c L ]: the original objective coefficient vector Initial Problem: Maximize z = c B x B + c L x L B x B + L x L = b x B, x L Métodos Cuantitativos M. En C. Eduardo Bustos Farías 85

86 Basic Feasible Solutions in Matrix Form Initial Problem: minimize z = c B x B + c L x L B x B + L x L = b x B, x L Let the bar above a vector or matrix represent the updated values in the tableau after pivoting. Final System in canonical form (after pivoting): minimize - -z + c L x L = - z x B + L x L = b x B, x L Métodos Cuantitativos M. En C. Eduardo Bustos Farías 86

87 L and b Start with: B x B + L x L = b B - B x B + B - L x L = B - b x B + B - L x L = B - b --> L= B - L, and b= B - b, The basic feasible solution is obtained by setting x L to. Therefore, x B = B - b. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 87

88 c L Start with: z = c B x B + c L x L z = c B (B - b - B - L x L ) + c L x L z = c B B - b + (c L -c B B - L ) x L c L = c L -c B B - L and z= c B B - b, There is no coefficient for x B in the final system. So, we substitute for x B. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 88

89 Notation: let π = c B B - Start with: z = c B x B + c L x L c L = c L -c B B - L and z= c B B - b, c L = c L - π L and z= π b, π is called the vector of simplex multipliers. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 89

90 How to Convert an LP to Standard Form Before the simplex algorithm can be used to solve an LP, the LP must be converted into a problem where all the constraints are equations and all variables are nonnegative. An LP in this form is said to be in standard form. Consider the following example. Leather Limited manufactures two types of leather belts: the deluxe model and the regular model. Each type requires square yard of leather. A regular belt requires hour of skilled labor and a deluxe belt requires 2 hours of skilled labor. Each week, 4 square yards of leather and 6 hours of skilled labor are available. Each regular belt contributes $3 profit and each deluxe belt $4. Write an LP to maximize profit. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 9

91 How to Convert an LP to Standard Form The decision variables are: x = number of deluxe belts produced weekly x 2 = number of regular belts produced weekly the appropriate LP is: max z = 4x + 3x 2 s.t. x + x 2 4 (leather constraint) 2x +x 2 6 (labor constraint) x, x 2 To convert the leather and labor ( ) constraints to equalities, we define for each constraint a slack variable s i (s i = slack variable for the i th constraint). A slack variable is the amount of the resource unused in the i th constraint. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 9

92 How to Convert an LP to Standard Form The LP not in standard form is: max z = 4x + 3x 2 s.t. x + x 2 4 (leather constraint) 2x + x 2 6 (labor constraint) x, x 2 The same LP in standard form is: max z = 4x + 3x 2 s.t. x + x 2 + s = 4 2x + x 2 + s 2 = 6 x, x 2, s, s 2 In summary, if a constraint i of an LP is a constraint, convert it to an equality constraint by adding a slack variable s i to the i th constraint and adding the sign restriction s i. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 92

93 How to Convert an LP to Standard Form A constraint can be converted to an equality constraint. Consider the formulation below: min z = 5 x + 2x 2 + 3X x 4 s.t. 4x + 2x x 3 + 5x 4 5 3x + 2x 2 6 2x + 2x 2 + 4x 3 + 4x 4 2x + 4x 2 + x 3 + 5x 4 8 x, x 2, x 3, x 4 To convert the i th constraint to an equality constraint, define an excess variable (sometimes called a surplus variable) e i (e i will always be the excess variable for the i th constraint. We define e i to be the amount by which i th constraint is over satisfied. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 93

94 How to Convert an LP to Standard Form Transforming the LP on the previous slide to standard form yields: min z = 5 x + 2x 2 + 3X x 4 s.t. 4x + 2x x 3 + 5x 4 e = 5 3x + 2x 2 -e 2 = 6 2x + 2x 2 + 4x 3 + 4x 4 -e 3 = 2x + 4x 2 + x 3 + 5x 4 -e 4 = 8 x i, e i > (i =,2,3,4) In summary, if the i th constraint of an LP is a constraint, it can be converted to an equality constraint by subtracting the excess variable e i from the i th constraint and adding the sign restriction e i. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 94

95 How to Convert an LP to Standard Form If an LP has both and constraints, apply the previous procedures to the individual constraints. Consider the example below. Nonstandard Form max z = 2x + 5x 2 s.t. x x 2 5x + 35x 2 6 2x + 5x 2 2 x, x 2 > Standard Form max z = 2x + 5x2 s.t. x + s = x 2 + s 2 = 5x + 35x 2 + s 3 = 6 2x + 5x 2 -e 4 = 2 x, x 2, s, s 2, s 3, e 4 > Métodos Cuantitativos M. En C. Eduardo Bustos Farías 95

96 Preview of the Simplex Algorithm Suppose an LP with m constraints and n variables has been converted into standard form. The from of such an LP is: max ( or min) z = c x + c 2 x 2 + +c n x n s.t. a x + a 2 x a n x n =b a 2 x + a 22 x a 2n x n =b a m x + a m2 x a mn x n =b m x i ( i =,2,, n) Métodos Cuantitativos M. En C. Eduardo Bustos Farías 96

97 Preview of the Simplex Algorithm If we define: A a a 2... a m a 2 a a m a n a 2n... a mn x x x 2... x n b b b 2... b m The constraints may be written as a system of equations Ax = b. Consider a system Ax = b of m linear equations in n variables (where n m). A basic solution to Ax = b is obtained by setting n m variables equal to and solving for the remaining m variables. This assumes that setting the n m variables equal to yields a unique value for the remaining m variables, or equivalently, the columns for the remaining m variables are linearly independent. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 97

98 Preview of the Simplex Algorithm To find a basic solution to Ax = b, we choose a set of n m variables (the nonbasic variables, or NBV) and set each of these variables equal to. Then we solve for the values of the n (n m) = m variables (the basic variables, or BV) that satisfy Ax = b. Different choices of nonbasic variables will lead to different basic solutions. Consider the basic solutions to the system of 2 equations shown to the right: The number of nonbasic variables = 3 2 =. Setting, for example, NBV = {x 3 } (as shown to the right, then BV = {x, x 2 }. We can obtain the values for these basic variables by setting x 3 =. Solving we find x = 2, x 2 =. Thus, x = 2, x 2 =, and x 3 = is a basic solution. x + x 2 = 3 -x 2 + x 3 = - x + x 2 = 3 -x 2 + = - Métodos Cuantitativos M. En C. Eduardo Bustos Farías 98

99 Preview of the Simplex Algorithm If NBV = {x } and BV = {x 2, x 3 } are chosen instead, the basic solution becomes x =, x 2 = 3, and x 3 = 2. If NBV = {x 2 } and BV = {x, x 3 } are chosen instead, the basic solution becomes x = 3, x 2 =, and x 3 = -. Some sets of m variables do not yield a basic solution. Consider the linear system shown to the right: If NBV = {x 3 } and BV = {x, x 2 } the corresponding basic solution would be: x + 2x 2 + x 3 = 2x + 4x 2 + x 3 = 3 x + 2x 2 = 2x + 4x 2 = 3 Since this system has no solution, there is no basic solution corresponding to BV = {x, x 2 }. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 99

100 Preview of the Simplex Algorithm Any basic solution in which all variables are nonnegative is called a basic feasible solution ( or bfs). For the basic solutions on the previous slides, x = 2, x 2 =, x 3 = and x =, x 2 = 3, x 3 = 2 are basic feasible solutions, but the basic solution x = 3, x 2 =, x 3 = - fails to be a bfs (because x 3 < ). The following two theorems explain why the concept of a basic feasible solution is of great importance in linear programming: Theorem The feasible region for any linear programming problem is a convex set. Also, if an LP has an optimal solution, there must be an extreme point of the feasible region that is optimal. Theorem 2 For any LP, there is a unique extreme point of the LP s feasible region corresponding to each basic feasible solution. Also, there is at least one bfs corresponding to each extreme point in the feasible region. Métodos Cuantitativos M. En C. Eduardo Bustos Farías

101 Preview of the Simplex Algorithm The relationship between extreme points and basic feasible solutions outlined in Theorem 2, is seen in the Leather Limited problem. The LP (with slack variables) was: X2 D B Labor Constraint max z = 4x + 3x 2 s.t. x + x 2 + s = 4 2x + x 2 + s 2 = 6 x, x 2, s, s 2 E Feasible Region Leather Constraint Both inequalities are satisfied in the shaded area. The extreme points are of the feasible region are B, C, E, and F. F C A 5 X Métodos Cuantitativos M. En C. Eduardo Bustos Farías

102 Preview of the Simplex Algorithm Basic Variables Nonbasic Variables Basic Feasible Solution Corresponds to Corner Point x, x 2 s, s 2 s = s 2 =, x = x 2 = 2 E x, s x 2, s 2 x 2 = s 2 =, x = 3, s = C x, s 2 x 2, s x 2 = s =, x = 4, s 2 = - 2 Not a bfs since s 2 < x 2, s x, s 2 x = s 2 =, s = - 2 x 2 = 6 Not a bfs since s < x 2, s 2 x, s x = s =, x 2 = 4, s 2 = 2 B s, s 2 x, x 2 x = x 2 =, s = 4, s 2 = 6 F The table above shows the correspondence between the basic feasible solutions to the LP and the extreme points of the feasible region. The basic feasible solutions to the standard form of the LP correspond in a natural fashion to the LP s extreme points. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 2

103 Preview of the Simplex Algorithm Adjacent Basic Feasible Solutions For any LP with m constraints, two basic feasible solutions are said to be adjacent if their sets of basic variables have m basic variables in common. For example in the Leather Limited LP on the previous slide, the bfs corresponding to point E is adjacent to the bfs corresponding to point C. These points share (m = 2 - = ) one basic variable, x. Points E (BV = {x,x 2 }) and F (BV = {s,s 2 }) are not adjacent since they share no basic variables. Intuitively, two basic feasible solutions are adjacent if they both lie on the same edge of the boundary of the feasible region. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 3

104 Preview of the Simplex Algorithm General description of the simplex algorithm solving an LP in a maximization problem: Step Find a bfs to the LP. We will call this bfs the initial bfs. In general, the most recent bfs will be called the current bfs, so at the beginning of the problem, the initial bfs is the current bfs. Step 2 Determine if the current bfs is an optimal solution to the LP. If it is not, find an adjacent bfs that has a larger z- value. Step 3 bfs. Return to Step 2, using the new bfs as the current Métodos Cuantitativos M. En C. Eduardo Bustos Farías 4

105 The Simplex Algorithm (max LPs) The Simplex Algorithm Procedure for maximization LPs Step Convert the LP to standard form Step 2 Obtain a bfs (if possible) from the standard form Step 3 Determine whether the current bfs is optimal Step 4 If the current bfs is not optimal, determine which nonbasic variable should be come a basic variable and which basic variable should become a nonbasic variable to find a bfs with a better objective function value. Step 5 Use ero s to find a new bfs with a better objective function value. Go back to Step 3. In performing the simplex algorithm, write the objective function in the form: z c x c 2 x 2 - -c n x n = We call this format the row version of the objective function (row for short). Métodos Cuantitativos M. En C. Eduardo Bustos Farías 5

106 The Simplex Algorithm (max LPs) Consider the simplex algorithm applied to the maximization below: The Dakota Furniture company manufactures desk, tables, and chairs. The manufacturer of each type of furniture requires lumber and two types of skilled labor: finishing and carpentry. The amount of each resource needed to make each type of furniture is given in the table below. Resource Desk Table Chair Lumber 8 board ft 6 board ft board ft Finishing hours 4 hours 2 hours.5 hours Carpentry hours 2 hours.5 hours.5 hours Métodos Cuantitativos M. En C. Eduardo Bustos Farías 6

107 The Simplex Algorithm (max LPs) At present, 48 board feet of lumber, 2 finishing hours, 8 carpentry hours are available. A desk sells for $6, a table for $3, and a chair for $ 2. Dakota believes that demand for desks and chairs is unlimited, but at most 5 tables can be sold. Since the available resources have already been purchased, Dakota wants to maximize total revenue. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 7

108 The Simplex Algorithm (max LPs) Define: x = number of desks produced x 2 = number of tables produced x 3 = number of chairs produced. The LP is: max z = 6x + 3x 2 + 2x 3 s.t. 8x + 6x 2 + x 3 48 (lumber constraint) 4x + 2x 2 +.5x 3 2 (finishing constraint) 2x +.5x 2 +.5x 3 8 (carpentry constraint) x 2 x, x 2, x 3 5 (table demand constraint) Métodos Cuantitativos M. En C. Eduardo Bustos Farías 8

109 The Simplex Algorithm (max LPs) Step - Convert the LP to Standard Form Canonical Form Basic Variable Row z 6x 3x 2 2x 3 = z = Row 8x + 6x 2 + x 3 + s = 48 s = 48 Row 2 4x + 2x 2 +.5x 3 + s 2 = 2 s 2 = 2 Row 3 2x +.5x 2 +.5x 3 + s 3 = 8 s 3 = 6 Row 4 x 2 + s 4 = 5 s 4 = 5 If we set x = x 2 = x 3 =, we can solve for the values s, s 2, s 3, s 4. Thus, BV = {s, s 2, s 3, s 4 } and NBV = {x, x 2, x 3 }. Since each constraint is then in canonical form (BVs have a coefficient = in one row and zeros in all other rows) with a nonnegative rhs, a bfs can be obtained by inspection. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 9

110 The Simplex Algorithm (max LPs) Step 2 Obtain a Basic Feasible Solution To perform the simplex algorithm, we need a basic (although not necessarily nonnegative) variable for row. Since z appears in row with a coefficient of, and z does not appear in any other row, we use z as the basic variable. With this convention, the basic feasible solution for our initial canonical form has: BV = {z, s, s 2, s 3, s 4 } and NBV = {x, x 2, x 3 }. For this initial bfs, z =, s = 48, s 2 = 2, s 3 = 8, s 4 =5, x = x 2 = x 3 =. As this example indicates, a slack variable can be used as a basic variable if the rhs of the constraint is nonnegative. Métodos Cuantitativos M. En C. Eduardo Bustos Farías

111 The Simplex Algorithm (max LPs) Step 3 Determine if the Current BFS is Optimal Once we have obtained a bfs, we need to determine whether it is optimal. To do this, we try to determine if there is any way z can be increased by increasing some nonbasic variable from its current value of zero while holding all other nonbasic variables at their current values of zero. Solving for z in row yields: Z = 6x + 3x 2 + 2x 3 For each nonbasic variable, we can use the equation above to determine if increasing a nonbasic variable (while holding all other nonbasic variables to zero) will increase z. Increasing any of the nonbasic variables will cause an increase in z. However increasing x causes the greatest rate of increase in z. If x increases from its current value of zero, it will have to become a basic variable. For this reason, x is called the entering variable. Observe x has the most negative coefficient in row. Métodos Cuantitativos M. En C. Eduardo Bustos Farías

112 The Simplex Algorithm (max LPs) Step 4 - We choose the entering variable (in a max problem) to the nonbasic variable with the most negative coefficient in row (ties broken arbitrarily). We desire to make x as large as possible but as we do, the current basic variables (s, s 2, s 3, s 4 ) will change value. Thus, increasing x may cause a basic variable to become negative. RATIO From row we see that s = 48 8x. Since s, x 48 / 8 = 6 From row 2, we see that s 2 = 2 4x. Since s 2, x 2 / 4 = 5 From row 3, we see that s 3 = 8 2x. Since s 3, x 8 / 2 =4 From row 4, we see that s 4 = 5. For any x, s 4 will always be This means to keep all the basic variables nonnegative, the largest we can make x is min {6, 5, 4} = 4. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 2

113 The Simplex Algorithm (max LPs) The Ratio Test When entering a variable into the basis, compute the ratio: rhs of row / coefficient of entering variable in row For every constraint in which the entering variable has a positive coefficient. The constraint with the smallest ratio is called the winner of the ratio test. The smallest ration is the largest value of the entering variable that will keep all the current basic variables nonnegative. Make the entering variable x a basic variable in row 3 since this row (constraint) was the winner of the ratio test (8/2 =4). Métodos Cuantitativos M. En C. Eduardo Bustos Farías 3

114 The Simplex Algorithm (max LPs) To make x a basic variable in row 3, we use elementary row operations (ero s) to make x have a coefficient of in row 3 and a coefficient of in all other rows. This procedure is called pivoting on row 3; and row 3 is called the pivot row. The final result is that x replaces s3 as the basic variable for row 3. The term in the pivot row that involves the entering basic variable is called the pivot term. Step 5 - The Gauss-Jordan method using ero s and simplex tableaus shown on the next slide makes x a basic variable. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 4

115 The Simplex Algorithm (max LPs) ero z x x2 x3 s s2 s3 s4 rhs ero row 3 divided by /2 4 5 ero 2 z x x2 x3 s s2 s3 s4 rhs times row 3 added to row ero 3 z x x2 x3 s s2 s3 s4 rhs times row 3 added to row ero 4 z x x2 x3 s s2 s3 s4 rhs times row 3 added to row Métodos Cuantitativos M. En C. Eduardo Bustos Farías 5

116 The result is: The Simplex Algorithm (max LPs) Canonical Form Basic Variable Row z + 5x 2-5x 3 + 3s 3 = 24 z = 24 Row - x 3 + s - 4s 3 = 6 s = 6 Row 2 - x x 3 + s 2-2 s 3 = 4 s 2 = 4 Row 3 x +.75x x 3 +.5s 3 = 4 x = 4 Row 4 x 2 + s 4 = 5 s 4 = 5 In canonical form, BV = {z, s, s 2, x, s 4 } and NBV = {s 3, x 2, x 3 }. yielding the bfs z = 24, s = 6, s 2 = 4, x = 4, s 4 = 5, s 3 = x 2 = x 3 =. The procedure from going to one bfs to a better adjacent bfs is called an iteration (or sometime pivot) of the simplex algorithm. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 6

117 The Simplex Algorithm (max LPs) Returning to Step 3, we attempt to determine if the current bfs is optimal. Rearranging row from Canonical Form, and solving for a yields: z = 24 5x 2 +5x 3-3s 3 The current bfs is NOT optimal because increasing x 3 to (while holding the other nonbasic variable to zero) will increase the value of z. Making either x 2 or s 3 basic will caused the value of z to decrease. Step 4 - Recall the rule for determining the entering variable is the row coefficient with the greatest negative value. Since x 3 is the only variable with a negative coefficient, x 3 should be entered into the basis. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 7

118 The Simplex Algorithm (max LPs) Begin iteration (pivot) 2 Performing the ratio test using x 3 as the entering variable yields the following results (holding other NBVs to zero): From row, s for all values of x 3 since s = 6 + x 3 From row 2, s 2 if x 3 > 4 /.5 = 8 From row 3, x if x 3 >4 /.25 = 6 From row 4, s 4 for all values of x 3 since s 4 = 5 This means to keep all the basic variables nonnegative, the largest we can make x is min {8,6} = 8. So, row 2 becomes the pivot row. Step 5 - Now use ero s, to make x 3 a basic variable in row 2. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 8

119 The Simplex Algorithm (max LPs) ero z x x2 x3 s s2 s3 s4 rhs multiplied row 2 by ero 2 z x x2 x3 s s2 s3 s4 rhs 5 28 add 5 times row 2 to row ero 3 z x x2 x3 s s2 s3 s4 rhs add row 2 to row ero 4 z x x2 x3 s s2 s3 s4 rhs add -/4 times row 2 to row Métodos Cuantitativos M. En C. Eduardo Bustos Farías 9

120 The Simplex Algorithm (max LPs) The result is: Canonical Form 2 Basic Variable Row z + 5x 2 + s 2 + s 3 = 28 z = 28 Row - 2x 2 + s + 2s 2-8s 3 = 24 s = 24 Row 2-2x 2 + x 3 + 2s 2-4s 3 = 8 x 3 = 8 Row 3 x +.25x s 2 +.5s 3 = 2 x = 2 Row 4 x 2 + s 4 = 5 s 4 = 5 In Canonical Form 2, BV = {z, s, x 3, x, s 4 } and NBV = {s 3, s 2, x 2 }, yielding the bfs z = 28, s = 24, x 3 = 8, x = 2, s 4 = 5, s 2 = s 3 = x 2 =. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 2

121 The Simplex Algorithm (max LPs) Solving for z in row yields: Z = 28-5x 2 - s 2 -s 3 We can see that increasing x2, s2, or s3 (while holding the other NBVs to zero) will not cause the value of z to decrease. The solution at the end of iteration 2 is therefore optimal. The following rule can be applied to determine whether a canonical form s bfs is optimal: A canonical form is optimal (for a max problem) if each nonbasic variable has a nonnegative coefficient in the canonical form s row. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 2

122 The Simplex Algorithm (min LPs) Two different ways the simplex method can be used to solve minimization problems. Consider the LP shown to the right: Method The optimal solution is the point (x,x 2 ) that makes z = 2x 3x 2 the smallest. Equivalently, this point makes max -z = - 2x + 3x 2 the largest. This means we can find the optimal solution to the LP by solving the LP shown to the right. min z = 2x 3x 2 s.t. x + x 2 4 x x 2 6 x, x 2 max -z = -2x + 3x 2 s.t. x + x 2 4 x x 2 6 x, x 2 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 22

123 The Simplex Algorithm (min LPs) In solving this modified LP, use z as the basic variable in row. After adding slack variables s and s2 to the constraints we obtain the initial tableau. Initial Tableau Row - z x x2 s s2 rhs BVs z = 4 s =4 2-6 s2 = 6 ero - z x x2 s s2 rhs ero 2 - z x x2 s s2 rhs BVs z = 2 4 x2 = s2 = Métodos Cuantitativos M. En C. Eduardo Bustos Farías 23

124 The Simplex Algorithm (min LPs) The optimal solution (to the max problem) is -z = 2, x 2 = 4, s 2 =, x = s =. Then the optimal solution to the min problem is z = -2, x 2 =4, s 2 =, x = s 2 =. The min LP objective function confirms this: z = 2x -3x 2 =2() 3 (4) = -2. In summary, multiply the objective function for the min problem by - and solve the problem as a maximization problem with the objective function z. The optimal solution to the max problem will give you the optimal solution for to the min problem. Remember that (optimal z-value for the min problem) = - (optimal z-value for the max problem). Métodos Cuantitativos M. En C. Eduardo Bustos Farías 24

125 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 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 as the entering variable. This modification of the simplex algorithm works because increasing a nonbasic variable (NBV) with a positive coefficient in row will decrease z. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 25

126 Alternate Optimal solutions For some LPs, more than one extreme point is optimal. If an LP has more than one optimal solution, it has multiple optimal solutions. If there is no nonbasic variable (NBV) with a zero coefficient in row of the optimal tableau, the LP has a unique optimal solution. Even if there is a nonbasic variable with a zero coefficient in row of the optimal tableau, it is possible that the LP may not have alternative optimal solutions. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 26

127 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. When this occurs, we say the LP is unbounded. An unbounded LP occurs in a max problem if there is a nonbasic variable with a negative coefficient in row 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 has a non positive coefficient in each constraint Métodos Cuantitativos M. En C. Eduardo Bustos Farías 27

128 The LINDO Computer Package LINDO (Linear Interactive and Discrete Optimizer) is a user friendly computer package that can be used to solve linear, integer, and quadratic programming problems. The Dakota Furniture LP will solved using LINDO as an example. LINDO permits the user to name the variables so they are defined: DESKS = number of desk produced TABLES = number of tables produced CHAIRS = number of chairs produced LINDO assumes all variables are nonnegative, so nonnegative constraints are not necessary. To be consistent with LINDO, the objective function row is labeled row and constraints rows 2-5. View the LINDO Help file for syntax questions Métodos Cuantitativos M. En C. Eduardo Bustos Farías 28

129 The LINDO Computer Package To enter this problem into LINDO make sure the screen contains a blank window (work area) with the word untitled at the top of the work area. If necessary, a new window can be opened by selecting New from the file menu or by clicking on the File button. The first statement in a LINDO model is always the objective function. MAX or MIN directs LINDO to solve a maximization or minimization problem. Enter the constraints by typing SUBJECT TO (or st) on the next line. Then enter the constraints. LINDO assumes the < symbol means and the > symbol means. There is no need to insert the asterisk symbol between coefficients and variables to indicate multiplication. The Dakota input is shown on the next slide Métodos Cuantitativos M. En C. Eduardo Bustos Farías 29

130 The LINDO Computer Package Métodos Cuantitativos M. En C. Eduardo Bustos Farías 3

131 The LINDO Computer Package To save the file (LP formulation) for future use, select SAVE from the File menu and when asked, replace the * symbol with the name of your choice. The file will be saved with the name you select with the suffix.ltx. DO NOT type over the.ltx suffix. Save using any path available. To solve the model, from the Solve menu select the SOLVE command or click the red bulls eye button. When asked if you want to do a range (sensitivity) analysis, choose no. Range or sensitivity analysis will be discussed in Chapter 6. when the solution is complete, a display showing the status of the Solve command will be present. View the displayed information and select CLOSE. The data input window will now be overlaying the Reports Window. Click anywhere in the Reports Window to bring it to the foreground. View the next slide to see this Reports Window. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 3

132 4.6 The LINDO Computer Package Métodos Cuantitativos M. En C. Eduardo Bustos Farías 32

133 The LINDO Computer Package The LINDO output shows: LINDO found the optimum solution after 2 iterations (pivots) The optimal z-value = 28 VALUE gives the value of the variable in the optimal LP solution. Thus the optimal solution calls for production of 2 desks, tables, and 8 chairs. SLACK OR SURPLUS gives (by constraint row) the value of slack or excess in the optimal solution. REDUCED COST gives the coefficient in row of the optimal tableau (in a max problem). The reduced cost of each basic variables must be. For NBVs, the reduced cost is the amount by which the optimal z-value will be reduced if the NBV is increased by unit (and all other NBVs remain ). The other LINDO outputs will be discussed in Chapters 5 and 6. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 33

134 The Big M Method The simplex method algorithm requires a starting bfs. 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 may not be readily apparent. In such a case, the Big M method may be used to solve the problem. Consider the problem below. Bevco manufactures an orange-flavored soft drink called Oranj by combining orange soda and orange juice. Each orange soda contains.5 oz of sugar and mg of vitamin C. Each ounce of orange juice contains.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 - oz bottle of Oranj must contain at least 3 mg of vitamin C and at most 4 oz of sugar. Use linear programming to determine how Bevco can meet the marketing department s requirements at minimum cost. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 34

135 The Big M Method Letting x = 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 = 2x + 3x 2 st.5x +.25x 2 4 (sugar constraint) x + 3x 2 2 x + x 2 = x, x 2, > (Vitamin C constraint) ( oz in bottle of Oranj) The LP in standard form is shown on the next slide. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 35

136 The Big M Method The LP in standard form has z and s which could be used for BVs but row 2 would violate sign restrictions and row 3 no readily apparent basic variable. Row : z - 2x - 3x 2 = Row 2:.5x +.25x 2 + s = 4 Row 3: x + 3x 2 -e 2 = 2 Row 4: x + x 2 = In order to use the simplex method, a bfs is needed. To remedy the predicament, artificial variables are created. The variables will be labeled according to the row in which they are used as seen below. Row : z - 2x - 3x 2 = Row 2:.5x +.25x 2 + s = 4 Row 3: x + 3x 2 -e 2 + a 2 = 2 Row 4: x + x 2 + a 3 = Métodos Cuantitativos M. En C. Eduardo Bustos Farías 36

137 The Big M Method In the optimal solution, all artificial variables must be set equal to zero. To accomplish this, in 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. The modified Bevco LP in standard form then becomes: Row : z - 2x - 3x 2 -Ma 2 -Ma 3 = Row 2:.5x +.25x 2 + s = 4 Row 3: x + 3x 2 -e 2 + a 2 = 2 Row 4: x + x 2 + a 3 = 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 =. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 37

138 The Big M Method Description of the Big M Method. 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. 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 before beginning the simplex. Remembering M represents a very large number, solve the transformed problem by the simplex. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 38

139 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 Row z x x2 s e2 a2 a3 rhs M -M Métodos Cuantitativos M. En C. Eduardo Bustos Farías 39

140 The Big M Method Pivot z x x2 s e2 a2 a3 rhs ratio ero. 2m - 2 4M -3 -M 3M Row + M(Row 2) + M(Row 3) ero z x x2 s e2 a2 a3 rhs ero. 2m - 2 4M -3 -M 3M Row 2 divided by ero 2 z x x2 s e2 a2 a3 rhs ero. (2M-3)/3 (M-3)/3 (3-4M)/3 (6+M)/3 Row - (4M-3)*(Row 2) ero 3 z x x2 s e2 a2 a3 rhs ero. (2M-3)/3 (M-3)/3 (3-4M)/3 (6+M)/ Row -.25*(Row 2) ero 4 z x x2 s e2 a2 a3 rhs ero. (2M-3)/3 (M-3)/3 (3-4M)/3 (6+M)/ Row 3 - Row 2 Métodos Cuantitativos M. En C. Eduardo Bustos Farías 4

141 The Big M Method Pivot 2 z x x2 s e2 a2 a3 rhs ratio. (2M-3)/3 (M-3)/3 (3-4M)/3 (6+M)/ ero z x x2 s e2 a2 a3 rhs ero. (2M-3)/3 (M-3)/3 (3-4M)/3 (6+M)/ (Row 3)*(3/2) ero 2 z x x2 s e2 a2 a3 rhs ero. -.5 (-2M)/2 (3-2M)/2 25. Row + (3-2M)*(Row 3)/ ero 3 z x x2 s e2 a2 a3 rhs ero. -.5 (-2M)/2 (3-2M)/ Row - (5/2)*Row 3) ero 4 z x x2 s e2 a2 a3 rhs ero. -.5 (-2M)/2 (3-2M)/ Optimal Solution Row 2 -(/3)*Row Métodos Cuantitativos M. En C. Eduardo Bustos Farías 4

142 Literature books: George B. Dantzig, Mukund N. Thapa "Linear Programming I: Introduction" Springer Verlag Kim Marriott & Peter J. Stuckey "Programming with Constraints: An Introduction" MIT Press Métodos Cuantitativos M. En C. Eduardo Bustos Farías 42

Chapter 4 The Simplex Algorithm Part I

Chapter 4 The Simplex Algorithm Part I Chapter 4 The Simplex Algorithm Part I Based on Introduction to Mathematical Programming: Operations Research, Volume 1 4th edition, by Wayne L. Winston and Munirpallam Venkataramanan Lewis Ntaimo 1 Modeling

More information

The Simplex Algorithm and Goal Programming

The Simplex Algorithm and Goal Programming The Simplex Algorithm and Goal Programming In Chapter 3, we saw how to solve two-variable linear programming problems graphically. Unfortunately, most real-life LPs have many variables, so a method is

More information

The Simplex Algorithm

The Simplex Algorithm The Simplex Algorithm How to Convert an LP to Standard Form Before the simplex algorithm can be used to solve an LP, the LP must be converted into a problem where all the constraints are equations and

More information

Theory of Linear Programming

Theory of Linear Programming SCHOOL OF BUSINESS, ECONOMICS AND MANAGEMENT BF360 Operations Research Unit Two Theory of Linear Programming Moses Mwale e-mail: moses.mwale@ictar.ac.zm BF360 Operations Research Contents Unit 2: Theory

More information

IE 400 Principles of Engineering Management. The Simplex Algorithm-I: Set 3

IE 400 Principles of Engineering Management. The Simplex Algorithm-I: Set 3 IE 4 Principles of Engineering Management The Simple Algorithm-I: Set 3 So far, we have studied how to solve two-variable LP problems graphically. However, most real life problems have more than two variables!

More information

END3033 Operations Research I Sensitivity Analysis & Duality. to accompany Operations Research: Applications and Algorithms Fatih Cavdur

END3033 Operations Research I Sensitivity Analysis & Duality. to accompany Operations Research: Applications and Algorithms Fatih Cavdur END3033 Operations Research I Sensitivity Analysis & Duality to accompany Operations Research: Applications and Algorithms Fatih Cavdur Introduction Consider the following problem where x 1 and x 2 corresponds

More information

Linear Programming. Xi Chen. Department of Management Science and Engineering International Business School Beijing Foreign Studies University

Linear Programming. Xi Chen. Department of Management Science and Engineering International Business School Beijing Foreign Studies University Linear Programming Xi Chen Department of Management Science and Engineering International Business School Beijing Foreign Studies University Xi Chen (chenxi0109@bfsu.edu.cn) Linear Programming 1 / 148

More information

Linear Programming. Dr. Xiaosong DING

Linear Programming. Dr. Xiaosong DING Linear Programming Dr. Xiaosong DING Department of Management Science and Engineering International Business School Beijing Foreign Studies University Dr. DING (xiaosong.ding@hotmail.com) Linear Programming

More information

Sensitivity Analysis and Duality

Sensitivity Analysis and Duality Sensitivity Analysis and Duality Part II Duality Based on Chapter 6 Introduction to Mathematical Programming: Operations Research, Volume 1 4th edition, by Wayne L. Winston and Munirpallam Venkataramanan

More information

Chapter 3 Introduction to Linear Programming PART 1. Assoc. Prof. Dr. Arslan M. Örnek

Chapter 3 Introduction to Linear Programming PART 1. Assoc. Prof. Dr. Arslan M. Örnek Chapter 3 Introduction to Linear Programming PART 1 Assoc. Prof. Dr. Arslan M. Örnek http://homes.ieu.edu.tr/~aornek/ise203%20optimization%20i.htm 1 3.1 What Is a Linear Programming Problem? Linear Programming

More information

Yinyu Ye, MS&E, Stanford MS&E310 Lecture Note #06. The Simplex Method

Yinyu Ye, MS&E, Stanford MS&E310 Lecture Note #06. The Simplex Method The Simplex Method Yinyu Ye Department of Management Science and Engineering Stanford University Stanford, CA 94305, U.S.A. http://www.stanford.edu/ yyye (LY, Chapters 2.3-2.5, 3.1-3.4) 1 Geometry of Linear

More information

Section 4.1 Solving Systems of Linear Inequalities

Section 4.1 Solving Systems of Linear Inequalities Section 4.1 Solving Systems of Linear Inequalities Question 1 How do you graph a linear inequality? Question 2 How do you graph a system of linear inequalities? Question 1 How do you graph a linear inequality?

More information

The Simplex Method. Formulate Constrained Maximization or Minimization Problem. Convert to Standard Form. Convert to Canonical Form

The Simplex Method. Formulate Constrained Maximization or Minimization Problem. Convert to Standard Form. Convert to Canonical Form The Simplex Method 1 The Simplex Method Formulate Constrained Maximization or Minimization Problem Convert to Standard Form Convert to Canonical Form Set Up the Tableau and the Initial Basic Feasible Solution

More information

2. Linear Programming Problem

2. Linear Programming Problem . Linear Programming Problem. Introduction to Linear Programming Problem (LPP). When to apply LPP or Requirement for a LPP.3 General form of LPP. Assumptions in LPP. Applications of Linear Programming.6

More information

Ω R n is called the constraint set or feasible set. x 1

Ω R n is called the constraint set or feasible set. x 1 1 Chapter 5 Linear Programming (LP) General constrained optimization problem: minimize subject to f(x) x Ω Ω R n is called the constraint set or feasible set. any point x Ω is called a feasible point We

More information

MAT016: Optimization

MAT016: Optimization MAT016: Optimization M.El Ghami e-mail: melghami@ii.uib.no URL: http://www.ii.uib.no/ melghami/ March 29, 2011 Outline for today The Simplex method in matrix notation Managing a production facility The

More information

OPERATIONS RESEARCH. Michał Kulej. Business Information Systems

OPERATIONS RESEARCH. Michał Kulej. Business Information Systems OPERATIONS RESEARCH Michał Kulej Business Information Systems The development of the potential and academic programmes of Wrocław University of Technology Project co-financed by European Union within European

More information

The use of shadow price is an example of sensitivity analysis. Duality theory can be applied to do other kind of sensitivity analysis:

The use of shadow price is an example of sensitivity analysis. Duality theory can be applied to do other kind of sensitivity analysis: Sensitivity analysis The use of shadow price is an example of sensitivity analysis. Duality theory can be applied to do other kind of sensitivity analysis: Changing the coefficient of a nonbasic variable

More information

Dr. S. Bourazza Math-473 Jazan University Department of Mathematics

Dr. S. Bourazza Math-473 Jazan University Department of Mathematics Dr. Said Bourazza Department of Mathematics Jazan University 1 P a g e Contents: Chapter 0: Modelization 3 Chapter1: Graphical Methods 7 Chapter2: Simplex method 13 Chapter3: Duality 36 Chapter4: Transportation

More information

Chapter 2 Introduction to Optimization & Linear Programming

Chapter 2 Introduction to Optimization & Linear Programming Chapter 2 - Introduction to Optimization & Linear Programming : S-1 Spreadsheet Modeling and Decision Analysis A Practical Introduction to Business Analytics 8th Edition Ragsdale SOLUTIONS MANUAL Full

More information

Linear Programming. H. R. Alvarez A., Ph. D. 1

Linear Programming. H. R. Alvarez A., Ph. D. 1 Linear Programming H. R. Alvarez A., Ph. D. 1 Introduction It is a mathematical technique that allows the selection of the best course of action defining a program of feasible actions. The objective of

More information

Introduction. Very efficient solution procedure: simplex method.

Introduction. Very efficient solution procedure: simplex method. LINEAR PROGRAMMING Introduction Development of linear programming was among the most important scientific advances of mid 20th cent. Most common type of applications: allocate limited resources to competing

More information

The Simplex Method of Linear Programming

The Simplex Method of Linear Programming The Simplex Method of Linear Programming Online Tutorial 3 Tutorial Outline CONVERTING THE CONSTRAINTS TO EQUATIONS SETTING UP THE FIRST SIMPLEX TABLEAU SIMPLEX SOLUTION PROCEDURES SUMMARY OF SIMPLEX STEPS

More information

Prelude to the Simplex Algorithm. The Algebraic Approach The search for extreme point solutions.

Prelude to the Simplex Algorithm. The Algebraic Approach The search for extreme point solutions. Prelude to the Simplex Algorithm The Algebraic Approach The search for extreme point solutions. 1 Linear Programming-1 x 2 12 8 (4,8) Max z = 6x 1 + 4x 2 Subj. to: x 1 + x 2

More information

SEN301 OPERATIONS RESEARCH I LECTURE NOTES

SEN301 OPERATIONS RESEARCH I LECTURE NOTES SEN30 OPERATIONS RESEARCH I LECTURE NOTES SECTION II (208-209) Y. İlker Topcu, Ph.D. & Özgür Kabak, Ph.D. Acknowledgements: We would like to acknowledge Prof. W.L. Winston's "Operations Research: Applications

More information

Chapter 5 Linear Programming (LP)

Chapter 5 Linear Programming (LP) Chapter 5 Linear Programming (LP) General constrained optimization problem: minimize f(x) subject to x R n is called the constraint set or feasible set. any point x is called a feasible point We consider

More information

IE 400: Principles of Engineering Management. Simplex Method Continued

IE 400: Principles of Engineering Management. Simplex Method Continued IE 400: Principles of Engineering Management Simplex Method Continued 1 Agenda Simplex for min problems Alternative optimal solutions Unboundedness Degeneracy Big M method Two phase method 2 Simplex for

More information

In Chapters 3 and 4 we introduced linear programming

In Chapters 3 and 4 we introduced linear programming SUPPLEMENT The Simplex Method CD3 In Chapters 3 and 4 we introduced linear programming and showed how models with two variables can be solved graphically. We relied on computer programs (WINQSB, Excel,

More information

Linear programming I João Carlos Lourenço

Linear programming I João Carlos Lourenço Decision Support Models Linear programming I João Carlos Lourenço joao.lourenco@ist.utl.pt Academic year 2012/2013 Readings: Hillier, F.S., Lieberman, G.J., 2010. Introduction to Operations Research, 9th

More information

9.5 THE SIMPLEX METHOD: MIXED CONSTRAINTS

9.5 THE SIMPLEX METHOD: MIXED CONSTRAINTS SECTION 9.5 THE SIMPLEX METHOD: MIXED CONSTRAINTS 557 9.5 THE SIMPLEX METHOD: MIXED CONSTRAINTS In Sections 9. and 9., you looked at linear programming problems that occurred in standard form. The constraints

More information

Week 3: Simplex Method I

Week 3: Simplex Method I Week 3: Simplex Method I 1 1. Introduction The simplex method computations are particularly tedious and repetitive. It attempts to move from one corner point of the solution space to a better corner point

More information

Study Unit 3 : Linear algebra

Study Unit 3 : Linear algebra 1 Study Unit 3 : Linear algebra Chapter 3 : Sections 3.1, 3.2.1, 3.2.5, 3.3 Study guide C.2, C.3 and C.4 Chapter 9 : Section 9.1 1. Two equations in two unknowns Algebraically Method 1: Elimination Step

More information

Review Questions, Final Exam

Review Questions, Final Exam Review Questions, Final Exam A few general questions 1. What does the Representation Theorem say (in linear programming)? 2. What is the Fundamental Theorem of Linear Programming? 3. What is the main idea

More information

Math Models of OR: Some Definitions

Math Models of OR: Some Definitions Math Models of OR: Some Definitions John E. Mitchell Department of Mathematical Sciences RPI, Troy, NY 12180 USA September 2018 Mitchell Some Definitions 1 / 20 Active constraints Outline 1 Active constraints

More information

CSC Design and Analysis of Algorithms. LP Shader Electronics Example

CSC Design and Analysis of Algorithms. LP Shader Electronics Example CSC 80- Design and Analysis of Algorithms Lecture (LP) LP Shader Electronics Example The Shader Electronics Company produces two products:.eclipse, a portable touchscreen digital player; it takes hours

More information

6.2: The Simplex Method: Maximization (with problem constraints of the form )

6.2: The Simplex Method: Maximization (with problem constraints of the form ) 6.2: The Simplex Method: Maximization (with problem constraints of the form ) 6.2.1 The graphical method works well for solving optimization problems with only two decision variables and relatively few

More information

4. Duality and Sensitivity

4. Duality and Sensitivity 4. Duality and Sensitivity For every instance of an LP, there is an associated LP known as the dual problem. The original problem is known as the primal problem. There are two de nitions of the dual pair

More information

Summary of the simplex method

Summary of the simplex method MVE165/MMG630, The simplex method; degeneracy; unbounded solutions; infeasibility; starting solutions; duality; interpretation Ann-Brith Strömberg 2012 03 16 Summary of the simplex method Optimality condition:

More information

Chapter 4 The Simplex Algorithm Part II

Chapter 4 The Simplex Algorithm Part II Chapter 4 The Simple Algorithm Part II Based on Introduction to Mathematical Programming: Operations Research, Volume 4th edition, by Wayne L Winston and Munirpallam Venkataramanan Lewis Ntaimo L Ntaimo

More information

Simplex Algorithm Using Canonical Tableaus

Simplex Algorithm Using Canonical Tableaus 41 Simplex Algorithm Using Canonical Tableaus Consider LP in standard form: Min z = cx + α subject to Ax = b where A m n has rank m and α is a constant In tableau form we record it as below Original Tableau

More information

Chap6 Duality Theory and Sensitivity Analysis

Chap6 Duality Theory and Sensitivity Analysis Chap6 Duality Theory and Sensitivity Analysis The rationale of duality theory Max 4x 1 + x 2 + 5x 3 + 3x 4 S.T. x 1 x 2 x 3 + 3x 4 1 5x 1 + x 2 + 3x 3 + 8x 4 55 x 1 + 2x 2 + 3x 3 5x 4 3 x 1 ~x 4 0 If we

More information

LP Definition and Introduction to Graphical Solution Active Learning Module 2

LP Definition and Introduction to Graphical Solution Active Learning Module 2 LP Definition and Introduction to Graphical Solution Active Learning Module 2 J. René Villalobos and Gary L. Hogg Arizona State University Paul M. Griffin Georgia Institute of Technology Background Material

More information

Introduction to Operations Research. Linear Programming

Introduction to Operations Research. Linear Programming Introduction to Operations Research Linear Programming Solving Optimization Problems Linear Problems Non-Linear Problems Combinatorial Problems Linear Problems Special form of mathematical programming

More information

Graphical and Computer Methods

Graphical and Computer Methods Chapter 7 Linear Programming Models: Graphical and Computer Methods Quantitative Analysis for Management, Tenth Edition, by Render, Stair, and Hanna 2008 Prentice-Hall, Inc. Introduction Many management

More information

F 1 F 2 Daily Requirement Cost N N N

F 1 F 2 Daily Requirement Cost N N N Chapter 5 DUALITY 5. The Dual Problems Every linear programming problem has associated with it another linear programming problem and that the two problems have such a close relationship that whenever

More information

56:171 Operations Research Midterm Exam - October 26, 1989 Instructor: D.L. Bricker

56:171 Operations Research Midterm Exam - October 26, 1989 Instructor: D.L. Bricker 56:171 Operations Research Midterm Exam - October 26, 1989 Instructor: D.L. Bricker Answer all of Part One and two (of the four) problems of Part Two Problem: 1 2 3 4 5 6 7 8 TOTAL Possible: 16 12 20 10

More information

Introduction to Operations Research

Introduction to Operations Research Introduction to Operations Research Linear Programming Solving Optimization Problems Linear Problems Non-Linear Problems Combinatorial Problems Linear Problems Special form of mathematical programming

More information

February 22, Introduction to the Simplex Algorithm

February 22, Introduction to the Simplex Algorithm 15.53 February 22, 27 Introduction to the Simplex Algorithm 1 Quotes for today Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime. -- Lao Tzu Give a man

More information

1. Introduce slack variables for each inequaility to make them equations and rewrite the objective function in the form ax by cz... + P = 0.

1. Introduce slack variables for each inequaility to make them equations and rewrite the objective function in the form ax by cz... + P = 0. 3.4 Simplex Method If a linear programming problem has more than 2 variables, solving graphically is not the way to go. Instead, we ll use a more methodical, numeric process called the Simplex Method.

More information

c) Place the Coefficients from all Equations into a Simplex Tableau, labeled above with variables indicating their respective columns

c) Place the Coefficients from all Equations into a Simplex Tableau, labeled above with variables indicating their respective columns BUILDING A SIMPLEX TABLEAU AND PROPER PIVOT SELECTION Maximize : 15x + 25y + 18 z s. t. 2x+ 3y+ 4z 60 4x+ 4y+ 2z 100 8x+ 5y 80 x 0, y 0, z 0 a) Build Equations out of each of the constraints above by introducing

More information

IE 5531: Engineering Optimization I

IE 5531: Engineering Optimization I IE 5531: Engineering Optimization I Lecture 5: The Simplex method, continued Prof. John Gunnar Carlsson September 22, 2010 Prof. John Gunnar Carlsson IE 5531: Engineering Optimization I September 22, 2010

More information

Review Solutions, Exam 2, Operations Research

Review Solutions, Exam 2, Operations Research Review Solutions, Exam 2, Operations Research 1. Prove the weak duality theorem: For any x feasible for the primal and y feasible for the dual, then... HINT: Consider the quantity y T Ax. SOLUTION: To

More information

OPTIMISATION 3: NOTES ON THE SIMPLEX ALGORITHM

OPTIMISATION 3: NOTES ON THE SIMPLEX ALGORITHM OPTIMISATION 3: NOTES ON THE SIMPLEX ALGORITHM Abstract These notes give a summary of the essential ideas and results It is not a complete account; see Winston Chapters 4, 5 and 6 The conventions and notation

More information

56:270 Final Exam - May

56:270  Final Exam - May @ @ 56:270 Linear Programming @ @ Final Exam - May 4, 1989 @ @ @ @ @ @ @ @ @ @ @ @ @ @ Select any 7 of the 9 problems below: (1.) ANALYSIS OF MPSX OUTPUT: Please refer to the attached materials on the

More information

Simplex Method for LP (II)

Simplex Method for LP (II) Simplex Method for LP (II) Xiaoxi Li Wuhan University Sept. 27, 2017 (week 4) Operations Research (Li, X.) Simplex Method for LP (II) Sept. 27, 2017 (week 4) 1 / 31 Organization of this lecture Contents:

More information

UNIT-4 Chapter6 Linear Programming

UNIT-4 Chapter6 Linear Programming UNIT-4 Chapter6 Linear Programming Linear Programming 6.1 Introduction Operations Research is a scientific approach to problem solving for executive management. It came into existence in England during

More information

The Dual Simplex Algorithm

The Dual Simplex Algorithm p. 1 The Dual Simplex Algorithm Primal optimal (dual feasible) and primal feasible (dual optimal) bases The dual simplex tableau, dual optimality and the dual pivot rules Classical applications of linear

More information

Introduction to LP. Types of Linear Programming. There are five common types of decisions in which LP may play a role

Introduction to LP. Types of Linear Programming. There are five common types of decisions in which LP may play a role Linear Programming RK Jana Lecture Outline Introduction to Linear Programming (LP) Historical Perspective Model Formulation Graphical Solution Method Simplex Method Introduction to LP Continued Today many

More information

Contents. 4.5 The(Primal)SimplexMethod NumericalExamplesoftheSimplexMethod

Contents. 4.5 The(Primal)SimplexMethod NumericalExamplesoftheSimplexMethod Contents 4 The Simplex Method for Solving LPs 149 4.1 Transformations to be Carried Out On an LP Model Before Applying the Simplex Method On It... 151 4.2 Definitions of Various Types of Basic Vectors

More information

1 Review Session. 1.1 Lecture 2

1 Review Session. 1.1 Lecture 2 1 Review Session Note: The following lists give an overview of the material that was covered in the lectures and sections. Your TF will go through these lists. If anything is unclear or you have questions

More information

TIM 206 Lecture 3: The Simplex Method

TIM 206 Lecture 3: The Simplex Method TIM 206 Lecture 3: The Simplex Method Kevin Ross. Scribe: Shane Brennan (2006) September 29, 2011 1 Basic Feasible Solutions Have equation Ax = b contain more columns (variables) than rows (constraints),

More information

Standard Form An LP is in standard form when: All variables are non-negativenegative All constraints are equalities Putting an LP formulation into sta

Standard Form An LP is in standard form when: All variables are non-negativenegative All constraints are equalities Putting an LP formulation into sta Chapter 4 Linear Programming: The Simplex Method An Overview of the Simplex Method Standard Form Tableau Form Setting Up the Initial Simplex Tableau Improving the Solution Calculating the Next Tableau

More information

Distributed Real-Time Control Systems. Lecture Distributed Control Linear Programming

Distributed Real-Time Control Systems. Lecture Distributed Control Linear Programming Distributed Real-Time Control Systems Lecture 13-14 Distributed Control Linear Programming 1 Linear Programs Optimize a linear function subject to a set of linear (affine) constraints. Many problems can

More information

LINEAR PROGRAMMING. Introduction

LINEAR PROGRAMMING. Introduction LINEAR PROGRAMMING Introduction Development of linear programming was among the most important scientific advances of mid-20th cent. Most common type of applications: allocate limited resources to competing

More information

9.1 Linear Programs in canonical form

9.1 Linear Programs in canonical form 9.1 Linear Programs in canonical form LP in standard form: max (LP) s.t. where b i R, i = 1,..., m z = j c jx j j a ijx j b i i = 1,..., m x j 0 j = 1,..., n But the Simplex method works only on systems

More information

Solutions to Review Questions, Exam 1

Solutions to Review Questions, Exam 1 Solutions to Review Questions, Exam. What are the four possible outcomes when solving a linear program? Hint: The first is that there is a unique solution to the LP. SOLUTION: No solution - The feasible

More information

The Simplex Method. Lecture 5 Standard and Canonical Forms and Setting up the Tableau. Lecture 5 Slide 1. FOMGT 353 Introduction to Management Science

The Simplex Method. Lecture 5 Standard and Canonical Forms and Setting up the Tableau. Lecture 5 Slide 1. FOMGT 353 Introduction to Management Science The Simplex Method Lecture 5 Standard and Canonical Forms and Setting up the Tableau Lecture 5 Slide 1 The Simplex Method Formulate Constrained Maximization or Minimization Problem Convert to Standard

More information

OPRE 6201 : 3. Special Cases

OPRE 6201 : 3. Special Cases OPRE 6201 : 3. Special Cases 1 Initialization: The Big-M Formulation Consider the linear program: Minimize 4x 1 +x 2 3x 1 +x 2 = 3 (1) 4x 1 +3x 2 6 (2) x 1 +2x 2 3 (3) x 1, x 2 0. Notice that there are

More information

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Math324 - Test Review 2 - Fall 206 MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Determine the vertex of the parabola. ) f(x) = x 2-0x + 33 ) (0,

More information

Part 1. The Review of Linear Programming

Part 1. The Review of Linear Programming In the name of God Part 1. The Review of Linear Programming 1.2. Spring 2010 Instructor: Dr. Masoud Yaghini Outline Introduction Basic Feasible Solutions Key to the Algebra of the The Simplex Algorithm

More information

"SYMMETRIC" PRIMAL-DUAL PAIR

SYMMETRIC PRIMAL-DUAL PAIR "SYMMETRIC" PRIMAL-DUAL PAIR PRIMAL Minimize cx DUAL Maximize y T b st Ax b st A T y c T x y Here c 1 n, x n 1, b m 1, A m n, y m 1, WITH THE PRIMAL IN STANDARD FORM... Minimize cx Maximize y T b st Ax

More information

Gauss-Jordan Elimination for Solving Linear Equations Example: 1. Solve the following equations: (3)

Gauss-Jordan Elimination for Solving Linear Equations Example: 1. Solve the following equations: (3) The Simple Method Gauss-Jordan Elimination for Solving Linear Equations Eample: Gauss-Jordan Elimination Solve the following equations: + + + + = 4 = = () () () - In the first step of the procedure, we

More information

Chapter 1: Linear Programming

Chapter 1: Linear Programming Chapter 1: Linear Programming Math 368 c Copyright 2013 R Clark Robinson May 22, 2013 Chapter 1: Linear Programming 1 Max and Min For f : D R n R, f (D) = {f (x) : x D } is set of attainable values of

More information

Lecture 4: Algebra, Geometry, and Complexity of the Simplex Method. Reading: Sections 2.6.4, 3.5,

Lecture 4: Algebra, Geometry, and Complexity of the Simplex Method. Reading: Sections 2.6.4, 3.5, Lecture 4: Algebra, Geometry, and Complexity of the Simplex Method Reading: Sections 2.6.4, 3.5, 10.2 10.5 1 Summary of the Phase I/Phase II Simplex Method We write a typical simplex tableau as z x 1 x

More information

Fundamental Theorems of Optimization

Fundamental Theorems of Optimization Fundamental Theorems of Optimization 1 Fundamental Theorems of Math Prog. Maximizing a concave function over a convex set. Maximizing a convex function over a closed bounded convex set. 2 Maximizing Concave

More information

OPERATIONS RESEARCH. Linear Programming Problem

OPERATIONS RESEARCH. Linear Programming Problem OPERATIONS RESEARCH Chapter 1 Linear Programming Problem Prof. Bibhas C. Giri Department of Mathematics Jadavpur University Kolkata, India Email: bcgiri.jumath@gmail.com MODULE - 2: Simplex Method for

More information

AM 121 Introduction to Optimization: Models and Methods Example Questions for Midterm 1

AM 121 Introduction to Optimization: Models and Methods Example Questions for Midterm 1 AM 121 Introduction to Optimization: Models and Methods Example Questions for Midterm 1 Prof. Yiling Chen Fall 2018 Here are some practice questions to help to prepare for the midterm. The midterm will

More information

Dr. Maddah ENMG 500 Engineering Management I 10/21/07

Dr. Maddah ENMG 500 Engineering Management I 10/21/07 Dr. Maddah ENMG 500 Engineering Management I 10/21/07 Computational Procedure of the Simplex Method The optimal solution of a general LP problem is obtained in the following steps: Step 1. Express the

More information

Simplex Method in different guises

Simplex Method in different guises Simplex Method in different guises The Furniture problem Max 0x + 0x 2 + 20x, subject to x 0, 8x + x 2 + 2x 48, 4x + 2x 2 +.x 20, 2x +.x 2 +.x 8. Canonical form: slack variables s = (s, s 2, s ) 0. Constraints

More information

42 Average risk. Profit = (8 5)x 1 é ù. + (14 10)x 3

42 Average risk. Profit = (8 5)x 1 é ù. + (14 10)x 3 CHAPTER 2 1. Let x 1 and x 2 be the output of P and V respectively. The LPP is: Maximise Z = 40x 1 + 30x 2 Profit Subject to 400x 1 + 350x 2 250,000 Steel 85x 1 + 50x 2 26,100 Lathe 55x 1 + 30x 2 43,500

More information

Duality in LPP Every LPP called the primal is associated with another LPP called dual. Either of the problems is primal with the other one as dual. The optimal solution of either problem reveals the information

More information

ECE 307 Techniques for Engineering Decisions

ECE 307 Techniques for Engineering Decisions ECE 7 Techniques for Engineering Decisions Introduction to the Simple Algorithm George Gross Department of Electrical and Computer Engineering University of Illinois at Urbana-Champaign ECE 7 5 9 George

More information

Algebraic Simplex Active Learning Module 4

Algebraic Simplex Active Learning Module 4 Algebraic Simplex Active Learning Module 4 J. René Villalobos and Gary L. Hogg Arizona State University Paul M. Griffin Georgia Institute of Technology Time required for the module: 50 Min. Reading Most

More information

Math Homework 3: solutions. 1. Consider the region defined by the following constraints: x 1 + x 2 2 x 1 + 2x 2 6

Math Homework 3: solutions. 1. Consider the region defined by the following constraints: x 1 + x 2 2 x 1 + 2x 2 6 Math 7502 Homework 3: solutions 1. Consider the region defined by the following constraints: x 1 + x 2 2 x 1 + 2x 2 6 x 1, x 2 0. (i) Maximize 4x 1 + x 2 subject to the constraints above. (ii) Minimize

More information

AM 121: Intro to Optimization Models and Methods

AM 121: Intro to Optimization Models and Methods AM 121: Intro to Optimization Models and Methods Fall 2017 Lecture 2: Intro to LP, Linear algebra review. Yiling Chen SEAS Lecture 2: Lesson Plan What is an LP? Graphical and algebraic correspondence Problems

More information

MATH 445/545 Test 1 Spring 2016

MATH 445/545 Test 1 Spring 2016 MATH 445/545 Test Spring 06 Note the problems are separated into two sections a set for all students and an additional set for those taking the course at the 545 level. Please read and follow all of these

More information

Optimisation. 3/10/2010 Tibor Illés Optimisation

Optimisation. 3/10/2010 Tibor Illés Optimisation Optimisation Lectures 3 & 4: Linear Programming Problem Formulation Different forms of problems, elements of the simplex algorithm and sensitivity analysis Lecturer: Tibor Illés tibor.illes@strath.ac.uk

More information

4.4 The Simplex Method and the Standard Minimization Problem

4.4 The Simplex Method and the Standard Minimization Problem . The Simplex Method and the Standard Minimization Problem Question : What is a standard minimization problem? Question : How is the standard minimization problem related to the dual standard maximization

More information

Linear Programming in Matrix Form

Linear Programming in Matrix Form Linear Programming in Matrix Form Appendix B We first introduce matrix concepts in linear programming by developing a variation of the simplex method called the revised simplex method. This algorithm,

More information

Week_4: simplex method II

Week_4: simplex method II Week_4: simplex method II 1 1.introduction LPs in which all the constraints are ( ) with nonnegative right-hand sides offer a convenient all-slack starting basic feasible solution. Models involving (=)

More information

February 17, Simplex Method Continued

February 17, Simplex Method Continued 15.053 February 17, 2005 Simplex Method Continued 1 Today s Lecture Review of the simplex algorithm. Formalizing the approach Alternative Optimal Solutions Obtaining an initial bfs Is the simplex algorithm

More information

Simplex tableau CE 377K. April 2, 2015

Simplex tableau CE 377K. April 2, 2015 CE 377K April 2, 2015 Review Reduced costs Basic and nonbasic variables OUTLINE Review by example: simplex method demonstration Outline Example You own a small firm producing construction materials for

More information

MS-E2140. Lecture 1. (course book chapters )

MS-E2140. Lecture 1. (course book chapters ) Linear Programming MS-E2140 Motivations and background Lecture 1 (course book chapters 1.1-1.4) Linear programming problems and examples Problem manipulations and standard form problems Graphical representation

More information

Systems Analysis in Construction

Systems Analysis in Construction Systems Analysis in Construction CB312 Construction & Building Engineering Department- AASTMT by A h m e d E l h a k e e m & M o h a m e d S a i e d 3. Linear Programming Optimization Simplex Method 135

More information

Lecture 2: The Simplex method. 1. Repetition of the geometrical simplex method. 2. Linear programming problems on standard form.

Lecture 2: The Simplex method. 1. Repetition of the geometrical simplex method. 2. Linear programming problems on standard form. Lecture 2: The Simplex method. Repetition of the geometrical simplex method. 2. Linear programming problems on standard form. 3. The Simplex algorithm. 4. How to find an initial basic solution. Lecture

More information

Lesson 27 Linear Programming; The Simplex Method

Lesson 27 Linear Programming; The Simplex Method Lesson Linear Programming; The Simplex Method Math 0 April 9, 006 Setup A standard linear programming problem is to maximize the quantity c x + c x +... c n x n = c T x subject to constraints a x + a x

More information

The Simplex Method. Standard form (max) z c T x = 0 such that Ax = b.

The Simplex Method. Standard form (max) z c T x = 0 such that Ax = b. The Simplex Method Standard form (max) z c T x = 0 such that Ax = b. The Simplex Method Standard form (max) z c T x = 0 such that Ax = b. Build initial tableau. z c T 0 0 A b The Simplex Method Standard

More information

Lecture 5 Simplex Method. September 2, 2009

Lecture 5 Simplex Method. September 2, 2009 Simplex Method September 2, 2009 Outline: Lecture 5 Re-cap blind search Simplex method in steps Simplex tableau Operations Research Methods 1 Determining an optimal solution by exhaustive search Lecture

More information

Slack Variable. Max Z= 3x 1 + 4x 2 + 5X 3. Subject to: X 1 + X 2 + X x 1 + 4x 2 + X X 1 + X 2 + 4X 3 10 X 1 0, X 2 0, X 3 0

Slack Variable. Max Z= 3x 1 + 4x 2 + 5X 3. Subject to: X 1 + X 2 + X x 1 + 4x 2 + X X 1 + X 2 + 4X 3 10 X 1 0, X 2 0, X 3 0 Simplex Method Slack Variable Max Z= 3x 1 + 4x 2 + 5X 3 Subject to: X 1 + X 2 + X 3 20 3x 1 + 4x 2 + X 3 15 2X 1 + X 2 + 4X 3 10 X 1 0, X 2 0, X 3 0 Standard Form Max Z= 3x 1 +4x 2 +5X 3 + 0S 1 + 0S 2

More information

Understanding the Simplex algorithm. Standard Optimization Problems.

Understanding the Simplex algorithm. Standard Optimization Problems. Understanding the Simplex algorithm. Ma 162 Spring 2011 Ma 162 Spring 2011 February 28, 2011 Standard Optimization Problems. A standard maximization problem can be conveniently described in matrix form

More information