Вы находитесь на странице: 1из 61

Simplex Method

When decision variables are more than 2, we always use Simplex Method Slack Variable: Variable added to a constraint to convert it to an equation (=). A slack variable represents unused resources A slack variable contributes nothing to the objective function value. Surplus Variable: Variable subtracted from a constraint to convert it to an equation (=). A surplus variable represents an excess above a constraint requirement level. Surplus variables contribute nothing to the calculated value of the objective function.

Cont.
Basic Solution(BS) : This solution is obtained by setting any n variables (among m+n variables) equal to zero and solving for remaining m variables, provided the determinant of the coefficients of these variables is nonzero. Such m variables are called basic variables and remaining n zero valued variables are called non basic variables. Basic Feasible Solution(BFS) : It is a basic solution which also satisfies the non negativity restrictions.

Cont..
BFS are of two types:
Degenerate BFS: If one or more basic variables are zero. Non-Degenerate BFS: All basic variables are non-zero.

Optimal BFS: BFS which optimizes the objective function.

Example
Max. Z = 13x1+11x2
Subject to constraints:

4x1+5x2 < 1500 5x1+3x2 < 1575 x1+2x2 < 420 x1, x2 > 0

Solution :
Step 1: Convert all the inequality constraints into equalities by the use of slack variables. Let S1, S2 , S3 be three slack variables. Introducing these slack variables into the inequality constraints and rewriting the objective function such that all variables are on the left-hand side of the equation. Model can rewritten as:

Z - 13x1 -11x2 = 0
Subject to constraints:

4x1+5x2 + S1 = 1500 5x1+3x2 +S2= 1575 x1+2x2 +S3 = 420 x1, x2, S1, S2, S3 > 0

Cont
Step II: Find the Initial BFS. One Feasible solution that satisfies all the constraints is: x1= 0, x2= 0, S1= 1500, S2= 1575, S3= 420 and Z=0. Now, S1, S2, S3 are Basic variables. Step III: Set up an initial table as:

Cont
Basic Variable Z S1 S2 S3 Coefficients of: Z 1 0 0 0 x1 -13 4 5 1 x2 -11 5 3 2 S1 0 1 0 0 S2 0 0 1 0 S3 0 0 0 1 0 1500 1575 420 375 315 420 Sol. Rati o

Step IV: a) Choose the most negative number from row Z row. Therefore, x1 is a entering variable. b) Calculate Ratio = Sol col. / x1 col. (x1 > 0) c) Choose minimum Ratio. That variable(i.e S2) is a departing variable.

Cont.
Step V: x1 becomes basic variable and S2 becomes non basic variable. New table is:
Basic Varia ble Z S1 x1 S3 Coefficients of: Z 1 0 0 0 x1 0 0 1 0 x2 -16/5 13/5 3/5 7/5 S1 0 1 0 0 S2 13/5 -4/5 1/5 -1/5 S3 0 0 0 1 4095 240 315 105 92.3 525 75 Sol. Ratio

Cont
Next Table is :
Coefficients of: Z 1 0 0 0 x1 0 0 1 0 x2 0 0 0 1 S1 0 1 0 0 S2 15/7 -3/7 2/7 -1/7 S3 16/7 -13/7 -3/7 5/7 4335 45 270 75 Sol.

Optimal Solution is : x1= 270, x2= 75, Z= 4335

Example
Max. Z = 3x1+5x2+4x3
Subject to constraints:

2x1+3x2 < 8 2x2+5x3 < 10 3x1+2x2+4x3 < 15 x1, x2, x3 > 0

Cont
Let S1, S2, S3 be the three slack variables. Modified form is:

Z - 3x1-5x2-4x3 =0 2x1+3x2 +S1= 8 2x2+5x3 +S2= 10 3x1+2x2+4x3+S3= 15 x1, x2, x3, S1, S2, S3 > 0 Initial BFS is : x1= 0, x2= 0, x3=0, S1= 8, S2= 10, S3= 15 and Z=0.

Cont
Basic Variable Z
Z S1 S2 S3 1 0 0 0

Coefficients of:
x1 -3 2 0 3 x2 -5 3 2 2 x3 -4 0 5 4 S1 0 1 0 0 S2 0 0 1 0 S3 0 0 0 1

