Chapter 4-Linear Programming (Simplex)
Chapter 4-Linear Programming (Simplex)
1. INTRODUCTION
In the previous chapter, we discussed solving linear programs using the graph
method. This method can only solve linear programs that have two decision variables.
The graph method cannot solve management problems that have a large number of
decision variables. How to practically solve LP problems that have a large number of
decision variables? The answer is, you can use the QSB (Quantitative System For
Business) computer program or use the simplex method. In reality, the use of computers
is more efficient, but the basic method used in computer operation is still the simplex
method.
Manual solution of linear programs using the simplex method still requires us to
develop LP formulation skills. By studying the mechanism of the simplex method, the
information obtained is not only the optimal solution, but also the economic
The simplex method is a development of the algebraic method that only examines
part of the number of base solutions in tabular form. The simplex table only describes
the linear program problem in the form of its coefficients, both the objective function
coefficient and the coefficient of each constraint. Because linear program problems can
be described in various forms such as maximum or minimum with constraints can also
be in the form of smaller equal to (≤) , greater equal to (≥) or equal to (¿), then a
standard form is needed that is commonly used to solve linear program problems.
The commonly used standard form is the "standard form" which has the following
characteristics:
(1) The value of the right-hand side of each constraint is nonnegative. If the right-hand
minus one. (−1). For example 2 x1 +3 x 2 ≤−30, it can be changed to −2 x 1−3 x 2 ≤30
(2) All constraints are in the form of equations, except nonnegativity constraints. If the
constraint is smaller than (≤) can be converted into an equation by adding a "slack
variable". Suppose the constraint is in the form: 2 x1 +3 x 2 ≤ 60, the equation can be
changed to: 2 x1 +3 x 2 +S 1=60. If the constraint is greater than (≥) can be converted
z mak=c 1 x 1 +c 2 x 2 +c 3 x 3 +…+ c n x n
d.k
......
......
If the standard form is put into a table, the general form of the simplex table will be
Vrb Cj C1 C2 C3 … Cj
CB
base Bj a1 a2 a3 … a3
CB 1 S1 b1 a 11 a 12 a 13 … a1 j
CB 2 S2 b2 a 21 a 22 a 23 … a2 j
CB 3 S3 b3 a 31 a 32 a 33 … a3 j
: : : : : : : :
CB j Sj bj a j1 a j2 a j3 … a ij
Table Description:
1. CB describes the objective function coefficients for the variables in the base.
2. The variable column in the base contains slack variables that will be replaced by
decision variables.
5. Line a j row contains the number of subtraction results Z j−C j which will provide
(1) Convert the linear programming problem into standard form (see characteristics of
A variable that has a coefficient of one, while the other constraints have a value of
zero.
(3) Enter all constraint function values into the simplex table.
(4) Enter the objective function coefficient values in the row Z j−C j , with the formula:
(5) Determine the key column, which is the column that has the largest negative value
in the row. Z j−C j . If there are two equal largest values, one can be chosen.
(6) Determine the key row, which is the value that has the smallest index number and is
(7) Find the new number in the key row by dividing all the numbers in the key row by
the key number. The key number is the number contained in the crossing of the key
New number = Value in the old row minus the multiplication of the coefficients
(9) If the optimal solution has not been found, go back to the fifth step above, so that
method.
Z mak. = 40 x 1 +30 x 2
d.k
(1) 2 x1 +3 x 2 ≤ 60
(2) 2 x 2 ≤ 60
(3) 2 x1 +1 x 2 ≤ 40
(4) x 1 ≥ 0(nonnegativity)
(5) x 2 ≥ 0(nonnegativity)
Where x 1 = number of astir production units, and x 2 = number of cosmos produced per
week.
Step 1.
except nonnegative constraints. The standard form of the PT Umsini problem is:
(1) 1 x1 +3 x 2+ S 1+ 0 S 2+ 0 S 3=60
(3) 2 x1 +1 x 2+ 0 S 1+ 0 S 2+ S 3=40
Step 2.
Check if all constraints have base variables, as a basis for creating the initial
simplex table. The first constraint has a base variable that is S1 , second constraint S2 ,
And the third constraint S3. Thus every constraint of smaller form equal to (≤), if
converted into standard form must have a base variable. So the initial simplex table can
be constructed directly.
The initial simplex table of PT Umsini's problem can be seen in Table 4.2, by
entering all values contained in the constraints and objective functions into the table.
Specifically to fill in the numbers contained in the row Z j−C j formula is used:
CBY j−C j . This formula only applies to fill the rows Z j−C j in the initial table.
Vrb. in C1 40 30 0 0 0
CB Index
base C2 x1 x2 S1 S2 S3
0 S1 60 2 3 1 0 0 60 /2=30
0 S2 30 0 2 0 1 0 30/0=∝
0 S3 40 2 1 0 0 1 40/2=20
Line 1. This first line contains the objective function coefficients of each
variable, namely:
Line 2. Contains the variable that corresponds to the first line, namely:
x 1 , x 2 , S1 , S 2 dan S3
Rows 3,4,5 contain the coefficients of the three constraints. In Table 4.2, it can be
seen below
60, 30, and 40. These values are the constants of the right-hand side of
each constraint.
[]
60
1. Z=( 0 , 0 , 0 ) 30 −0=0
40
[]
2
2. Z1 =( 0 , 0 ,0 ) 0 −40=−40
2
[]
3
3. Z 2=( 0 , 0 , 0 ) 2 −30=−30
1
[]
1
4. Z3 =( 0 , 0 , 0 ) 0 −0=−0
0
[]
1
5. Z 4=( 0 , 0 , 0 ) 0 −0=0
1
[]
0
6. Z5 =( 0 , 0 , 0 ) 0 −0=−0
1
A value of Z=0, indicating that in the initial table the values of x 1and
Step 3.
Is the initial table optimal? The answer is definitely no. The table is
Step 4.
1. Determine the key column, which is the column that has the largest negative Z -C jj
2. Determines the key row, which is the row that has a number. The smallest and
non-negative index, in this case S3 . Thus S3 will come out of the base and its
3. Determine the key number, which is the number contained in the crossing of the
key column with the key row, in this case the key number = 2.
4. Find the new number in the key row, by dividing all the numbers in the key row
Line S1 .
Old number = [ 60 2 3 1 0 0 ]
New number = [ 20 0 2 1 0 -1 ]
Line S2 .
Old number = [ 30 0 2 0 1 0 ]
New number = [ 30 0 2 0 1 0 ]
Line Z -Cjj .
The results of the above calculations will appear in the new simplex table, Table
Vrb. Cj 40 30 0 0 0
CB Index
in line bj x1 x2 S1 S2 S3
0 S1 20 0 2 1 0 -1 20/2=10
0 S2 30 0 2 0 1 0 30/2=15
Is the iteration 1 table optimal? The answer is no. By repeating the steps above, the
Vrb. Cj 40 30 0 0 0
CB Index
in line bj x1 x2 S1 S2 S3
30 x2 10 0 1 1/2 0 -1/2
0 S2 10 0 0 0 -1 1
40 x1 15 1 0 0 -1/4 3/4
Z -Cjj 900 0 0 0 5 15
Optimal solution Table 4.4 shows that the total value of Z = 900 with the value of each
Table 4.5
Coefficient
Variable value
Base variable objective x
base
function
x2 30 x 10 = 300
S2 0 x 10 = 0
x1 40 x 15 = 600
_____
Total = 900
Conclusion:
1. In iteration 2 table is the final simplex table, with the optimal solution is
x1 (astro) = 15 units
x2 (cosmos) = 10 units
Z (profit) = Rp.900,00
2(15) + 3(10) = 60
60= 60
2(15) + 1(10) = 40
40= 40
In section 4 of this chapter, we have illustrated the simplex method used to solve
maximization problems, and all constraints are of the form smaller than (s). In this
section, we will discuss another form of LP, namely the minimization problem and
Minimization Problem
To deal with this problem, there are two methods that can be done, namely:
Method 1
Change the minimum objective function to the maximum. The trick is to multiply
the minimum objective function by minus one. For example, the objective function Z
min = 40x1 + 25x2 , the maximum becomes -Z* mak. = Z = -40x1 - 25x2 .
[1] The simplex table ends (optimal) if the value contained in the row Zj - Cj ≤ 0.
[2] In the initial table, the value in the row Z j - Cj that corresponds to the decision
variable is positive.
[3] The key column is selected from the largest positive value.
[4] The key row still follows the minimum comparison rule and is non-negative.
[5] The next iteration process is the same as the previous one.
[3] x1 ≥0
[4] x2 ≥0
The LP formulation above can be converted into standard form with the objective
u.h x1 , x2 , S1 , S2 ≥0
By following the steps of the simplex method, the solution to the product mix
Vrb. Cj - 40 -25 0 0
CB Index
in line bj x1 x2 S1 S2
0 S1 150 3 2 1 0 150/3=50
0 S2 200 8 2 0 1 200/8=25
Z -Cjj 0 40 25 0 0
Vrb. Cj - 40 -25 0 0
CB Index
in line bj x1 x2 S1 S2
Z -Cjj -1.000 0 15 0 -5
Vrb. Cj - 40 -25 0 0
CB Index
in line bj x1 x2 S1 S2
The results of Table 4.8 of the 2nd iteration, show that the optimum solution is: x 1 = 10,
and x2 = 60.
= - (-1.900) = 1.900.
Method 2
In this method, we do not change the form of the objective function, but the minimum
objective function is directly included in the table (it remains as the original).
[1] The simplex table ends (optimal) if the value contained in the row Zj - Cj ≥ 0.
[2] Since the objective function is a minimum, the key column is chosen to have the
[3] The key row still follows the minimum comparison rule and is non-negative.
[4] The next iteration process is the same as the previous one.
Refer back to Example 4.1 above. The standard form of the product mix minimization
problem is as follows:
u.h x1 , x2 , S1 , S2 ≥0
If the standard form is solved according to method 2, the result is as follows:
Vrb. Cj - 40 -25 0 0
CB Index
in line bj x1 x2 S1 S2
0 S1 150 3 2 1 0 150/2=75
0 S2 200 8 2 0 1 200/2=100
Vrb. Cj - 40 -25 0 0
CB Index
in line bj x1 x2 S1 S2
0 S2 50 5 0 -1 1 50/5 = 10
Vrb. Cj - 40 -25 0 0
CB Index
in line bj x1 x2 S1 S2
25 x2 60 0 1 0,8 -0,3
40 x1 10 1 0 -0,2 0,2
The solution of LP problem with simplex method, requires an initial basic feasible
solution, i.e. each constraint values the base variable. If we have an LP that has
constraints greater than equal to (≥), for example 2x +3x 12 ≥ 30, it can be converted into
an equation by subtracting the surplus variable to the right of the constraint as follows:
2x1 + 3x2 - S = 30, where S ≥ 0. The constraint equation has no base variable.
added, which acts as a base variable. So the constraint changes to: 2x 1 + 3x2 - S + Q =
30, where Q is an artificial variable. The use of pseudo variables is a very systematic
Constraints of the form equal to (=) also have no basis variable. Therefore, add
one pseudo base variable, so that the initial simplex table can be formed. For example,
2x +4x12 = 20, can be changed to 2x1 + 4x2 + Q = 20, where Q is a pseudo base variable.
not a flexible solution to the original problem. The pseudo-variables must be reduced to
zero. There are two methods that can be used to zeroize all variables, namely:
In this method, the objective function coefficients for the pseudo-variables are
given very large values of negative M or - M for the maximum objective function and
d.k [1] x1 ≤ 40
[2] x2 ≥ 20
[3] x1 + x2 = 50
[4] x1 , x2 ≥0
The LP model above is converted into standard form with the addition of pseudo-
variables as follows:
[4] x1 , x2 , S1 , S2 , Q1 , Q2 ≥ 0
0 S1 40 1 0 0 0 0 0 40/0 = ~
-M Q1 20 0 1 0 -1 1 0 20/1 = 20
-M Q2 50 1 1 0 0 0 1 50/1 = 50
The value contained in row Z -Cjj Table 4.12 is filled in using the following method.
[]
40
Z=[0 ,−M ,−M ] 20 −0=0−20 M −50 M =−70 M
50
[]
1
Z1 =[ 0 ,−M ,−M ] 0 −50=0−M −50=−M −50
1
[]
0
Z 2=[ 0 ,−M ,−M ] 1 −80=0−M −M −80=−2 M −80
1
[]
0
Z 4=[ 0 ,−M ,−M ] −1 −0=0+ M +0=M
1
And so on.
By following the previous steps of the simplex method, the solution of Example 4.2 can
be seen below.
Vrb. Cj 50 80 0 0 -M -M
CB Index
in line bj x1 x2 S1 S2 Q1 Q2
0 S1 40 1 0 0 0 0 0 40/1 = 40
80 x2 20 0 1 1 -1 1 0 20/0 = ∞
-M Q2 30 1 1 0 0 -1 1 30/1 = 30
Z -Cjj -30M -M 0 0 M 2M 0
Vrb. Cj 50 80 0 0 -M -M
CB Index
in line bj x1 x2 S1 S2 Q1 Q2
0 S1 40 1 0 1 0 0 0
80 x2 50 1 1 0 0 1 1
0 S2 30 1 0 0 1 -1 1
Z -Cjj 4.000 30 0 0 0 M M
+ 80
The optimum solution is reached when x1 = 0 and x2 = 50, with a value of Z = 4,000.
Two-Phase Method
In the two-phase method, the solution is separated into two stages. Each stage
uses a simplex table and the work process still uses the steps of the simplex method.
Phase 1.
objective function. The pseudo objective function has the same number of variables as
the number of pseudo variables. Then the objective function of all is maximized with
the simplex table. The objective function coefficient for all variables is given a value of
minus one or (-1) if the objective function is maximum and plus one or (+1) if the
objective function is minimum. Phase one ends when the pseudo objective function has
Look back at Example 4.2 above. There are two pseudo-variables Q 1 and Q2 .
Vrb. Cj 0 0 0 0 -1 -1
CB Index
in line bj x1 x2 S1 S2 Q1 Q2
0 S1 40 1 0 1 0 0 0 40/0 = ~
-1 Q1 20 0 1 0 -1 1 0 20/1 = 20
-1 Q2 50 1 1 0 0 -0 1 50/1 = 50
Z -Cjj -70 -1 -2 0 1 0 0
Table 4.16. Iteration Table 1 First Phase
Vrb. Cj 0 0 0 0 -1 -1
CB Index
in line bj x1 x2 S1 S2 Q1 Q2
0 S1 40 1 0 1 0 0 0 40/0 = ~
0 x2 20 0 1 0 -1 1 0 20/-1 = -20
-1 Q2 30 1 0 0 1 -1 1 30/1 = 30
Z -Cjj -30 -1 0 0 -1 2 0
Vrb. Cj 0 0 0 0 -1 -1
CB Index
in line bj x1 x2 S1 S2 Q1 Q2
0 S1 40 1 0 1 0 0 0
0 x2 50 1 1 0 0 0 1
0 S2 30 1 0 0 1 -1 1
Z -Cjj 30 1 0 0 0 1 1
In Table 4.17 (optimum) the pseudo objective function has been optimized, and the
pseudo variables Q1 and Q2 are out of the base. The process can proceed to the second
phase.
If the pseudo variable is still in the base with a positive value, then the problem is
formulation. There is no need to continue with the second stage of the process.
Phase 2.
The end table of the first phase is the start table of the second phase. It is then
optimized by entering the original objective function. Because in the first phase we have
zeroed out the pseudo-variables, in the second phase the pseudo-variables do not need to
be included in the table anymore (omitted). See the initial table of the second phase
below.
Vrb. Cj 0 0 0 0
CB Index
in line bj x1 x2 S1 S2
0 S1 40 1 0 1 0
80 x2 50 1 1 0 0
0 S2 30 1 0 0 1
Z -Cjj 4.000 30 0 0 0
After the original objective function coefficients are entered into the initial table
of the second phase, the initial table immediately shows the optimum table. Because the
value contained in the row Z -Cjj ≥ 0. The optimum solution is x1 = 0 and x2 = 50.
Comparing the large M method with the two-phase method, it can be concluded
that both methods use pseudo variables. The difference lies in the stages of completion.
[1] Pseudo-variables are only added to get an initial solution that is flexible. If we use
a computer program such as QSB (Quantitative System for Business), then the
addition of pseudo variables is not necessary, because QSB has been programmed
[2] If the pseudo-variable has left the base, then in the next table the pseudo-variable
[3] In the optimum table all pseudo-variables must come out of the base. If the
pseudo-variables are still in the base with positive values, then the problem is not
feasible.
In chapter 3 section 4, it was mentioned that there are three special problems in
linear programming, namely: [1] multi optimum solutions, [2] np feasible solutions, and
section we will discuss these three special problems using the simplex method.
in the optimum table has a value of zero in row Z -C jj . if this variable is included in the
base, it will change the value of the decision variable. But it will not change the optimal
value of the objective function Z (the optimal value of the objective function is the
Vrb. Cj 0 0 0 0 0
CB Index
base bj x1 x2 S1 S2 S3
0 S1 58 0 0 1 -0,2 1,6
2 x2 12 0 1 0 0,2 -0,6
3 x1 42 1 0 0 1,2 0,4
Z -Cjj 150 0 0 0 1 0
If we look at the optimum table above, there are two non-base variables, namely
S2 and S3 . The variable S3 has zero value in the row Z -Cjj , this means there are
and x2 , which produces the same Z value. How to find the alternative optimum? Put the
variable S3 into the base and with the minimm comparison rule, the variable S 1 will
Vrb. Cj 0 0 0 0 0
CB Index
Base bj x1 x2 S1 S2 S3
Z -Cjj 150 0 0 0 1 0
alternative 1:
x1 = 42 and x2 = 12
Unbounded Solutions
Another problem that may arise from the minimum comparison rule is if the base
variable that should be excluded cannot be determined, because none of the variable
coefficients have positive values. Thus, the minimum comparison rule cannot be
performed even though the table is not yet optimum. Such cases are called unbounded
Vrb. Cj 0 0 0 0
CB Index
Base bj x1 x2 S1 S2
0 S1 60 3 -3 1 0
0 S2 120 -9 3 0 1 120/3 = 40
Z -Cjj 0 -6 -9 0 0
Table 4.22. Iteration Table (Unbounded Solution)
Vrb. Cj 0 0 0 0
CB Index
Base bj x1 x2 S1 S2
0 S1 180 -6 0 1 0
9 x2 40 -3 1 0 1/3
In Table 4.22 of the first iteration, x1 should be in the base, because the value in
row Z -Cjj is still negative 33. But the variable coefficients contained in column x 1 are
No Feasible Solutions
If one or more artificial variables in the optimum table are still in the base with
positive values, the linear program is not feasible (no feasible solution). See Example
4.3 below.
Maximum Z = 2x1 + 5x 2
d.k [1] x1 + x2 ≤ 10
[3] x1 , x2 ≥ 0
Vrb. Cj 2 5 0 0 -M
CB Index
in line bj x1 x2 S1 S2 Q1
0 S1 10 1 1 1 0 0 10/1 = 10
-M Q1 48 2 3 0 -1 1 48/3 = 16
-2 -5
Vrb. Cj 2 5 0 0 -M
CB Index
in line bj x1 x2 S1 S2 Q1
5 x2 10 1 1 1 0 0
-M Q1 18 -1 0 -3 -1 1
Z -Cjj 50 M 0 3M M 0
-18M +3 +5
Table 4.24 of the first iteration above is an optimum table, because the value in
the row Z -Cjj ≥ 0. But the pseudo variable Q 1 is still in the base with a positive value of
18. Therefore Example 4.3 is called no feasible solutions. Errors may occur when
Degeneracy
The degeneracy problem arises because the decision variable contained in the base
[4] x1 , x2 , x3 , S1 , S2 , S3 ≥ 0
Vrb. Cj 4 1 3 0 0 0
CB Index
base bj x1 x2 x3 S1 S2 S3
0 S1 60 2 -2 0 1 0 0 60/2 = 30
0 S2 120 0 0 2 0 1 0 120/4 = 30
0 S3 90 0 2 2 0 0 1 90/2 = 45
Z -Cjj 0 0 -1 -3 0 0 0
Vrb. Cj 4 1 3 0 0 0
CB Index
base bj x1 x2 x3 S1 S2 S3
0 S2 0 0 4 2 -2 1 0 0/4 = 0
0 S3 30 0 4 2 -1 0 0 30/4 = 7,5
Z -Cjj 120 0 -5 -3 2 0 0
Table 4.27. Iteration Table 2 for Example 4.4
Vrb. Cj 4 1 3 0 0 0
CB Index
base bj x1 x2 x3 S1 S2 S3
0 S3 30 0 0 0 1 -1 1 30/0 = ~
Vrb. Cj 4 1 3 0 0 0
CB Index
Base bj x1 x2 x3 S1 S2 S3
4 x1 30 1 -1 0 0,5 0 0 30/0,5 = 60
3 x3 0 0 2 1 -1 0,5 0
0 S3 30 0 0 0 1 -1 1 30/1 = 30
Vrb. Cj 4 1 3 0 0 0
CB Index
Base bj x1 x2 x3 S1 S2 S3
4 x1 15 1 -1 0 0 1/2 -1/2
3 x3 30 0 2 1 0 -1/2 1
0 S1 30 0 0 0 1 -1 1
zero. Although such cases may be rare, Example 4.4 above illustrates the possibility of a
table not changing the value of Z. This results in the simplex table being less efficient to
One of the assumptions in the LP formulation is that all decision variables cannot
be negative. Similarly, in the standard form, all decision variables must be nonnegative.
Maximum Z = 6x1 + 3x 2
[2] x1 + x2 ≤ 12
[3]-x1 + x2 ≤ 4
[4] 2x1 + x2 ≤ 2
u.h x1 ≥ -2
x2 ≥ 0
In the above example, the decision variable x 1 can be negative as indicated by x1 ≥-2. To
fulfill the assumptions in the LP formulation and the standard form, where the decision
above. The way that can be done is to add a new variable to replace the decision
variable x1. The new variable is x 1 = x1 + 2, thus x1 = x1 ' = 2. The variable x 1 ' is a
u.h x1 ' ≥ 0
x2 ≥ 0
or,
[2] x1 ' + x2 ≤ 14
[3]-x1 ' + x2 ≤ 2
u.h x1 ' ≥ 0
x2 ≥ 0
nonnegative variables in place of the infinite decision variable (see example below).
d.k [1] x1 + x2 + x3 ≤ 7
[2] x1 - x2 + x3 ≥ 2
[4] x1 ≥ 0
[5] x2 ≥ 0
[6] x3 ≥ ~
In the above example, the decision variable x 3 is infinite. The way that can be done is to
change the variable x3 with him variables of different signs, namely x 4 - x5 where x4 ≥ 0,
and x5 ≥ 0. The value of x3 is positive or negative depending on the two variables. The
[2] x1 - x2 + 1(x4 - x5 ) ≥ 2
[4] x1 ≥ 0
[5] x2 ≥ 0
[6] x4 ≥ 0
[7] x5 ≥ 0
or,
d.k [1] x1 + x2 + x4 - x5 ≤ 7
[2] x1 - x2 + x4 - x5 ≥ 2
[4] x1 ≥ 0
[5] x2 ≥ 0
[6] x4 ≥ 0
[7] x5 ≥ 0
Practice Questions
Problem 1
Solve the linear program below by simplex method
Mak Z = x1 + 3x2
d.k. (1) x 1 ≤5
(2) x1 + 2x2 ≤ 10
(3) x2 ≤4
(4) x1 ; x2 ≥0
Problem 2
Solve the linear program below by simplex method:
Min Z = 3x1 + x2 + x3 + x4
d.k. (1) -2x1 + 2x2 + x 3 =4
(2) 3x1 + x + 2 x4 =6
(3) x1 ; x2 ; x3 ; x4 ≥0
Check if there is an alternative solution, if there is look for an alternative solution.
Problem 3