Presentation is loading. Please wait.

Presentation is loading. Please wait.

8. Linear Programming (Simplex Method) Objectives: 1.Simplex Method- Standard Maximum problem 2. (i) Greedy Rule (ii) Ratio Test (iii) Pivot Operation.

Similar presentations


Presentation on theme: "8. Linear Programming (Simplex Method) Objectives: 1.Simplex Method- Standard Maximum problem 2. (i) Greedy Rule (ii) Ratio Test (iii) Pivot Operation."— Presentation transcript:

1 8. Linear Programming (Simplex Method) Objectives: 1.Simplex Method- Standard Maximum problem 2. (i) Greedy Rule (ii) Ratio Test (iii) Pivot Operation 3. Geometric interpretation Refs: B&Z 5.4.

2 Recall from last lecture that we saw that the number of basic solutions for small L.P. problems grows rapidly. Most of these solutions will not be feasible. The Simplex Method computes less than 2m (m= number of consraints) basic solutions and these will all be basic feasible solutions. So for a problem with 4 decision variables and 5 constraints there are 126 basic solutions, but the Simplex Method would compute less than 10.

3 The basic principle behind the Simplex Method is as follows: We treat the objective function as a constraint and P as a decision variable. We move from one feasible corner point to another, increasing the value of P as we go. We stop when there are no more such corner points; that is, we have the optimal solution. We will now return to the previous example and solve it using the Simplex Method.

4 max P = 4x 1 + 5x 2 subj to 2x 1 + 3x 2 ≤ 600 5x 1 + 2x 2 ≤ 1,200 x 1 ≥ 0 x 2 ≥ 0 Example 1 (revisited). To initiate the Simplex Method we first rewrite the inequalities as equalities by adding slack variables. So our constraints become: 2x 1 + 3x 2 + s 1 = 600 5x 1 + 2x 2 + s 2 = 1,200 x 1 ≥ 0x 2 ≥ 0s 1 ≥ 0s 2 ≥ 0

5 We also rewrite the objective function so that all variables are on the left and the constants are on the right: P - 4x 1 - 5x 2 = 0. **Remember we are treating P as a variable. Thus our new system is: 2x 1 + 3x 2 + s 1 = 600 5x 1 + 2x 2 + s 2 = 1, 200 - 4x 1 - 5x 2 + P = 0 Now we can start to set up a Simplex Tableau.

6 2x 1 + 3x 2 + s 1 = 600 5x 1 + 2x 2 + s 2 = 1, 200 - 4x 1 - 5x 2 + P = 0 Remember, if an optimal solution exists, it will be one of the basic solutions. Since we have 2 constraints and 4 variables, to find the basic solutions, we must set 2 variables at a time to zero. These variables are called non-basic variables, the other variables are called basic variables.

7 In the tableau we see that the columns corresponding to the B.V.’s have a particular structure - the entries are all zeroes except for a single “1” and each of these 1’s is in a different row. If we initially set x 1 = x 2 = 0 (non-basic) then s 1 = 600, s 2 = 1200 are basic variables. Now P = 0 is also a basic variable (it has value zero, we have not set it to zero).

8 This structure indicates that these variables are basic - we indicate this by writing the appropriate label in the left column in the same row as the 1. The value of that variable is given in the same row, in the RHS column. So our initial basic feasible solution is: s 1 = 600, s 2 = 1200, P = 0 (these are the basic variables) x 1 = x 2 = 0 (non-basic variables).

9 Since we are trying to maximize P we want to find a basic feasible solution which increases the value of P. This means we need to set a different pair of variables to zero. But which ones do we choose to ensure that we increase the value of P? If x 1 is increased from 0 and we leave x 2 = 0, the rate of increase is 4. If x 2 is increased from 0 and we leave x 1 = 0, the rate of increase is 5. P = 4x 1 + 5x 2 increasing either of x 1 or x 2 will increase P.

10 We would like our method to be efficient. So we always choose the variable which will increase P at the largest rate. This is called the Greedy Rule. It is a process which selects the new basic variable. How is this reflected in the Simplex tableau? The Greedy Rule chooses the most negative value in the bottom row of the tableau. Initial tableau So x 2 will enter the basis.