Sol.

Ratio

0 8 10 15 8/3 5 15/2

Therefore, x2 is the entering variable and S1 is the departing variable.

Cont
Basic Variable Z
Z x2 S2 S3 1 0 0 0

Coefficients of:
x1 1/3 2/3 -4/3 5/3 x2 0 1 0 0 x3 -4 0 5 4 S1 5/3 1/3 S2 S3 0 0 0 0 0 1

Sol.

Ratio

40/3 8/3 14/3 29/3 14/15 29/12

-2/3 1 -2/3 0

Therefore, x3 is the entering variable and S2 is the departing variable.

Cont
Basic Variable Z
Z x2 x3 S3 1 0 0 0

Coefficients of:
x1 -11/15 2/3 -4/15 41/15 x2 0 1 0 0 x3 0 0 1 0 S1 S2 S3 0 0 0 1

Sol.

Ratio

17/15 4/5 1/3 0

256/15 8/3 14/15 89/15 4 89/41

-2/15 1/5 2/15 -4/5

Therefore, x1 is the entering variable and S3 is the departing variable.

Cont
Basic Variable Z
Z x2 x3 x1 1 0 0 0

Coefficients of:
x1 0 0 0 1 x2 0 1 0 0 x3 0 0 1 0 S1 45/41 15/41 -6/41 -2/41 S2 24/41 8/41 5/41 S3 11/41 -10/41 4/41

Sol.

765/41 50/41 62/41 89/41

-12/41 15/41

Optimal Solution is : x1= 89/41, x2= 50/41, x3=62/41, Z= 765/41

Example
Min.. Z = x1 - 3x2 + 2x3
Subject to constraints:

3x1 - x2 + 3x3 < 7 -2x1 + 4x2 < 12 -4x1 + 3x2 + 8x3 < 10 x1, x2, x3 > 0

Cont
Convert the problem into maximization problem

Max.. Z = -x1 + 3x2 - 2x3 where Z= -Z


Subject to constraints:

3x1 - x2 + 3x3 < 7


-2x1 + 4x2 < 12 -4x1 + 3x2 + 8x3 < 10 x1, x2, x3 > 0

Cont
Let S1, S2 and S3 be three slack variables. Modified form is: Z + x1 - 3x2 + 2x3 = 0 3x1 - x2 + 3x3 +S1 = 7 -2x1 + 4x2 + S2 = 12
-4x1 + 3x2 + 8x3 +S3 = 10 x1, x2, x3 > 0

Initial BFS is : x1= 0, x2= 0, x3=0, S1= 7, S2= 12, S3 = 10 and Z=0.

Cont
Basic Variable Z
Z S1 S2 S3 1 0 0 0

Coefficients of:
x1 1 3 -2 -4 x2 -3 -1 4 3 x3 2 3 0 8 S1 0 1 0 0 S2 0 0 1 0 S3 0 0 0 1

Sol.

Ratio

0 7 12 10 3 10/3

Therefore, x2 is the entering variable and S2 is the departing variable.

Cont
Basic Variable Z
Z S1 x2 S3 1 0 0 0

Coefficients of:
x1 -1/2 5/2 -1/2 -5/2 x2 0 0 1 0 x3 2 3 0 8 S1 0 1 0 0 S2 3/4 1/4 1/4 -3/4 S3 0 0 0 1

Sol.

Ratio

9 10 3 1 4 -

Therefore, x1 is the entering variable and S1 is the departing variable.

Cont
Basic Variable Z
Z x1 x2 S3 1 0 0 0

Coefficients of:
x1 0 1 0 0 x2 0 0 1 0 x3 13/5 6/5 3/5 11 S1 1/5 2/5 1/5 1 S2 8/10 1/10 3/10 -1/2 S3 0 0 0 1

Sol.

11 4 5 11

Optimal Solution is : x1= 4, x2= 5, x3= 0, Z = 11 Z = -11

Example
Max.. Z = 3x1 + 4x2
Subject to constraints:

x1 - x 2 < 1 -x1 + x2 < 2 x1, x2 > 0

Cont
Let S1 and S2 be two slack variables . Modified form is: Z -3x1 - 4x2 = 0

