Chap 4
Chap 4
LINEAR
PROGRAMMING
Simplex Method
Objectives:
At the end of the chapter, the students should be able to:
69
SIMPLEX METHOD
Definition
The simplex method of solving linear programming problems is a set
of mathematical steps (with the use of tables) that provides a direct and
economical way of solving linear programming problems.
70
variables in the objective function by using, a very small number coefficient,
M, (the letter M means million), or 100 if the numerical coefficients found in
the constraints and objective function are all less than or equal to 10, let it
equal to – 1000 if the numerical coefficients are less than or equal to 100, let it
equal to – 10,000, if the numerical coefficients are less than or equal to 1000,
and so on.
Set up the initial tableau.
The number of rows = no. of constraints + 4
The number of columns = no. of decision variables + no. of slack/surplus
variables + no. of artificial variables + 4
Put the entries in the first three columns of the initial table.
Determine the second to the last row, Zj row, by summing up the product
of C1 by each of the coefficient in the constraints including the constant
terms. (The variable Z is commonly used for the objective variable).
7
1
Determine the last row, (C1 – Zj) row.
Set up the next tableau (iteration 1). The entries are the same as in the initial
table except for the column Q1 column.
Determine the optimum column, column with the most positive value (zero
is not included) in the C1- Z1 row of the initial table. Highlight this column.
The variable in this column is called the entering variable (variable which
contributes the most value to the objective function).
Determine the incoming row or pivotal row by choosing the smallest value
in the Q1, column. Highlight this row. The variable in this row, which is to
be replaced by the entering variable is called the leaving variable. This
variable creates the bottleneck to the optimal solution. In case that there
is no possible value to select in the Q1 column, then there will be no
pivotal row and the solution is final. If this case arises, the problem is said
to be unbounded.
Identify the pivot, intersection of the optimum column and the pivotal row
in iteration 1.
Make the value of pivot equal to one (1) by dividing all entries in the pivotal
row of iteration 1 (now the replacing row) by the pivot. Do this operation
from quantity column to the last column before the Q1 column. Replace
the entry in the solution column by the entering variable and quantity
column by the corresponding constant coefficient of the entering variable.
Compute the new entries for the remaining rows by reducing the optimum
column entries to zero (entries in the constraint rows only) by using
algebraic manipulations.
New row = row to be replaced – intersection of row with pivot x new pivot row
72
If the (C1 – Z1) has still positive entry, go back to step 4 and step 5 (for
iteration 3,4…).
The optimum or final solution is obtained if the entries in the (C1 – Z1) row are
all zeros or /and negative values. At this point, if the obtained Z value is negative
and one or more of the basic variables (found in the solution column) are
artificial, then the solution is said to be infeasible.
The following examples will illustrate how to write the objective function
and its constraints to a standard form.
1.) Since the inequalities involve less than, simply add slack variable.
For constraint 1, 2x + 3y ≤ 80, add S1. The subscript 1 indicates that the
slack variable is added to the left side of the 1st constraint.
2x + 3y + S1 = 80
3x + 4y + S1 = 100
The objective function should also contain the slack variables added in the
constraints. But since the slack variable has no contribution to the
objective function, its numerical coefficient must be zero. Thus the
objective function becomes
73
2.) Max Z=120x + 80y + 0S1 + 0S2 – MA2 – MA3
Subject to 2x + y + S1 = 12 ? Do you know how the
subscripts were used?
2x + 9y -S2+A2 = 36
2x + 3y + A3 = 24
74
Iteration 1:
i.) Determine the optimum column and the pivotal row, and then highlight then.
ii.) The intersection of these column and row is the pivot element
iii.) Determine the Q1 column.
60÷2=30
180 ÷ 10 = 18
Table 4.2
Cj 90 110 0 0 Q1
C1 Solution Quantity X Y S1 S2
0 S1 60 3 2 1 0 30
0 S2 180 3 10 0 1 18
Zj 0 0 0 0 0
Cj- Zj 90 110 0 0
Iteration 2:
i.) Pivotal row: Second constraint coefficient row.
Table 4.3
Cj 90 110 0 0 Q1
C1 Solution Quantity x y S1 S2
7
5
ii.) Remaining rows
The intersection with the optimum column should be zero. There are
several algebraic manipulations that can be used to make it zero, one is to
apply Formula 4.1.
2.) Z1 row
Z1 = C1(R21)+C2(R22)
Z1 = 0 (24) + 110 (18) = 1980 The Cj – Zj may be computed from the
0 (12/5) + 110 (3/10) = 33 table
0 (0) + 110 (1) = 110
0 (1) + 110 (0) =0
0 (-1/5) + 110 (1/10) = 1
Cj 90 110 0 0 Q1
C1 Solution Quantity x y S1 S2
0 S1 24 12/5 0 1 -1/5 R21
110 y 18 3/10 1 0 1/10 10 R22
Z1 1980 33 110 0 11 60
C1–Z1 57 0 0 -11
Cj 90 110 0 0 Q1
C1 Solution Quantity x y S1 S2
0 S1 24 12/5 0 1 -1/5 R21
110 y 18 3/10 1 0 1/10 10 R22
Zj 1980 33 110 0 11 60
Cj – Zj 57 0 0 -11
76
Solution for Q1:
24 ÷ 12/5 = 10
18 ÷ 3/10 = 60
Zj = 0 ( 5 ) – M ( 8 ) + 0 ( 10 ) = - 8M
0(1)–M920+0(1)=-2M
0(1)–M(1)+0(2)=-M
0(3)–M(1)+0(2)=-M
0(1)–M(0)+0(0)=0
0(0)–M(1)+0(0)=-M
0(0)–M(0)=0(1)=0
The solution is not yet final at this point since there is still positive entry in
the (Cj – Zj) row.
Iteration 3:
Pivot element this time is 12/5. Again it should be change to one (1), thus
multiply each entry in this row by 5/12 to make it one.
1.) For R22 the intersection with the optimum column should be equal to zero.
77
2.) Z1 row
Since the entries in the Cj-Zj are zeros and negative numbers, then the
last iteration gives the optimum solution. Thus optimum values of x = 10, y =
15,andZ = 2550.
New program:
Maximize Z = 25x + 30y + 20z + 0S1 – MA2 +
0S3 Subject to x + y + 3z + S1 = 5
2x + y + z + A2 = 8
Do you know how the slack and artificial variables were added?
x + 2y + 2z + S3 = 10
x, y, z, S1,S3,A2 ≥ 0
The initial tableau may be skipped since it has the same entries with
iteration 1 except for Cj column, Zj and Cj – Zj rows
7
8
Iteration 1
Below is the set of solutions for Zj row Solution for Q1
entries:
5÷1=5
Zj = 0(5)–M(8)+0(10)=-8M 8÷2=4
0(1)–M920+0(1)=-2M 10÷1=10
0(1)–M(1)+0(2)=-M
0(3)–M(1)+0(2)=-M
0(1)–M(0)+0(0)=0
0(0)–M(1)+0(0)=-M
0(0)–M(0)=0(1)=0 From the Cj – Zj row, the
most positive is ( 25 + 2M ),
thus the optimum column is the x row (highlighted). From the Q1 column, the
smallest number is 4, thus the pivotal row is A2 row or R12 row (highlighted).
Table 4.7
Cj 25 30 20 0 -M 0 Qj
C1 Solution Quantity X Y Z S1 A2 S3
0 S1 5 1 1 3 1 0 0 5
-M A2 8 2 1 1 0 1 0 4
0 S3 10 1 2 2 0 0 1 10 R11
Zj -8M -2M -M -M 0 -M 0 R12
Cj-Zj 25+2M 30+M 20+M 0 0 0 R13
*Do you know how the entering and leaving variables were determined?
Iteration 2
a.) Pivotal row (R12): Divide each entry by 2 to make pivot equal to one.
R22=R21÷2= 8÷2=4
2 ÷2=1 New pivot
1 ÷2=½
1÷2=½
0÷2=0
1÷2=½
0÷2=0
7
9
b.) Remaining rows
1.) Zj row
Zj = 0(1)+2594)+0(6)=100
0(0)+2591)+0(0)=25
0 (½)+25(½)+0(3/2)=25/2
0 (5/2)+25(½)+0(3/2)=25/2
0(1)+25(0)+0(0)=0
0 (-1/2)+25(½)+0(-1/2)=25/2
0(0)+25(0)+)(1)=0
Table 4.8
Cj 25 30 20 0 -M 0 Qj
C1 Solution Quantity X y Z S1 A2 S3
R21
0 S1 1 0 1/2 5/2 1 -1/2 0 2
25 x 4 1 1/2 1/2 0 1/2 0 8 R22
80
Iteration 3
2.) Zj row
Zj = 30 (2) +25(3) +0(3) =135
30(0) +25(1) +0(0) = 25
30(1) +25(0) +0(0) = 30
30(5) +25(-2)+0(-6)=100
30(2) +25(-1)+0(-3) = 35
30(-1)+25(1) +0(1) = -5
30(0) +25(0) +0(1) = 0
81
Table 4.9 (Final Tableau)
Cj 25 30 20 0 -M 0
C1 Solution Quantity x y Z S1 A2 S3
30 y 2 0 1 5 2 -1 0 R31
R32
25 x 3 1 0 -2 -1 1 0 R33
0 S3 3 0 0 -6 -3 1 1
Zj 135 25 30 100 35 5 0
Cj-Zj 0 0 -80 -35 -M+5 0
Since the entries in the Cj-Zj of the last table are zeros and negative numbers,
then the solution is optimum and Table 3.9 is the final tableau. Hence the
optimum values of x = 3, y = 2, z = 0 (the value is 0 if the variable is not in the
final tableau) and the optimum value of Z = 135.
82
Solve the following LPP:
New Program:
Max Z = 65x1 + 70x2 + 60x3
Subject to 2x1 + 3x2 + 4x3 ≤ 34 Subject to:
x1 + 5x2 + 2x3 ≤ 48
2x1 + 3x2 ≤ 20
x1, x2,x3 ≥ 0
Iteration 1:
Cj
C1 Solution Quantity X1 X2 X3
Zj
Cj-Zj
Iteration 2:
Cj
C1Solution Quantity X1 X2 X3
Zj
Cj-Zj
83
Sol’n for S1: Sol’n for S2: Sol’n for Qj: New sol’n for X3:
Iteration 3:
Cj
C1Solution Quantity X1 X2 X3
Zj
Cj-Zj
Final Tableau:
Cj
C1Solution Quantity X1 X2 X3
Zj
Cj-Zj
X1 = X2 = X3 = Max value of Z =
84
Sol’n for S2: Sol’n for X3:
New Program:
2. Max Z = 120x1 + 80x2
Subject to 2x1 +x2 ≤ 12 Subject to:
2x1 + 9x2 ≥ 36
2x1 + 3x2 = 24
x1, x2 ≥ 0
Iteration 1:
Cj
C1 Solution Quantity X1 X2
Zj
Cj-Zj
Iteration 2:
Cj
C1Solution Quantity X1 X2
Zj
Cj-Zj
85
Entering variable: Leaving variable:
Sol’n for S1: Sol’n for A3: Sol’n for Qj: New sol’n for X1:
Iteration 3:
Cj
C1Solution Quantity X1 X2
Zj
Cj-Zj
Sol’n for X2: Sol’n for A3: Sol’n for Qj: New sol’n for S2:
Final Tableau:
Cj
C1Solution Quantity X1 X2
Zj
Cj-Zj
86
X1 = x2 = Maximum value of Z =
New Program:
4. Max Z = 8x + 7y
5.
Subject to: x +y ≤ 10 Subject to:
x+y≥2
x≤5
y≤6
x, y ≥ 0
Iteration 1:
Cj
C1 Solution Quantity X Y
Zj
Cj-Zj
87
Iteration 2:
Cj
C1Solution Quantity X y
Zj
Cj-Zj
Sol’n for S1: Sol’n for A3: Sol’n for Qj: New sol’n for S2:
Iteration 3:
Cj
C1 Solution Quantity x y
Zj
Cj-Zj
88
Sol’n for S1: Sol’n for x: Sol’n for Qj: New sol’n for y:
Final Tableau:
Cj
C1 Solution QuantityX Y
Zj
Cj-Zj
89
4.2 Simplex Minimization
Steps in Solving Minimization Problems
The steps in solving minimization problems by simplex method are the same as in
maximization except for steps 2, 4, 1, 6 and 7.
2. Follow the following rules in converting the LP model to standard form:
Symbol in the constraint To put into Standard Form
≤ Add a slack variable ( S1 ).
If the Cj – Zj has still negative entry, go back to step 4 and step 5 ( for iteration 3,4….)
The optimum or final solution is obtained if the entries in the Cj – Zj row are all zero or positive
values.
Examples : Write the following LP models to standard form
New Program
Minimize Z = 6x + 4y Minimize Z = 6x + 4y + MA1 + 0S2 + 0S3 + MA3
Subject to x + 2y = 10 Subject to x + 2y +A1 = 10
y≤4 y + S2 =4
3x + 2y ≥ 18 3x + 2y -S3+A3 =18
x,y ≥ 0 x, y, S2, A1, A3 ≥ 0
Iteration 1:
Cj 6 4 M 0 0 M Q1
C1 Solution Quantity x y A1 S2 S3 A3
M A1 10 1 2 1 0 0 0 5 R11
R12
0 S2 4 0 1 0 1 0 0 4 R13
M A3 18 3 2 0 0 -1 1 9
Zj 28M 4M 4M M 0 -M M
Cj-Zj 6-4M 4-4M 0 0 M 0
90
Entering variable _______y_____ Leaving variable ____S 2___________
Solution for iteration 1:
Zj = M(10)+0(4)+M(18)=28 Zj = M(0)+0(1)+M(0)=0
M M(0)+0(0)+M(-1)=-M
M(1)+0(0)+M(3)=4M M(0)+0(0)+M(1)=M
M(2)+0(1)+M(2)=4M
M(1)+0(0)+M(0)=M
Iteration 2:
Cj 6 4 M 0 0 M Q1
C1 Solution Quantity x y A1 S2 S3 A3
R21
M A1 2 1 0 1 -2 0 0 2
R22
4 Y 4 0 1 0 1 0 0 R23
M A3 10 3 0 0 -2 -1 1 3.33
Zj 16+12M 4M 4 M 4-4M -M M
Cj-Zj 6-4M 0 0 -4 M 0
+4M
Pivotal row: The pivotal row R12 – R22, since pivot is already equal to one.
Remaining rows:
Zj = M(2)+4(4)+M(10)=16 Zj = M(2)+4(1)+M(-2)=4–4M
+12 M M(0)+4(0)+M(-1)=-M
M(1)+4(0)+M(3)=4M M(0)+4(0)+M(1)=M
M(0)+4(1)+M(0)=4
M(1)+4(0)+M(0)=M
91
Iteration 3:
Cj 6 4 M 0 0 M Q1
C1 Solution Quantity x y A1 S2 S3 A3
6 X 2 1 0 1 -2 0 0 --- R31
R32
4 Y 4 0 1 0 1 0 0 4 R33
M A3 4 0 0 -3 4 -1 1 1
Zj 28+4M 6 4 6-3M -8 -M M
+4M
Cj-Zj 0 0 4M-6 8-4M M 0
Remaining rows: R32 = R22, since the intersection with the optimum column is already equal
to zero.
Zj row:
Zj = 6 ( 2) + 4 ( 4 ) +M ( 4 ) = 28 + 4M
6(1)+4(0)+M(0)=6
6(0)+4(1)+M(0)=4
6(1)+4(0)+M(-3)=6–3M
6(-2)+4(1)+M4)=-8+4M
6(0)+4(0)+M(-1)=-M
6(0)+4(0)+M(1)=M
92
Final Tableau:
Cj 6 4 M 0 0 M
C1 Solution Quantity x y A1 S2 S3 A3
6 X 4 1 0 -1/2 0 -1/2 1/2 R41
4 Y 3 0 1 1/4 0 1/4 -1/4 R42
0 S2 1 0 0 -1/4 1 -1/4 1/4 R43
Zj 36 6 4 0 0 -2 2
Cj-Zj 0 0 M 0 2 M-2
Pivotal row:
R43 R33+4
4+4 =1
0+4 =0
0+4 =0
-3+4 = -1/4
4+4 =1 New pivot
-1+4 = -1/4
1+4 = 1/4
Remaining rows:
R42 -1/4 R33 + R32
R41 ½ R33 + R31
-1/4(4)+4 =3
½(4)+2 =4
-1/4(0)+0 =0
½(0)+1 =1
½(0)+0 =0 -1/4(0)+1 =1
-1/4(-3)+0=-1/4
½(-3)+1=-1/2
½(4)+2 =0 Intersection with the optimum -1/4(4)+1 =0
column -1/4(-1)+0=1/4
½(-1)+0 = -1/2
-1/4(1)+0 = -1/4
½(1)+0 = 1/2
Iteration 1:
Cj 6 4 1000 0 0 1000 Q1
C1 Solution Quantity x Y A1 S2 S3 A3
R11
1000 A1 10 1 2 1 0 0 0 5
R12
0 S2 4 0 1 0 1 0 0 4 R13
1000 A3 18 3 2 0 0 -1 1 9
Zj 28000 4000 4000 1000 0 -1000 1000
Cj-Zj -3994 -3996 0 0 1000 0
Iteration 2:
Cj 6 4 1000 0 0 1000 Q1
C1 Solution Quantity x Y A1 S2 S3 A3
R21
1000 A1 2 1 0 1 -2 0 0 2
R22
4 Y 4 0 1 0 1 0 0 --- R23
1000 A3 10 3 2 0 -2 -1 1 3.33
Zj 12016 4000 4 1000 -3996 -1000 1000
Cj-Zj -3994 0 0 3996 1000 0
94
Final Tableau:
Cj 6 4 1000 0 0 1000 Q1
C1 Solution Quantity x y A1 S2 S3 A3
R41
6 x 4 1 0 -1/2 0 -1/2 1/2 0
R42
4 y 3 0 1 3/4 0 1/4 -1/4 0 R43
0 S2 1 0 0 -3/4 1 -1/4 1/4 0
Zj 36 6 4 0 0 -2 2
Cj-Zj 0 0 1000 0 2 998
Iteration 1:
Cj
C1 Solution Quantity x y z
Zj
Cj-Zj
Iteration 2:
Cj
C1 Solution Quantity x y z
Zj
Cj-Zj
Decision: x = y= z= Minimum Z =
95