11 Set x 1 = 0 Example 2x 1 + 3x 2 + s 1 = 600 5x 1 + 2x 2 + s 2 = 1200 3x 2 + s 1 = 600 2x 2 + s 2 = 1200 As x 2 increases, the values of s 1 and s 2 will decrease according to s 1 = 600- 3x 2 s 2 = 1200 - 2 x 2. So to ensure s 1 ≥ 0 we need x 2 ≤ 200, and to ensure s 2 ≥ 0 we need x 2 ≤ 600. We now need to choose a basic variable to become non-basic (since we must have 2 non-basic variables at a time). We choose this variable by determining how much we can increase the new basic variable without causing any other basic variable to become negative.

12 The first constraint is the most restrictive and so we choose the variable s 1 to become non-basic. So if we increase x 2 to 200 we force s 1 to 0. This process is called the Ratio Test. It determines which basic variable leaves the basis. To satisfy both of these conditions, we must have x 2 ≤ 200. Initial tableau So x 2 will enter the basis. s 1 will leave the basis

13 When dealing with the Simplex tableau we perform the Ratio Test as follows: 1.Divide each entry in the RHS column by the corresponding entry in the column of the new basic variable (provided the entry is positive, otherwise ignore it). 2.Select the smallest ratio. 3. The basic variable associated with this row leaves the basis. 600/3=200 1200/2=600

14 Remember, for our initial tableau, the basic variables are s 1 and s 2. To choose the new basic variable, we apply the Greedy Rule which chooses the most negative value in the bottom row of the tableau. So x 2 will enter the basis. We now perform the ratio test to see which variable leaves the basis. 600/3=200 1200/2=600 s 1 will leave the basis

15 To update the Simplex tableau, we perform a Pivot Operation. We start with the entry in the column of the entering variable and the row of the exiting variable. 3 Step 1: Divide the entire row by the circled value, so that in the next tableau there is a “1” in this position.

16 Step 2: We use the updated pivot row and operation “C” to obtain zeroes above and below the pivot element. Note that we are using the updated Row 1. R 2 -2R 1 R 2 R 3 +5R 1 R 3 (partial initial tableau) 1 R 1 ÷3R1R1 (partial updated tableau)

17 What are our new basic variables? s2s2 x2x2 P x 2 = 200,s 2 = 800P=1000 We have now moved from one corner position to another and increased the value of P along the way. Our new non-basic variables are x 1 = s 1 = 0

18 Our next step is to check the bottom row for negative values. We are applying the Greedy Rule again. x 1 will enter the basis. Now we perform the ratio test: The smallest ratio is in Row 2. s 2 will leave the basis Row 1:Row 2:

19 The pivot entry is 11/3. We can now perform the Pivot Operation. Our new Row 2 will be our old Row 2 multiplied by 3/11. BVx 1 x 2 s 1 s 2 PRHS x 2 2 3 1 1 3 00200 s 2 11 3 0  2 3 10800 P  2 3 0 5 3 011000 We use the new Row 2 to obtain zeroes above and below the “1” in the x 1 column R 1 -2/3 R 2 R 1 R 3 +2/3 R 2 R 3

20 We have no further negative entries in the bottom row so we are finished. The variables x 1 and x 2 are basic variables. x 1 = 2400 11 x 2 = 600 11 P is also basic P= 12,600 11 And s 1 and s 2 are non- basic variables, so s 1 = s 2 =0.

21 You should now check your solution. P(2400/11, 600/11)= 4(2400/11) + 5 (600/11) = 12,600/11 2x 1 + 3x 2 = 2(2400/11)+3(600/11) =600 (≤ 600) 5x 1 + 2x 2 = 5(2400/11)+2(600/11) =1200 (≤ 1200) And clearly, x 1, x 2, s 1, s 2 ≥ 0 So the optimal solution is: (x 1, x 2, s 1, s 2 ) = (2400/11, 600/11,0,0) and P*=12,600/11.

22 You should now be able to complete Q’s 1(a), (b), (c) and (d) and Q 3 on Example Sheet 3 from the Orange Book.


Download ppt "8. Linear Programming (Simplex Method) Objectives: 1.Simplex Method- Standard Maximum problem 2. (i) Greedy Rule (ii) Ratio Test (iii) Pivot Operation."

Similar presentations


Ads by Google