advertisement

Operations Research Instructor: Mohamed Omar Handout : Simplex Method Math 187 Assumptions: The LP problem is of the form max z = cT x s.t. Ax = b x≥0 where A is an m × n matrix, n ≥ m, rank(A)=m. A feasible basis B is known. We denote the set {1, 2, . . . , n}\B by N . The Algorithm 1. Construct the feasible tableau for the basis B. This is of the form: z − X cj xj =v aij xj = bi j∈N xi + X i∈B j∈N 2. (Check optimality) If cj ≤ 0 for all j ∈ N , STOP. The basic solution determined by B is optimal. 3. (Choose an entering variable) Choose k ∈ N with ck > 0. 4. (Check unboundedness) If aik ≤ 0 for all i ∈ B, STOP. The problem is unbounded. 5. (Choose a leaving variable) Choose r ∈ B such that ark > 0 and br bi = min i∈B, aik >0 aik ark 6. (Pivot) Pivot on (r, k). That is, replace B by (B ∪ {k})\{r}. Return to STEP 1 with the new B. Example. Consider the linear programming problem max 2x1 + 3x2 s.t. 2x1 + x2 x1 + x2 − x1 + x2 x1 , x2 , + x3 = 10 + x4 x3 , x4 , 1 =6 + x5 =4 x5 ≥0 Observe that B = {3, 4, 5} is a basis with corresponding basic feasible solution x∗ = (0 0 10 6 4)T . The corresponding tableau is z − 2x1 2x1 − 3x2 + x2 x1 + x2 − x1 + x2 =0 = 10 + x3 + x4 =6 + x5 =4 Observe that c1 > 0, so x1 will enter the basis. To determine what leaves the basis, we compute b3 b4 10 6 , = min , = 5, min a31 a41 2 1 (recall this comes from the fact that if we x1 by t and leave the other non-basic increase t 0 ∗ variables 0, we have the solution x (t) = 10 − 2t which is feasible only for nonnegative 6−t 4+t values of t for which t ≤ 4). This means x3 leaves the basis. Our new basis is B = {1, 4, 5}. The corresponding tableau is Row z + Row 1 : 1 Row1 : 2 1 Row 2 − Row 1 : 2 1 Row 3 + Row 1 : 2 z x1 − 2x2 1 + x2 2 1 + x2 2 3 + x2 2 + x3 1 + x3 2 1 − x3 2 1 + x3 2 = 10 =5 + x4 =1 + x5 =9 Observe that c2 > 0, so x2 will enter the basis. To determine what leaves the basis, we compute 1 9 5 min , , = 2, 1/2 1/2 3/2 so x4 becomes nonbasic. Our new basis is then B = {1, 2, 5}. We need to compute the tableau for this basis. This is z + x1 + x2 − x3 + x3 + 4x4 − x4 = 14 =4 − x3 + 2x4 =2 + 2x3 − 3x4 2 x5 =6 Observe c3 > 0, so x3 will enter the basis. To determine what leaves the basis, we compute 4 6 min = 3, , 1 2 Thus x5 leaves the basis. The new basis is thus {1, 2, 3}. The corresponding tableau is 5 + x4 2 1 + x4 2 1 + x4 2 3 − x4 2 z + x1 + x2 + x3 1 + x5 2 1 − x5 2 1 + x5 2 1 + x5 2 = 17 =1 =5 =3 Since cj < 0 for every j ∈ N , we have that the basic feasible solution corresponding to the basis B = {1, 2, 3} gives an optimal solution to the linear program with optimal value 17. 3