x1 - x2 +S1 = 1
-x1 + x2 +S2 = 2 x1, x2, S1, S2 > 0 Initial BFS is : x1= 0, x2= 0, S1= 1, S2= 2 and Z=0.

Cont
Basic Variable Z
Z S1 S2 1 0 0

Coefficients of:
x1 -3 1 -1 x2 -4 -1 1 S1 0 1 0 S2 0 0 1

Sol.

Ratio

0 1 2 2

Therefore, x2 is the entering variable and S2 is the departing variable.

Cont
Basic Variable Z
Z S1 x2 1 0 0

Coefficients of:
x1 -7 0 -1 x2 0 0 1 S1 0 1 0 S2 4 1 1

Sol.

Ratio

8 3 2 -

x1 is the entering variable, but as in x1 column every no. is less than equal to zero, ratio cannot be calculated. Therefore given problem is having a unbounded solution.

Introduction
LPP, in which constraints may also have > and = signs, we

introduce a new type of variable , called the artificial variable. These variables are fictitious and cannot have any physical meaning. Two Phase Simplex Method is used to solve a problem in which some artificial variables are involved. The solution is obtained in two phases.

Example
Min.. Z = 15/2 x1 - 3x2
Subject to constraints:

3x1 - x2 - x3 > 3 x1 - x2 + x3 > 2 x1, x2, x3 > 0

Cont
Convert the objective function into the maximization form

Max. Z = -15/2 x1 + 3x2 where Z= -Z


Subject to constraints:

3x1 - x2 - x3 > 3 x1 - x2 + x3 > 2 x1, x2, x3 > 0

Cont
Introduce surplus variables S1 and S2, and artificial variables a1 and a2
Modified form is :

Z + 15/2 x1 - 3x2 = 0
Subject to constraints:

3x1 - x2 - x3 S1 + a1 = 3

x1 - x2 + x3 S2 + a2 = 2
x1, x2, x3 , S1, S2, a1, a2 > 0

Cont
Phase I : Simplex method is applied to a specially constructed Auxiliary LPP leading to a final simplex table containing a BFS to the original problem. Step 1: Assign a cost 1 to each artificial variable and a cost 0 to all other variables in the objective function. Step 2: Construct the auxiliary LPP in which the new objective function Z* is to be maximized subject to the given set of constraints.

Cont
Auxiliary LPP is: Max. Z* = -a1 a2
Z* + a1 + a2 = 0
Subject to constraints:

3x1 - x2 - x3 S1 + a1 = 3 x1 - x2 + x3 S2 + a2 = 2 x1, x2, x3 , S1, S2, a1, a2 > 0 Initial solution is a1 = 3, a2 = 2 and Z* = 0

Cont
Step 3: Solve the auxiliary problem by simplex method until either of the following three possibilities arise: Max Z* < 0 and at least one artificial variable appear in the optimum basis at a positive level. In this case given problem does not have any feasible solution. Max Z* = 0 and at least one artificial variable appear in the optimum basis at a zero level. In this case proceed to Phase II. Max Z* = 0 and no artificial variable appear in the optimum basis. In this case also proceed to Phase II.

Cont
Basic Variable Z*
Z* a1 a2 1 0 0

Coefficients of:
x1 0 3 1 x2 0 -1 -1 x3 0 -1 1 S1 0 -1 0 S2 0 0 -1 a1 1 1 0 a2 1 0 1

Sol.

0 3 2

This table is not feasible as a1 and a2 has non zero coefficients in Z* row. Therefore next step is to make the table feasible.

Cont
Basic Variable Z*
Z* a1 a2 1 0 0

Coefficients of:
x1 -4 3 1 x2 2 -1 -1 x3 0 -1 1 S1 1 -1 0 S2 1 0 -1 a1 0 1 0 a2 0 0 1

Sol.

Ratio

-5 3 2 1 2

Therefore, x1 is the entering variable and a1 is the departing variable.

Cont
Basic Variable Z*
Z* x1 a2 1 0 0

Coefficients of:
x1 0 1 0 x2 2/3 x3 S1 S2 a2 1 0 0 0

Sol.

Ratio

-4/3 -1/3

-1 1 1 3/4

-1/3 -1/3 -1/3 -2/3 4/3 1/3

-1 1

Therefore, x3 is the entering variable and a2 is the departing variable.

