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 +0S 3 Subject to: X 1 + X 2 + X 3 +S 1 = 20 Slack Variables 3x 1 + 4x 2 + X 3 +S 2 = 15 2X 1 + X 2 +4X 3 +S 3 = 10 X 1 0, X 2 0, X 3 0 S 1 0, S 2 0, S 3 0
Surplus Variables Minimize Z = 2X +3Y +4V Subject to 5X + 2Y +4V 12000 4X + 5Y + 6Z 24000 3X + 5Y + 4V 18000 X 0, Y 0, V 0 Standard Form Minimize Z = 2X + 3Y + 4V + 0S 1 +0S 2 + 0S 3 Subject to: 5X + 2Y +4V - S 1 = 12000 4X + 5Y + 6Z -S 2 = 24000 3X + 5Y + 4V -S 3 = 18000 X 0, Y 0, V 0, S 1 0, S 2 0, S 3 0, (S j = Surplus variables)
Slack Variables and Surplus Variables Max Z = 2X +3Y +4V Subject to 5X + 2Y +4V 12000 4X + 5Y + 6Z 24000 3X + 5Y + 4V 18000 X 0, Y 0, V 0 Standard Form Max Z = 2X + 3Y + 4V + 0S 1 +0S 2 + 0S 3 Subject to: 5X + 2Y +4V - S 1 = 12000 4X + 5Y + 6Z +S 2 = 24000 3X + 5Y + 4V -S 3 = 18000 X 0, Y 0, V 0, S 1 0, S 2 0, S 3 0, (S 1, S 3 = Surplus variables and S 2 = Slack Variable)
Problem I Maximize Z = 2X +3Y +4V Subject to 5X + 2Y +4V 12000 4X + 5Y + 6V 24000 3X + 5Y + 4V 18000 X 0, Y 0, V 0 Standard Form Maximize Z = 2X +3Y +4V +0S 1 +0S 2 +0S 3 5X + 2Y + 4V + S 1 = 12000 4X + 5Y + 6V +S 2 = 24000 3X + 5Y + 4V +S 3 =18000 X 0, Y 0, V 0, S 1 0, S 2 0, S 3 0 (S j =Slack variables)
Initial Solution Basic variable Cj x y V s1 s2 s3 2 3 4 0 0 0 R.H.S S1 0 S2 0 S3 0 5 2 4 1 0 0 4 5 6 0 1 0 3 5 4 0 0 1 12000 24000 18000 Zj Cj-Zj 0 0 0 0 0 0 0 2 3 4 0 0 0
Basic variable Cj S1 0 Initial Solution x y V s1 s2 s3 2 3 4 0 0 0 5 2 4 1 0 0 Pivot element R.H.S. 12000 S2 0 4 5 6 0 1 0 24000 S3 0 Zj 3 5 4 0 0 1 0 0 0 0 0 0 18000 0 Cj-Zj 2 3 4 0 0 0 Pivot column Pivot row
First Iteration X Y V S1 S2 S3 RHS 2 3 4 0 0 0 V 4 S2 0 5/4 1/2 1 1/4 0 0-7/2 2 0-3/2 1 0 3000 6000 S3 0 Zj Cj-zj -2 3 0-1 0 1 6000 5 2 4 1 0 0 12000-3 1 0-1 0 0
Second iteration V 4 19/12 0 1 5/12 0-1/6 2000 S2 0 Y 3-13/6 0 0-5/6 1-2/3 2000-2/3 1 0-1/3 0 1/3 2000 Zj Cj-zj 13/3 3 4 2/3 0 1/3 14000-7/3 0 0-2/3 0-1/3
Results Optimal Solution X = 0 S 1 = 0 Y = 2000 S 2 = 2000 V= 2000 S 3 = 0 Optimum value for Objective Function = 14000
Minimization Problem
Minimize Z= 22X 1 +15X 2 +9X 3 Subject to: 4X 1 + X 2 +2X 3 1 6X 1 +5X 2 + X 3 1 X 1,X 2,X 3 0 Step 1: Convert the LP model into standard form by subtracting surplus variables from the left hand side.
Minimize Z= 22X 1 +15X 2 +9X 3 +0S 1 +0S 2 Subject to: 4X 1 + X 2 +2X 3 - S 1 =1 6X 1 +5X 2 + X 3 - S 2 =1 X 1,X 2,X 3, S 1,S 2 0 Suppose we let the surplus variable s be the basic variable for the above equations. With X 1,X 2,and X 3 initially nonbasic, X 1 =X 2 =X 3 =0 4(0) + (0) +2(0) - S 1 =1 S 1 = -1 Which would give us a negative basic variable violating the non negativity requirement S 1 0
To resolve this, introduce an artificial variable into the equation as follows. 4X 1 + X 2 +2X 3 - S 1 + a 1 =1 6X 1 +5X 2 + X 3 - S 2 + a 2 =1 Initially let artificial variables a 1 and a 2 be basic variables and X 1 =X 2 =X 3 =S 1 =S 2 =0 be non basic. So a 1 =1 and a 2 =1 in the initial Simplex table.
In order to ensure that the artificial variable is eventually driven to 0, we Penalize it b setting its coefficient in the objective function equal to a very negative number in the case of maximization; or to a very large positive number in the case of minimization. Let M denote a very large positive number, and use either M or +M as the objective function coefficient of an artificial variable.
Step 2: Establish an initial feasible solution and calculate Z j and C j - Z j values. Step 3: Is the current solution optimal? Rule: Examine the C j - Z j row. Maximization problem: If all the entries of C j - Z j row are less than or equal to 0, the current solution is optimal. Minimization problem: If all the entries of C j - Z j row are greater than or equal to 0, the current solution is optimal. If not, continue on to step 4.
Step 4: Determine the Pivot Column and Pivot Row. Determining Pivot column Maximization problem: The non basic variable that has the largest C j - Z j value is the entering variable. The column of the simplex table corresponding to the entering variable is called Pivot column. Minimization problem: Choose the non basic variable having the most negative C j - Z j value as the entering variable. Determining Pivot row To determine the leaving variable, first devide ech positive entry of the pivot column into the corresponding entry of the right-hand-side column. The row variable corresponding to the minimum atio is the leaving variable.
Step 5: The intersection o the pivot row and pivot column is the Pivot element. Do the process until you get the optimal feasible solution.
Minimize Z= 22X 1 +15X 2 +9X 3 Subject to: 4X 1 + X 2 +2X 3 1 6X 1 +5X 2 + X 3 1 X 1,X 2,X 3 0 Minimize Z= 22X 1 +15X 2 +9X 3 +0 S 1 +0 S 2 +Ma 1 +Ma 2 Subject to: 4X 1 + X 2 +2X 3 - S 1 + a 1 =1 6X 1 +5X 2 + X 3 - S 2 + a 2 =1 X 1,X 2,X 3, S 1,S 2, a 1, a 2 0
X 1 X 2 X 3 S 1 S 2 a 1 a 2 Basis C j 22 15 9 0 0 M M R.H.S. a 1 a 2 M M 4 1 2-1 0 1 0 6 5 1 0-1 0 1 1 1 Z j 10M 6M 3M -M -M M M C j - Z j 22-10M 15-6M 9-3M M M 0 0 2M a 1 M X 1 22 0-7/3 4/3-1 2/3 1 1 5/6 1/6 0-1/6 0 Z j 22 55/3-7/3M 11/3+4/3M -M -11/3+2/3M M C j - Z j 0-10/3+7/3M 16/3-4/3M M 11/3-2/3M 0 1/3 1/6 M/3+11 /3
Basis C j X 1 X 2 X 3 S 1 S 2 a 1 a 2 22 15 9 0 0 M M R.H.S. a 1 M X 1 22 0-7/3 4/3-1 2/3 1 1 5/6 1/6 0-1/6 0 Z j 22 55/3-7/3M 11/3+4/3M -M -11/3+2/3M M C j - Z j 0-10/3+7/3M 16/3-4/3M M 11/3-2/3M 0 1/3 1/6 M/3+11 /3 X 3 9 X 1 22 0-7/3 1-3/4 ½ 1 9/8 0 1/8-1/4 ¼ 1/8 Z j 22 9 9-4 -1 C j - Z j 0 6 0 4 1 5
Surplus Variable and Artificial Variable Max Z = 2X +3Y +4V Subject to 5X + 2Y +4V 12000 4X + 5Y + 6Z 24000 3X + 5Y + 4V 18000 X 0, Y 0, V 0 Standard Form Max Z = 2X + 3Y + 4V + 0S 1 +0S 2 + 0S 3 - Ma 1 - Ma 2 - Ma 3 Subject to: 5X + 2Y +4V - S 1 + a 1 = 12000 4X + 5Y + 6Z -S 2 + a 2 = 24000 3X + 5Y + 4V -S 3 + a 3 = 18000 X 0, Y 0, V 0, S 1 0, S 2 0, S 3 0, a 1 0, a 2 0, a 3 0 (S j = Surplus variables, a j = Artificial variables)
The Dual Linear Programming The number of variables of the dual equals the number of constraints of the Primal. The right-hand-side values of the primal become the coefficients of the objective function of the dual. The columns of the primal become the rows of the dual; the objective function coefficients of the primal become the right-hand-side values of the dual. The objective of maximizing is changed to minimizing.
The values of the dual variables equal the shadow prices of the primal. The shadow prices of the dual equal the values of the basic variables of the primal. Z for the dual equals to the Z for the primal.