There are two major methods of solving an L.P. problem. The methods are :
(a) Graphical method; and (b) Simplex Method.
Each of these methods will be considered in the subsequent sections.
(a) Graphical Method of Solving L.P Problem
This is a method that demands the use of geometric representation of a linear optimization model. It is an easy and common method usually used for a L.P problem with two decision variables.
The procedure of graphical method is summarized in the following steps:
Step 1: Obtain the mathematical model of the LP problem.
That is, formulate the problem as discussed in section 17.4
Step 2: On a graph paper, draw the graphs of the constraints (i.e. the inequalities) and the non-negativity restrictions.
Step3: Identify the feasible region. This is the region common to all the graphs drawn in step 2. it is also called the “solution space” in the sense that all the points within the region satisfy the constraints simultaneously.
Step 4: Identify and determine the coordinates of corners of the feasible solution space. Then evaluate the values of the objective function at each extreme point. Pick the extreme point of the feasible region that gives the optimum (best) value. The concept of optimum can be determined by picking the highest or smallest of these values respectively for maximization or minimization problem. Note that there is a theory that backs-up the issue of extreme point which always gives the minimum or maximum value of Z (objective function).
413 ILLUSTRATION 18-3 (Maximization Problem)
Solve the following L.P. problem by graphical method.
Maximize Z = 3X1 + 2X2
Subject to 2X1 + 3X2 18 ………….. I
3X1 + X2 9 ……… II
X1 + 5X2 10 ……… III
X1, X2 0
SUGGESTED SOLUTION 18.3
Step 1: The problem is already in mathematical form
Step 2: Variables X1 and X2 are represented respectively on horizontal and vertical axes.
Consider the constraints and treat as equations in order to draw the graphs. Since the equations are of straight lines, two points will fix each line.
Consider:
Constraint I (2X1 + 3X2 = 18)
X1 = 0, X2 = 6 corresponds to the point (0, 6) X2 = 0, X1 = 9 corresponds to the point (9, 0) Constraint II (3X1 + X2 = 9)
X1 = 0, X2 = 9 corresponds to the point (0. 9) X2 = 0, X1 = 3 corresponds to the point (3, 0) Constraint III (X1 + 5X2 = 10)
X1 = 0, X2 = 2. Then we have point (0,2) X2 = 0, X1 = 10. Then we have point (10,0)
With the above points, the graphs of the constraints are drawn as follows:
Step 3: From the graph, the feasible region (i.e the region common to all the constraints) is ABCO
Step 4: The extreme points of the feasible region are:
A(0,2), B(2.5,1.7), C(3,0) and O(0,0).
The next line of action is to use the extreme points to determine the optimal value thus
Points Max Z = 3X1 + 2X2 A(0,2)
B(2,5,1.75) C(3,0) O(0,0)
Z = 4
Z = 7.5 + 3.5 = 11 Z = 9
Z = 0
Decision: Since the problem is a maximization one, the highest value of Z is 11. Hence the optimal value of Z = 11 is obtained at X1 = 7.5 and X2 = 1.75
ILLUSTRATION 18-4 (Minimization Problem)
Use the graphical method to solve the following L.P. problem Minimize Z = 3X1 + 4X2
II
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10
X1 X2
A(0,2)
bBIII (2.5,1.75)
C (3,0)
0 0 0
I
415 Subject to: X1 + 3X2 9
2X1 + 5X2 20
3X1 + 2X2 12
X1, X2 0
SUGGESTED SOLUTION 18-4
Step 1: The problem is already in mathematical form Step 2:
Constraint I (X1 + 3X2 = 9)
If X1 = 0, X2 = 3. corresponds to the point (0,3) If X2 = 0, X1 = 9. corresponds to the point (9,0) Constraint II (2X1 + 5X2 = 20)
If X1 = 0, X2 = 4. corresponds to the point (0,4) If X2 = 0, X1 = 10. corresponds to the point (10,0) Constraint III (3X1 + 2X2 = 12)
If X1 = 0, X2 = 6. corresponds to the point (0,6) If X2 = 0, X1 = 4. corresponds to the point (4,0)
Step 3: The use of the above points, will create the following graph:
A(0,6)
B(2,3.5)
I
II III
I
0
I
1 2 3 4 5 6 7 8 9 X2
C(10,0) 1 2 3 4 5 6 7 8 9 10 X1
Step 4: The extreme points of the feasible region are:
A(0,6), B(2,3.5), and C(10,0). Therefore, the following table gives the objective function
Points Min Z = 3X1 + 4X2
A(0,6) B(2,3.5) C(10,0)
Z = 24
Z = 6 + 14 = 20 Z = 30
Decision: Since the value of Z at B(2,3.5) is the smallest (i.e. Z = 20), the optimal value is 20 with X1 = 2 and X2 = 3.5.
(b) Definition of Some Useful Terms in Simplex Method for solving LP Problem
The following terms or concepts are needed in the Simplex Method. Hence, they are discussed as preambles to the method.
(i) Standard Form
The standard form of a L.P. problem is the conversion of the original given problem of L.P. to the form that is amenable to algebraic computations and manipulations.
The main characteristics of the standard form are:
The objective function is either of a Minimisation or Maximisation type.
All inequalities‟ constraints are converted to equations by adding slack or surplus variables.
Slack variable(s) is added to the inequality of type (less than or equal to); while Surplus variable(s) is/are subtracted from the inequality of type (greater than or equal to). A slack variable represents unused resources while the surplus variable represents the amount by which solution values exceed a resource. Surplus variable is also called the negative slack variable.
All variables are restricted to be non-negative.
417
The right-hand side of each constraint must be non-negative. If it is not, just multiply both sides of the constraint by –1.
In a compact form, the standard form can be expressed in the following matrix notation:
Optimize (Max or Min) Z = CX + 0S
Subject to: AX + S = b X, S 0
Where C = (C1, C2, … Cn) is the row vector, X = (X1, X2, …Xn) b = (b1, b2, ……… bm) and
S = (S1, S2, ………. Sm) are column vectors and
A =
m mn m
n n
a a
a
a a
a a a
a
...
...
..
.. ...
2 1
2 22
21
1 12
11
ILLUSTRATION 18-5
The L.P. problem
Min Z = 2x1 + 3x2 + x3
Subject to: x1 + 3x2 + 2x3 10 2x1 + x2 + 3x3 20 3x1 + x2 + 2x3 = 15 x1, x2, x3 0 can be expressed in standard form as:
Min Z = 2x1 + 3x2 + x3 + OS1 + OS2
Subject to: x1 + 3x2 + 2x3 + S1 + OS2 = 10 2x1 + x2 + 3x3 + OS1 – S2 = 20 3x1 + x2 + 2x3 + OS1 + OS2 = 15 x1, x2, x3, S1, S2 0
N.B:
Instead of S1 and S2, x4 and x5 can be used as slack and surplus variables.
s.t. means subject to.
is the m x n matrix and the coefficients of variables x1, x2, …..,xn in the constraints.
(ii) Canonical Form
A system of m equations and n variables with m n is in canonical form with a distinguished set of m basic variables if each basic variable has coefficient 1 in one equation and zero in the others; and also each equation has exactly one basic variable with coefficient 1.
For example, variables x1 and x2 are distinguished Basic Variables in the following problem:
Maximize Z = x1 – 2x2 + 3x3
Subject to: x1 + 2x3 = 10 14.5.1 X2 + 3x3 = 15
X1, x2, x3 0 (iii) Basic Solution
A solution set which has at most m zero values in a L.P. problem that has n variables and m constraints (m < n) is a basic solution. If it is otherwise (m > n), the solution degenerates.
(iv) Standard L.P. Problem in Canonical Form
This is the required form for a L.P problem before a simplex method or procedure can be applied. Here, the L.P problem must be in both standard and canonical forms.
A standard L.P. problem is in canonical form if it satisfies the following conditions:
(i) The constraints are in canonical form with respect to a distinguished set of basic variables
(ii) Associated basic solution is feasible.
(iii) Objective function is expressed in terms of non-basic variables only.
For instance, x1 and x2 are basic variables in the example under canonical form (Equation 17.5.2.1), while x3 is the non-basic variable.
(v) Artificial Variable
This is a variable represented by a letter to make a standard form of L.P. problem which is not in canonical form. A standard
419
canonical form is usually applied to the constraints of types and = (equal to) in order to make them canonical.
(c) The Simplex Algorithm
The Simplex Algorithm (for both Minimization and Maximization) of a L.P. problem can be stated in the following procedural steps:
Step 1: Start by stating the problem in a standard canonical form.
Step 2: Set up the initial simplex table or tableau from the data in step 1.
A general form of initial simplex table is given below:
Cj C1 C2 …… Cn 0 0 …… 0 Xbi (or simply bi) Cost/Profit of Basic
Variables CB
Variables in Basis xB
Variables (xj)
x1 x2 …. xn. S1 S2 ….. Sn
Value of Basic Variables
CB1
CB2
. . . V CBm
S1
S2
. . . Sm
a11 a12 .… a1n 1 0 ..… 0 a21 a22 .… a2n 0 1 ..… 0 . . . . . . . . . . . . . . . . . . am1 am2 .… amn 0 0 ..… 1
b1
b2
. . . bm
Zj = CBj Xj Z* = Cj – Zj
Step 3: Compute Zj and Z* j for each variable xj as stated in step 2.
Step 4: Carry-out the optimality test.
For a Minimization problem, find out if there is any negative value of Z*j. If there is none, the problem is optimal and then stop but if not go to step 5. Also for a Maximization problem, find out if there is any positive value of Z* j. If there is none, the problem is optimal and then stop but if otherwise, go to step 5.
Step 5: Determine the variable to enter into the basis:
For a Minimization problem, select key column with largest negative value of Z* j in order to go into the basis.
While for the Maximization problem, select the key column with largest positive value of Z* j in order to go into the basis.
Step 6: Determine the variable to leave the basis.
Here, select key row with Min (Xbi/aij, aij>0) to leave the basis. If all aij 0, then the current solution is unbounded and stop the procedure. Also, if minimum of these ratios (bi/aij) is attained in several rows, a simple rule of thumb such as choosing that row with the smallest index can be used to select the pivot row.
Step 7: Identify the key element at the intersection of key row and key column. Then update the entries in the simplex table by:
(i) first obtaining the key row values, and then
(ii) pivoting or applying elementary row operations to form a new simplex table. That is, the new table is formed by:
(a) stating the key element. If it is 1, the new row remains the same as old. But if it is not 1, then divide each element in the key row by this key element in order to obtain a new row;
(b) obtaining the new values for the elements in the remaining rows (other than the key row) by the elementary row operations as follows:
Step 8: Go to step 3 in order to compute Zj and Z* j for the new simplex table and continue along the other sequence steps.
In the same vein, the above algorithm (Simplex Algorithm) can be depicted in the following flow chart:
New value for the element of remaining
row;
element value in the
old row;
Value of element in row i which is either above or below key element
New corresponding value of element
in the key row
= ± x
421
Yes
Convert the L.P. problem into standard Canonical form
Setup the initial simplex table in order to obtain the initial solution
Compute Zj and *
Z jwhere Zj = CBjXj and *
Z j = Cj - Zj
Select the key column with negative value of *
Z
Is it a Minimization
problem?
(Minimization) Yes
(Maximization)
No
Does negative values of *
Z exist?
Does positive values of
Z* exist?
Select the key column with largest positive value of *
Z
Is all aij 0?
Select the key row with Min {bi/aij; aij>0}
Identify the key element at the intersection of key row and key column.
Update the entries in the simplex table by (a) obtaining key row values; and
(b) pivot or apply elementary row operations.
The solution set is optimal
Stop
Yes Yes
No No
Yes The current problem is No unbounded
Fig. 18.1. Flow chart of Simplex Algorithm
ILLUSTRATION 18-6
Use the simplex method to solve the following LP problem:
Max Z = 2x1 + 3x2 + 3x3
Subject to: 3x1 + 2x2 60 -x1 + x2 + 4x3 10 2x1 – 2x2 + 5x3 50 x1 , x2 , x3 0
SUGGESTED SOLUTION 18-6
Step 1: Convert the given problem to standard canonical form by the use of slack variables S1, S2 and S3: Max Z= 2x1 + 3x2 + 3x3 +OS1 + OS2 + OS3 S. t. 3x1 + 2x2 + 0x3 + S1 +OS2 + OS3 = 60 -x1 + x2 + 4x3 + OS1 +S2 + OS3 = 10 2x1 – 2x2 + 5x3 + OS1 + OS2 + S3 = 50 x1 , x2 , x3 , S1 , S2 , S3 0
Step 2: Form the initial simplex table from step 1:
Table 1
Cj 2 3 3 0 0 0
CB XB X1 X2 X3 S1 S2 S3 bi 0 0
0
S1
S2
S3
3 2 0 1 0 0 -1 1 4 0 1 0 2 -2 5 0 0 1
60 10 50 Zj 0 0 0 0 0 0 Z = 0 Z* = Cj – Zj 2 3 3 0 0 0
The ratio (bi /aij)
Step 3: Computations of Z and Z* are made in step 2 as follows:
Z = CBiXj
i.e. Z = CBiXj = (0 x 3) + (0 x –1) + (0 x 2) = 0 and
Z* = Cj – Z = 2 - 0 = 2
Also for Z = CB1X2 = (0 x 2) + (0 x 1) + (0 x –2) = 0 Z* = Cj – Z = 3 – 0 = 3
60/2 = 30 10/1 = 10 Not applicable
423
Step 4: By the optimality test, the solution is not optimal yet because series of positive values Z* are present.
Step 5: The largest of the positive value of Z* is 3 from the table in step 2. Then, take the one with variable X2 in order to go into the basis.
Step 6: From the ratio obtained in the above tableau (Table 1), the minimum ratio is 10 and therefore take variable S2 as the one leaving the basis.
Step 7: The key element at the intersection of key row and key column is 1. It is circled in Table 1.
Next is to carry-out pivot operation on table 1 in order to have a new table as Table 2.
Cj 2 3 3 0 0 0
CB XB X1 X2 X3 S1 S2 S3 bi Ratio R1
R2 R3
0 3 0
S1
X2 S3
5 0 -8 1 -2 0 -1 1 4 0 1 0 0 0 13 0 2 1
40 10 70
40/5 = 8 Not applicable Not applicable Z -3 3 12 0 3 0 Z= 30
Z* 5 0 -9 0 -3 0 Pivot Operations
New R1 = Old R1 + (-2)R2 New R2 = Old R2
New R3 = Old R3 + 2R2
Z for CB1X1 = 0(5) +(-1)(3) + 0(0) = -3 Z* = Cj – Zj = 2 – (-3) = 5
Z for CB1X2 = 0(0) +3(1)(3) + 0(0) = 3 Z* = Cj – Zj = 3 – 3 = 0
Z for CB1X3 = 0(-8) + 3(4) + 0(13) = 12 Z* = Cj – Zj = 3 – 12 = -9
Table 3
Cj 2 3 3 0 0 0
CB XB X1 X2 X3 S1 S2 S3 bi 2
3 0
X1 X2
S3
1 0 -8/5 1/5 -2/5 0 0 1 22/5 1/5 3/5 0 0 0 13 0 2 1
8 18 70 Z 2 3 4 1 1 0 Z= 70 Z* 0 0 -1 -1 -1 0
Elementary Operations
New R1 = old R1 5 New R2 = old R2 + New R1 New R3 = old R3
Z for CB1X1 = 2(1) + 3(0) + 0(0) = 2 Z* = Cj – Zj = 2 – 2 = 0
Z for CB1X2 = 2(0) + 3(1) + 0(0) = 3 Z* = Cj – Zj = 3 – 3 = 0
Z for CB1X3 = 2(-8/5) + 3(12/5) + 0(13) = 4 Z* = Cj – Zj = 3 – 4 = -1
Since there is no positive value of Z* in table 3, the solution is optimal with X1 = 8, X2 = 18 and S3 = 70
The Optimal Value Z = 2(18) + 3(18) + 3(0) = 70.
ILLUSTRATION 18-7
By simplex method, solve the following LP problem:
Min. Z = x1 + x2 – 4x3
Subject to: x1 + x2 +2x3 9 x1 + x2 - x3 2 -x1 + x2 + x3 4 x1 , x2 , x3 0 SUGGESTED SOLUTION 18-7
The problem in standard canonical form:
Min. Z = x1 + x2 – 4x3 + OS1 + OS2 + OS3 Subject to: x1 + x2 +2x3 + S1 + OS2 + OS3 = 9 x1 + x2 - x3 + S1 + OS2 + OS3 = 2 -x1 + x2 + x3 + OS1 + OS2 + S3 = 4 x1 , x2 , x3 , S1 , S2 , S3 0
425 Presentation in table 1 below:
Table 1
Cj 1 1 -4 0 0 0
CB XB X1 X2 X3 S1 S2 S3 bi Ratio 0 0
0
S1
S2 S3
1 1 2 1 0 0 1 1 -1 0 1 0 -1 1 1 0 0 1
9 2 4
9/2 = 4.5 Not valid 4/1 = 4 Z 0 0 0 0 0 0 Z= 0
Z* =Cj-Z 1 1 -4 0 0 0
By optimality test, the solution is not yet optimal. Therefore, variable X3
goes into Basis because it is not the most negative value of Z* ; While S3 with the minimum ratio leaves the basis.
Table 2
Cj 1 1 -4 0 0 0
CB XB X1 X2 X3 S1 S2 S3 bi Ratio 0 0
0
S1
S2
S3
3 -1 0 1 0 -2 0 2 0 0 1 1 -1 1 1 0 0 1
1 6 4
1/3 Invalid Invalid Z 4 -4 -4 0 0 -4 Z= 16
Z* -3 5 0 0 0 5 New R1 = old R1 – 2(R3)
New R2 = old R2 + R3
New R3 = old R3
Z for CB1X1 = 3(0) + 0(0) + (-4)(-1) = 4 Z* = Cj – Zj = 1 – 4 = -3
Z for CB1X2 = 0(-1) + 0(2) + (-4)1 = -4 Z* = Cj – Zj = -4 – (-4) = 0 and so on.
Since X1 is having negative value of Z* , X1 moves to the Basis while S1 (with ratio 1/3) leaves the basis.
Table 3
Pivot Operations
New R1 = 1/3 (old R1)
New R2 = old R2
New R3 = old R3 + New R1
Z for CB1X1 = 1(1) + 0(0) + (-4)(0) = 1 Z* = 1 – 1 = 0
Z for CB1X2 = 1(-1/3) + 0(2) + (-4)(2/3) = -3 Z* = 1 – (-3) = 4
Z for CB1X3 = 0(1) + 0(0) + (-4)(1) = -4 Z* = -4 – (-4) = 0
Since no more negative values of Z* , the solution is optimal with X1 = 1/3, X3 = 41/3 and X2 = 0.
The optimal value is Z = 1(1/3) + 0(1) + (-4)(41/3)
= 1/3 + 0 – 171/3
= -17.
Remarks: It is essential to know that:
(vi) The above example can be handled by the Maximization approach.
The following relationship will make it possible:
Max Z = Min. (-Z); or vice versa.
(vii) The unrestricted variable can be handled by re-defining the variable with new ones.
Cj 1 1 -4 0 0 0
CB XB X1 X2 X3 S1 S2 S3 bi
1 0 -4
X1 S2
X3
1 -1/3 0 1/3 0 -2/3 0 2 0 0 1 1 0 2/3 1 1/3 0 1/3
1/3 6 41/3 Z 1 -3 - 4 -1 0 2 Z= -17
Z* =Cj-Zj 0 4 0 1 0 2
427 ILLUSTRATION 18-8
Suppose it is required to maximize.
Z = 2x1 + 3x2
Subject to: 2x1 + x2 10
x1 + 3x2 15
x1 0, x2 unrestricted.
The unrestricted variable x2 is re-defined by x2 = x3 – x4, where x3 , x4 0.
Therefore, the above problem can be re-written as:
Max Z = 2x1 + 3(x3 – x4) s.t. 2x1 + x3 – x4 10
x1 + 3x3 – 3x4 15
x1 ,x3 , x4 0.
(viii) Some authors prefer using Z* = Zj – Cj. In this case, take decision in opposite way to Z* = Cj - Zj
(ix) In economic and business terms, the various variables stated in step 3 of section 17.5.3 can be interpreted as follows:
Z represents return
Cj represents return per unit of Variable xj
xj represents number of units of Variable j
aij represents units of resource, i consumed (required) per unit of Variable j
bj represents units of resource, i available.