Cont
Basic Variable Z*
Z* x1 x3 1 0 0

Coefficients of:
x1 0 1 0 x2 0 x3 0 S1 0 -1/4 1/4 S2 0 -1/4 -3/4

Sol.

0 5/4 3/4

-1/2 0 -1/2 1

As there is no variable to be entered in the basis, this table is optimum for Phase I. In this table Max. Z* = 0 and no artificial variable appears in the optimum basis, therefore we can proceed to Phase II.

Cont
Phase II: The artificial variables which are non basic at the end of Phase I are removed from the table and as well as from the objective function and constraints. Now assign the actual costs to the variables in the Objective function. That is, Simplex method is applied to the modified simplex table obtained at the Phase I.
Basic Variable Z
Z x1 x3 1 0 0

Coefficients of:
x1 15/2 1 0 x2 -3 -1/2 -1/2 x3 0 0 1 S1 0 -1/4 1/4 S2 0 -1/4 -3/4

Sol.

0 5/4 3/4

Again this table is not feasible as basic variable x1 has a non zero coefficient in Z row. So make the table feasible.

Cont
Basic Variable Z
Z x1 x3 1 0 0

Coefficients of:
x1 0 1 0 x2 3/4 -1/2 -1/2 x3 0 0 1 S1 S2

Sol.

15/8 15/8 -1/4 1/4 -1/4 -3/4

-75/8 5/4 3/4

Optimal Solution is : x1= 5/4, x2= 0, x3= 3/4, Z = -75/8 Z = 75/8

Example
Min.. Z = x1 - 2x2 3x3
Subject to constraints:

-2x1 + x2 + 3x3 = 2 2x1 + 3x2 + 4x3 = 1 x1, x2, x3 > 0

Cont
Phase I: Introducing artificial variables a1 and a2 Auxiliary LPP is:

Max. Z* = -a1 - a2

Z* + a1 + a2 = 0
Subject to constraints:

-2x1 + x2 + 3x3 + a1 = 2 2x1 + 3x2 + 4x3 + a2 = 1 x1, x2, x3 > 0

Cont
Basic Variable Z*
Z* a1 a2 1 0 0

Coefficients of:
x1 0 -2 2 x2 0 1 3 x3 0 3 4 a1 1 1 0 a2 1 0 1

Sol.

0 2 1

This table is not feasible as a1 and a2 has non zero coefficients in Z* row. Therefore next step is to make the table feasible.

Cont
Basic Variable Z*
Z* a1 a2 1 0 0

Coefficients of:
x1 0 -2 2 x2 -4 1 3 x3 -7 3 4 a1 0 1 0 a2 0 0 1

Sol.

Ratio

-3 2 1 2/3 1/4

Therefore, x3 is the entering variable and a2 is the departing variable.

Cont
Basic Variable Z*
Z* a1 x3 1 0 0

Coefficients of:
x1 7/4 -7/2 1/2 x2 5/4 x3 0 a1 0 1 0

Sol.

-5/4 5/4 1/4

-5/4 0 3/4 1

As there is no variable to be entered in the basis, therefore Phase I ends here. But one artificial variable is present in the basis and Z* < 0. Therefore we cannot proceed to Phase II. Given problem is having a non-feasible solution.

Example
Min.. Z = 4x1 + x2
Subject to constraints:

3x1 + x2 = 3 4x1 + 3x2 > 6 x1 +2x2 < 4 x1, x2 > 0

Cont
Phase I: Introducing artificial variable a1 and a2, surplus variable S1 and slack variable S2 Max. Z* = -a1 - a2 Auxiliary LPP is:

Z* + a1 + a2 = 0
Subject to constraints:

3x1 + x2 +a1 = 3 4x1 + 3x2 S1 + a2 = 6 x1 +2x2 +S2 = 4

x1, x2 > 0

Cont
Basic Coefficients of: Variable Z* x x2 S1 1
Z* a1 a2 S2 1 0 0 0 0 3 4 1 0 1 3 2 0 0 -1 0

Sol.
S2 0 0 0 1 a1 1 1 0 0 a2 1 0 1 0 0 3 6 4

This table is not feasible as a1 and a2 has non zero coefficients in Z* row. Therefore next step is to make the table feasible.

