UG Chapter 2
UG Chapter 2
UG Chapter 2
The Simplex method is similar to the graphical method in that it uses the extreme points
of the feasible region to search for the solution. The main difference is that with the Simplex
method, once the initial vertex has been chosen, movement from one vertex to another is in
such a way that the value of the objective function improves with each move. Although there
are n + m variables in m equations, the solution of the problem concerns the n variables
in the original constraints. If m < n then some of the decision variables will have zero
values.
Before we can employ the Simplex method, we need to rewrite the problem in its
standard form in which the constraints are equations rather than inequalities. First let us see
the form of a general LPP in standard form. Then we will study how to convert an LPP into
its standard form.
The standard form of a linear programming problem with ݉ constraints and ݊ variables can
be represented as follows:
Subject to:
a11 x1 + a12 x2 + ... + a1n xn = b1
……………………………………..
29
……………………………………..
x1 , x2 ,..., xn ³ 0
b1 , b2 ,..., bm ³ 0
Subject to:
n
åa
i =1
x = bk ; bk ³ 0, xi ³ 0; k = 1, 2,..., m
ki i
The Features of the Standard Form of an LPP
In matrix-vector notation, the standard LPP can be expressed in compact form as:
Subject to: AX = b
X ³0
b³0
30
where A is an m ´ n matrix, X is an n ´ 1 column vector, b is an m ´ 1 column vector and
C is a 1 ´ n row vector.
That is,
é x1 ù é b1 ù
X = êê úú , b = êê úú and
êë xn úû êëbm úû
C = [ c1 cn ]
In practice, A is called the coefficient matrix, X is called the decision vector, b is called the
requirement vector and C is called the profit (cost) vector of the programme.
Example-2.1
Maximize Z = 2 x1 + 4 x2 - 3x3 + x4
Subject to x1 + 2 x2 + x3 + 5 x4 = 10
x2 - 2 x3 + x4 =7
x1 + 7 x2 + 3x3 + x4 = 2
x1 , x2 , x3 , x4 ³ 0
Solution
Maximize Z = CX
Subject to: AX = b
X ³0
b³0
31
é x1 ù
é1 2 1 5ù êx ú é10 ù
where ê ú
A = ê0 1 - 2 1ú , X = ê ú , b = êê 7 úú
2
ê x3 ú
êë1 7 3 1úû ê ú êë 2 úû
ë x4 û
and C = [2 4 - 3 1]
Since the standard form requires all the constraints to be equations, inequality constraints
have to be converted to equations. For this we use two types of variables, called slack
variables and surplus variables.
We can add a new variable, say x4 ³ 0 in the LHS of (1) so that the LHS of (1) equals 10.
That is,
x1 - 3x2 + x3 + x4 = 10
The variable ݔସ which we have added to the LHS of (1) is called a Slack Variable.
Here, we can subtract a new variable, say x5 ³ 0 from the LHS of (2) so that the LHS of
It should be emphasized here that slack and surplus variables are as much a part of the
original problem as the variables used in the formulation of the linear program. These
variables can remain positive throughout and their values in the optimal solution give useful
information about the problem. Slack variable corresponds to unused resource whereas
surplus variable corresponds to the amount by which a solution value exceeds a resource.
In some situations, it may become necessary to introduce a variable that that can assume
both positive and negative values. For example, consider an investment problem where an
investor has $100 cash on hand and can borrow money if necessary for investment. If x1
denotes the amount invested, then the investment constraint can be written as:
Here, x2 can assume positive or negative values depending on whether x2 represents money
Since the standard form requires all the variables to be nonnegative, an unrestricted variable
is generally replaced by the difference of two nonnegative variables. In other words, x2 may
Then the value of x2 is positive or negative depending on whether x2¢ is larger or smaller
than x2¢¢ .
Since the standard form requires the right hand side constants of each constraint to be
nonnegative, we multiply each term of a constraint with –1, if a constraint is having negative
33
right hand side constant. It is to be noted that when either sides of an inequality is multiplied
by –1, the inequality will change to its opposite.
2 x1 - x2 + 5 x3 ³ -8 …………. (3)
Right hand side constant of (3) is negative. When we multiply each term of (3) by –1, it
becomes,
-2 x1 + x2 - 5x3 £ 8
Example-2.2
Minimize Z = x1 + 2 x2 - 3x3
Subject to 3x1 + x2 + 5 x3 £ 2
x2 - x3 =5
5 x1 + 3x2 + 8 x3 ³ 10
x1 + 2 x2 + 3x3 ³ -6
x1 , x3 ³ 0 ; x2 unrestricted
Solution:
Since the variable x2 is unrestricted, it may be replaced as x2 = x2¢ - x2¢¢ , where both x2¢
and x2¢¢ are nonnegative. Corresponding change may be done throughout the problem. That
is, x2 should be replaced by x2¢ - x2¢¢ in the objective function as well as in the constraints.
x2¢ - x2¢¢ - x3 = 5
5 x1 + 3 x2¢ - 3 x2¢¢ + 8 x3 - x5 = 10
x1 , x2¢ , x2¢¢ , x3 , x4 , x5 , x6 ³ 0
Basic Variables
equation if it appears with a unit coefficient in that equation and zero in all other equations.
Those variables which are not basic are called non-basic variables.
By applying the elementary row operations, a given variable can be made a basic variable.
In order to get a canonical system, a sequence of such elementary row operations must be
performed on the system of equations so that there exists at least one basic variable in each
equation. The number of basic variables is decided by the number of equations in the system.
Basic Solution
The solution obtained from a canonical system by setting the non-basic variables to zero and
solving for the basic variables is called a basic solution. Since the values of all the variables
35
are nonnegative, this basic solution is also a feasible solution. We call such basic solutions
basic feasible solutions.
A basic feasible solution is a basic solution in which the values of the basic variables are
nonnegative.
Note that a basic feasible solution may not necessarily optimise the objective function.
Example-2.3
x1 + x2 + 4 x3 + 2 x4 + 3x5 = 8
4 x1 + 2 x2 + 2 x3 + x4 + 6 x5 = 4
(i) A Basic Feasible Solution
Hence we get:
x1 + 4 x3 = 8
4 x1 + 2 x3 = 4
The solution is unique with x1 = 0, x3 = 2 . Since the basic variables are non-negative, this
36
(ii) An Infeasible Basic Solution
Hence we get:
x1 + x2 = 8
4 x1 + 2 x2 = 4
Since the basic variable x1 is negative, this solution is a basic infeasible solution.
Simplex Method
A naïve approach to solve a linear program (which has an optimal solution) would be to
generate all possible basic feasible solutions through canonical reduction and determine the
basic feasible solution which optimizes the objective function. But this is tiresome and
sometimes awful. We use simplex method which is more efficient in finding the optimal
solution by examining only a fraction of the total number of basic feasible solutions.
The simplex method is developed by G.B.Dantzig. It uses an iterative procedure for solving
linear programming problems expressed in standard form. Here, the basic objective is to find
a basic feasible solution to a given LP problem.
Before starting with the simplex tableau, the following requirements are to be met.
37
a. All the constraints should be expressed as equations
b. The RHS of each constraint should be non-negative
c. All the decision variables must be non-negative
d. The objective function should be in maximization form
Notes:
a. The first three conditions given above make the LPP in standard form. The fourth
condition is not necessary; simplex method may be used to LPP with objective
functions in minimization form as well. But, the condition is insisted for convenience
sake. If the given problem is of minimization type, it may be converted to the
maximization type by changing the sign of the objective function, without making
any change in the constraints. For example, if the problem is to Minimize
Z = 3x1 + 2 x2 , then it may be converted to a problem of maximization type as:
Maximize -Z = -3x1 - 2 x2
b. Three types of additional variables are used in simplex method. Two of them,
namely, slack variable and surplus variable, had mentioned earlier. Another type of
additional variables, called artificial variables, is used independently or along with
surplus variables to get an initial feasible solution.
Let us consider now the case with maximisation type problems. The Simplex procedure
involves the following steps:
choice of the initial solution means that we initially assume that objective functional value
is zero. In terms of the graphical method we start at the origin so as to move along the best
possible route to the optimal solution.
38
Step 2: Setting up the initial Simplex tableau
In this step we arrange the various matrices and vectors involved in the matrix form of the
linear programming problem in the simplex tableau. This tableau contains all the information
about the current basic variables and their corresponding values, the optimality status of the
solution. The method then continues to use the principle of the Gauss-Jordan procedure to
compute the next improved solution.
A typical initial simplex tableau has the form shown in Table 2.2
… … … … … … … … … … …
Zj 0 0 … 0 0 0 … 0
Cj c1 c2 … cn 0 0 … 0
0
Z j - Cj -c1 -c2 … -cn 0 0 … 0
In the tableau:
i. The top row shows both the n + m decision and slack/surplus/artificial variables
x1 , x2 ,..., xn+1 , ..., xn+ m as labels for the corresponding columns
ii. The middle rows shows the coefficients of the constraints
iii. The last but second row shows the coefficients of the objective function
39
iv. The last but first row shows the sum of the products of the entries in the second
column with the entries in the corresponding columns
v. The last row is Z j - C j , obtained by subtracting corresponding entry in the last but
second row from the corresponding entry in the last but first row
vi. The extreme left column shows the basic variables
vii. The second column shows the coefficients of the basic variables in the objective
function; and
viii. The last column shows the constant term in the RHS of each constraint.
Note that:
a. Each basic variable appears in exactly one equation in which it has a coefficient 1.
b. The column it labels has all zeros except in the row in which it is shown as a basic
variable.
c. Each basic variable has a value shown on the extreme right column.
40
of the last column and positive coefficients of the pivot column. Thus we compare only
positive ratios. Once we have computed all positive ratios, we choose the row which has the
minimum ratio. This is called the pivot row. The leaving variable is the one which
corresponds to the pivot row on the left hand side of the tableau (among the basic variables).
The element at the intersection of the pivot row and pivot column is called the pivot element.
It is normally highlighted by circling it (we will highlight it by enclosing by a square). It is
necessary to identify this element in order to move on to the next step.
nonnegative), we can extract the solution from the final tableau. The optimal solution
consists of the basic decision variables appearing in the extreme left column. The
corresponding values appear in the extreme right column. Any decision variable which is
not in the basic set has a zero value.
We will now solve the following linear programming problems to illustrate the
implementation of the complete Simplex algorithm.
ii. Unboundedness
If all the elements in the key column are negative, then it indicates the existence
of unbounded solution. In general, an unbounded solution occurs due to the
wrong formulation of a problem within the constraints set, and thus needs
reformulation.
v. Problem of Degeneracy
In order to get a basic feasible solution for an LPP, the number of non-zero valued
variables should be equal to the number of constraints. If one of the basic
variables is zero, this cannot be achieved. In such cases, we cannot go to the next
simplex table, as the variable to be replaced is already zero. This situation is
called degeneracy. That is, a basic feasible solution of an LPP is said to be
degenerate if at least one of the basic variables is zero. Degeneracy may appear
in an LPP either in the first iteration or in any subsequent iteration. In some cases,
the degeneracy that appeared in the first iteration may disappear in the subsequent
stages. The degeneracy that appear in later iterations can be get avoided by
properly choosing the minimum ratio.
42
Example-2.4
Solve the following LPP using Simplex Method
Maximize Z = 7 x1 + 5 x2
Subject to
x1 + 2 x2 £ 6
4 x1 + 3x2 £ 12
x1 , x2 ³ 0
Solution:
The standard form is:
Maximize Z = 7 x1 + 5 x2 + 0 x3 + 0 x4
Subject to x1 + 2 x2 + x3 = 6
4 x1 + 3x2 + x4 = 12
x1 , x2 , x3 , x4 ³ 0
Table-1
XB CB x1 x2 x3 x4 b b / x1
x3 0 1 2 1 0 6 6
x4 0 4 3 0 1 12 3®
Zj 0 0 0 0
Cj 7 5 0 0
Z j - Cj -7 –5 0 0
In table-1, all Z j - C j ³ 0 .Hence the solution is not optimal. x1 enters the basis and x4
43
Table-2
XB CB x1 x2 x3 x4 b
x3 0 0 5/4 1 –1/4 3
x1 7 ͳ 3/4 0 1/4 3
Zj 7 21/4 0 7/4
Cj 7 5 0 0
Z j - Cj Ͳ 1/4 0 7/4
Solution is: x1 = 3, x2 = 0; Z = 21
Example-2.5
Maximize Z = 3x1 + 2 x2
Subject to
x1 + x2 £ 4
x1 - x2 £ 2
x1 , x2 ³ 0
Solution:
Maximize Z = 3x1 + 2 x2 + 0 x3 + 0 x4
44
Subject to x1 + x2 + x3 = 4
x1 - x2 + x4 = 2
x1 , x2 , x3 , x4 ³ 0
Table-1
XB CB x1 x2 x3 x4 b b / x1
x3 0 1 1 1 0 4 4
x4 0 1 –1 0 1 2 2®
Zj 0 0 0 0
Cj 3 2 0 0
Z j - Cj -3 –2 0 0
In table-1, all Z j - C j ³ 0 .Hence the solution is not optimal. x1 enters the basis and x4
Table-2
XB CB x1 x2 x3 x4 b b / x2
x3 0 0 2 1 –1 2 1®
x1 3 1 –1 0 1 2 –
Zj 3 –3 0 3
Cj 3 2 0 0
Z j - Cj 0 -5 0 3
In table-2, all Z j - C j ³ 0 .Hence the solution is not optimal. x2 enters the basis and x3
45
Table-3
XB CB x1 x2 x3 x4 b
x2 2 0 1 1/2 –1/2 1
x1 3 1 0 1/2 1/2 3
Zj 3 2 5/2 1/2
Cj 3 2 0 0
Z j - Cj Ͳ 0 5/2 1/2
x1 = 3, x2 = 1; Z = 11
Example-2.6
Maximize Z = 6 x1 + 4 x2
Subject to
-2 x1 + x2 £ 2
x1 - x2 £ 2
3x1 + 2 x2 £ 9
x1 , x2 ³ 0
Solution:
Maximize Z = 6 x1 + 4 x2 + 0 x3 + 0 x4 + 0 x5
Subject to -2 x1 + x2 + x3 = 2
x1 - x2 + x4 = 2
46
3x1 + 2 x2 + x5 = 9
x1 , x2 , x3 , x4 , x5 ³ 0
Table-1
XB CB x1 x2 x3 x4 x5 b b / x1
x3 0 –2 1 1 0 0 2 –
x4 0 1 –1 0 1 0 2 2®
x5 0 3 2 0 0 1 9 3
Zj 0 0 0 0 0
Cj 6 4 0 0 0
Z j - Cj -6 –4 0 0 0
In table-1, all Z j - C j ³ 0 .
Hence the solution is not optimal. x1 enters the basis and x4 leaves the basis.
Table-2
XB CB x1 x2 x3 x4 x5 b b / x2
x3 0 0 –1 1 2 0 6 –
x1 6 1 –1 0 1 0 2 –
x5 0 0 5 0 –3 1 3 3/ 5 ®
Zj 6 –6 0 6 0
Cj 6 4 0 0 0
Z j - Cj 0 -10 0 6 0
In table-2, all Z j - C j ³ 0 .Hence the solution is not optimal. x2 enters the basis and x5
47
Table-3
XB CB x1 x2 x3 x4 x5 b
Zj 6 4 0 0 2
Cj 6 4 0 0 0
Z j - Cj 0 0 0 0 2
Example-2.7
Maximize Z = 3x1 + 5 x2 + 4 x3
Subject to
2 x1 + 3x2 £ 8
2 x2 + 5 x3 £ 10
3x1 + 2 x2 +4x3 £ 15
x1 , x2 , x3 ³ 0
Solution:
48
Maximize Z = 3x1 + 5 x2 + 4 x3 + 0 x4 + 0 x5 + 0 x6
Subject to 2 x1 + 3x2 + x4 =8
2 x2 + 5 x3 + x5 = 10
3x1 + 2 x2 + 4 x3 + x6 = 15
x1 , x2 , x3 , x4 , x5 , x6 ³ 0
Table-1
XB CB x1 x2 x3 x4 x5 x6 b b / x1
x4 0 2 3 0 1 0 0 8 8/3 ®
x5 0 0 2 5 0 1 0 10 5
x6 0 3 2 4 0 0 1 15 15/2
Zj 0 0 0 0 0 0
Cj 3 5 4 0 0 0
Z j - Cj –3 -5 –4 0 0 0
In table-1, all Z j - C j ³ 0 . Hence the solution is not optimal. x2 enters the basis and x4
Table-2
XB CB x1 x2 x3 x4 x5 x6 b b / x3
Zj 10/3 5 0 5/3 0 0
Cj 3 5 4 0 0 0
Z j - Cj 1/3 0 -4 5/3 0 0
In table-2, all Z j - C j ³ 0 . Hence the solution is not optimal. x3 enters the basis and x5
Cj 3 5 4 0 0 0
In table-3, all Z j - C j ³ 0 . Hence the solution is not optimal. x1 enters the basis and x6
Table-4
XB CB x1 x2 x3 x4 x5 x6 b
Cj 3 5 4 0 0 0
50
Example-2.8
Maximize Z = 2 x1 + x2
Subject to
x1 - x2 £ 2
2 x1 - x2 £ 3
x1 , x2 ³ 0
Solution:
The standard form is:
Maximize Z = 2 x1 + x2 + 0 x3 + 0 x4
Subject to x1 - x2 + x3 =2
2 x1 - x2 + x4 =3
x1 , x2 , x3 , x4 ³ 0
Table-1
XB CB x1 x2 x3 x4 b b / x1
x3 0 1 –1 1 0 2 2
x4 0 2 –1 0 1 3 3
®
2
Zj 0 0 0 0
Cj 2 1 0 0
Z j - Cj -2 –1 0 0
In table-1, all Z j - C j ³ 0
Hence the solution is not optimal. x1 enters the basis and x4 leaves.
51
Table-2
XB CB x1 x2 x3 x4 b b / x1
Zj 2 –1 0 1
Cj 2 1 0 0
Z j - Cj 0 -2 0 1
Example-2.9
Solve the following LPP using Simplex Method
Maximize Z = 4 x1 + 4 x2
Subject to
x1 + 2 x2 £ 10
x1 + x2 £6
x1 £4
x1 , x2 ³ 0
Solution:
The standard form is:
Maximize Z = 4 x1 + 4 x2 + 0 x3 + 0 x4 + 0 x5
Subject to x1 + 2 x2 + x3 = 10
x1 + x2 + x4 =3
x1 + x5 =4
x1 , x2 , x3 , x4 , x5 ³ 0
52
Table-1
XB CB x1 x2 x3 x4 x5 b b / x1
x3 0 1 2 1 0 0 10 10
x4 0 1 1 0 1 0 6 6
x5 0 1 0 0 0 1 4 4®
Zj 0 0 0 0 0
Cj 4 4 0 0 0
Z j - Cj -4 –4 0 0 0
In table-1, all Z j - C j ³ 0 . Hence the solution is not optimal. x1 enters the basis and x5
leaves.
Table-2
XB CB x1 x2 x3 x4 x5 b b / x2
x3 0 0 2 1 0 –1 6 3
x4 0 0 1 0 1 –1 2 2®
x1 4 1 0 0 0 1 4 –
Zj 4 0 0 0 4
Cj 4 4 0 0 0
Z j - Cj 0 -4 0 0 4
In table-2, all Z j - C j ³ 0 .
Hence the solution is not optimal. x2 enters the basis and x4 leaves.
53
Table-3
XB CB x1 x2 x3 x4 x5 b
x3 0 0 0 1 –2 1 2
x2 4 0 1 0 1 –1 2
x1 4 1 0 0 0 1 4
Zj 4 4 0 4 0
Cj 4 4 0 0 0
Z j - Cj 0 0 0 4 0
Exercise 2
1. What is simplex method? What is it used for?
2. Write a general LPP in standard form.
3. Write the main features of an LPP in standard form.
4. Write a general LPP in the standard form in its matrix-vector form.
5. Define slack and surplus variables.
6. Define the terms:
i. Basic variable
ii. Basic solution
iii. Feasible solution
iv. Basic feasible solution
54
7. Write the simplex procedure.
8. Explain the terms:
i. Pivot column
ii. Pivot row
iii. Minimum ratio
iv. Pivot element
v. Incoming vector
vi. Outgoing vector
9. Explain the following with respect to a simplex table:
i. Infeasibility
ii. Unboundedness
iii. Degeneracy
iv. Alternate solution
10. Transform the following linear programs to the standard form:
i. Maximize Z = x1 + 2 x2
Subject to x1 + 2 x2 £ 4
x1 + 7 x2 £ 14
x1 - x2 £1
x1 , x2 ³ 0
ii. Minimize Z = 3x1 + 2 x2 + 10 x3
Subject to - x1 + x2 + 4 x3 ³ 4
x1 + 4 x3 ³1
x1 - x2 + 2 x3 £ 6
x1 , x2 , x3 ³ 0
iii. Minimize Z = x1 + x2 + 2 x3 + x4 + x5
Subject to - x1 + x2 + x4 + x5 = 10
3x1 - x2 - 2 x3 + 4 x4 + 2 x5 ³ 3
55
x1 , x2 , x3 , x4 , x5 ³ 0
Subject to - x1 - 2 x2 £ -3
3x1 - 2 x2 ³ 3
x1 - 4 x2 ³ -2
x1 ³ 10
x1 , x2 ³ 0
v. Minimize Z = 2 x1 + 2 x2 + 7 x3
Subject to 8 x1 + 2 x2 + 5 x3 £1
3x1 + 10 x2 + 10 x3 £ -5
2 x1 - x2 + 4 x3 ³ -7
4 x1 - x2 ³1
x1 , x2 , x3 ³ 0
vi. Maximize Z = 4 x1 + 7 x2
Subject to 3x1 + x2 £ 4
x1 + x2 £ 2
x1 - 2 x2 £ 10
x1 ³ 0, x2 unrestricted
56
i. Reduce the system to canonical form with respect to ( x1 , x2 ) as basic variables.
holding x2 and x3 zero. What will be the net change in the objective function?
iv. Find the new basic feasible solution when x1 is increased to its maximum value
found in (iii).
v. Is the new basic feasible solution obtained in (iv) optimal? Why or why not?
57
Subject to ݔଵ ͺ
ݔଶ ͳͲ
ͷݔଵ ͵ݔଶ Ͷͷ
ݔଵ ǡ ݔଶ Ͳ
58
16. Use the big ܯsimplex method to show that the following LPP is infeasible:
Minimize ܼ ൌ ʹݕଵ Ͷݕଶ
Subject to Ͷݕଵ െ ͵ݕଶ ʹ
െݕଵ ݕଶ ͵
ݕଵ ǡ ݕଶ Ͳ
17. Consider the following linear program:
Minimize ܼ ൌ ʹݔଵ െ ݔଶ ʹݔଷ
Subject to െݔଵ ݔଶ ݔଷ ൌ Ͷ
െݔଵ ݔଶ െ ݔଷ
ݔଵ Ͳǡ ݔଶ Ͳǡ ݔଷ unrestricted in sign
i. Convert the problem to a standard linear program in non-negative variables
ii. Solve the standard linear program obtained in (i) using big ܯsimplex method.
18. Consider the following set of constraints:
ݔଵ ʹݔଶ െ ʹݔଷ Ͷݔସ ͶͲ
ʹݔଵ െ ݔଶ ݔଷ ʹݔସ ͺ
Ͷݔଵ െ ʹݔଶ ݔଷ െ ݔସ ͳͲ
ݔଵ ǡ ݔଶ ǡ ݔଷ ǡ ݔସ Ͳ
============= =============
59