Cont
Basic Coefficients of: Variable Z* x x2 S1 1
Z* a1 a2 S2 1 0 0 0 -7 3 4 1 -4 1 3 2 1 0 -1 0

Sol.
S2 0 0 0 1 a1 0 1 0 0 a2 0 0 1 0 -9 3 6 4

Ratio

1 3/2 4

Therefore, x1 is the entering variable and a1 is the departing variable.

Cont
Basic Coefficients of: Variable Z* x x2 S1 1
Z* x1 a2 S2 1 0 0 0 0 1 0 0 -5/3 1 1/3 5/3 5/3 0 -1 0

Sol.
S2 0 0 0 1 a2 0 0 1 0 -2 1 2 3

Ratio

3 6/5 9/5

Therefore, x2 is the entering variable and a2 is the departing variable.

Cont
Basic Coefficients of: Variable Z* x x2 S1 1
Z* x1 x2 S2 1 0 0 0 0 1 0 0 0 0 1 0 0 1/5

Sol.
S2 0 0 0 3/5 6/5 1

-3/5 0 1 1

As there is no variable to be entered in the basis, this table is optimum for Phase I. In this table Max. Z* = 0 and no artificial variable appears in the optimum basis, therefore we can proceed to Phase II.

Cont
Phase II: Original Objective function is: Min.. Z = 4x1 + x2 Convert the objective function into the maximization form Max. Z = -4 x1 - x2 where Z= -Z Basic Coefficients of: Sol. Variable Z* x x S S
1 2 1 2

Z* x1 x2 S2

1 0 0 0

4 1 0 0

1 0 1 0

0 1/5

0 0

0 3/5 6/5 1

-3/5 0 1 1

Again this table is not feasible as basic variable x1 and x2 has a non zero coefficient in Z row. So make the table feasible.

Cont
Basic Coefficients of: Variable Z x x2 S1 1
Z x1 x2 S2 1 0 0 0 0 1 0 0 0 0 1 0

Sol.
S2 -18/5 3/5 6/5 1

Ratio

-1/5 0 1/5 0

3 1

-3/5 0 1 1

Therefore, S1 is the entering variable and S2 is the departing variable.

Cont
Basic Coefficients of: Variable Z x x2 S1 1
Z x1 x2 S2 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

Sol.
S2 1/5 -1/5 3/5 1 -17/5 2/5 9/5 1

Optimal Solution is : x1= 2/5, x2= 9/5, Z = -17/5 Z = 17/5

Introduction
At the stage of improving the solution during Simplex procedure, if a tie for the minimum ratio occurs at least one basic variable becomes equal to zero in the next iteration and the new solution is said to be Degenerate.

Example
Max.. Z = 3x1 + 9x2
Subject to constraints:

x1 + 4x2 < 8
x1 + 2x2 < 4 x1, x2 > 0

Cont
Let S1 and S2 be two slack variables. Modified form is:

Z - 3x1 - 9x2 = 0

x1 + 4x2 + S1 = 8
x1 + 2x2 +S2 = 4 x1, x2, S1, S2 > 0 Initial BFS is : x1= 0, x2= 0, S1= 8, S2= 4 and Z=0.

Cont
Basic Coefficients of: Variable Z x1 x2 S1
Z S1 S2 1 0 0 -3 1 1 -9 4 2 0 1 0

Sol.
S2 0 0 1 0 8 4

Ratio

2 2

In this table S1 and S2 tie for the leaving variable. So any one can be considered as leaving variable. Therefore, x2 is the entering variable and S1 is the departing variable.

Cont
Basic Coefficients of: Variable Z x1 x2 S1
Z x2 S2 1 0 0 -3/4 1/4 1/2 0 1 0 9/4 1/4

Sol.
S2 0 0 18 2 0

Ratio

8 0

-1/2 1

Therefore, x1 is the entering variable and S2 is the departing variable.

Cont
Basic Coefficients of: Variable Z x1 x2 S1
Z x2 1 0 0 0 0 1 3/2 1/2

Sol.
S2 3/2 -1/2 18 2

x1

-1

Optimal Solution is : x1= 0, x2= 2 Z = 18 It results in a Degenerate Basic Solution.

Вам также может понравиться