LESSON 1. Simplex Method

1.1 Introduction

Simplex method was developed by George B. Datzing in 1947 is an iterative and an efficient method for solving linear programming problems. It is an algebraic procedure that starts at a feasible extreme point of the simplex(or convex), normally the origin, and systematically moves from one feasible extreme point to another until an optimum(or optimal) extreme point is located. At each iteration, the procedure tests the one extreme (corner) point for optimality, and if not optimum, chooses another extreme point, of the convex set that is formed by the constraints and non-negativity conditions of the linear programming problem. Since the number of extreme points (i.e., corners or vertices) of the convex set of all feasible solutions is finite, the method leads to the optimum extreme point (i.e., optimum or optimal solution) in a finite number of steps or indicates that there exists an unbounded solution.

1.2 Basic Definitions:

Slack Variable:

It is a variable that is added to the left-hand side of a less than or equal to type constraint to convert the constraint into an equality. In economic terms, slack variables represent left-over or unused capacity.

Specifically:

                  ai1x1 + ai2x2 + ai3x3 + .........+ ainxn ≤  bi

can be written as
              ai1x1 + ai2x2 + ai3x3 + .........+ ainxn + si = bi     
 Where i = 1, 2, ..., m

Surplus variable:

It is a variable subtracted from the left-hand side of a greater than or equal to type constraint to convert the constraint into equality. It is also known as negative slack variable. In economic terms, surplus variables represent over fulfillment of the requirement.

Specifically:
                  ai1x1 + ai2x2 + ai3x3 + .........+ ainxn ≥ bi

can be written as
             ai1x1 + ai2x2 + ai3x3 + .........+ ainxn - si = bi

Where i = 1, 2, ..., m

Artificial variable:

It is a non negative variable introduced to facilitate the computation of an initial basic feasible solution. In other words, a variable added to the left-hand side of a greater than or equal to type constraint to convert the constraint into equality is called an artificial variable.

1.3 Canonical Form:

The general formulation of L.P.P can always be put in the following form:

Maximize z = c1x1 + c2x2 +……cnxn subject to the constraints

ai1x1 + ai2x2 + ai3x3 + .........+ ainxn ≤ bi,      i =1,2,3,....m

x1,x2,x3,....xn ≥ 0

by making use of some elementary transformations. This form of L.P.P. is called the canonical form of L.P.P.

1.4 Characteristic of Canonical form:

(i) The objective function is of the maximization type

Minimization of f(x) = -Maximization (-f(x))

If we have the objective function as min z then change that as min z = -Max (-z ).

(ii) All the constraints are of the “≤ “type, except for the non-negative restriction

If we have an inequality of “≥” type, multiply both sides by -1. if the constraints is an equation say

                     ai1x1 + ai2x2+………ainxn = bi

write it as

                 ai1x1 + ai2x2+………ainxn≤ bi   and

                 ai1x1 + ai2x2+………ainxn ≥ bi  (or -ai1x1 - ai2x2-………-ainxn ≤ - bi)

(iii) All the variables are non-negative

If a variable is unrestricted in sign ((i.e.) positive, negative or zero) then replace that variable by difference between two non-negative variables. If xj is unrestricted in sign replace xj by xj = where both and  are both non-negative.

 Matrix Notation of Canonical form:

              In matrix notation the canonical form of L.P.P can be expressed as:

                        Maximize or Minimize z = cx               (Objective Function)

Subject to the constraints:                (Constraints)

                                 AX ≤ b, X ≥ 0              (Non-negative restrictions)

1.5 Standard Form:

The general formulation of L.P.P can always be put in the following form:

Maximize z = c1x1 + c2x2 +……cnxn subject to the constraints

ai1x1 + ai2x2 + ai3x3 + .........+ ainxn = bi,      i =1,2,3,....m

x1,x2,x3,....xn ≥ 0

is known as in Standard form.

1.6 Characteristic of Standard form:

(i) The objective function is of the maximization type.

(ii) All the constraints are expressed in the form of equations except for the non-negative constraints.

      If the constraints are of “≤” type add the slack variable to the left hand side and if the constraints are of “≥” type subtract surplus variable to the left hand side.

(iii)  The right hand side of each constraint equation is of non-negative.

1.7 Matrix Notation of Standard form:  

In matrix notation the Standard form of L.P.P can be expressed as:

                        Maximize or Minimize z = cx               (Objective Function)

       Subject to the constraints:                (Constraints)

                                 AX = b, X ≥ 0              (Non-negative restrictions)

Basic Solution, Basic and Non- basic variable:

Given a system of m linear equations with n variables (m < n). The solution obtained by setting (n – m) variables equal to zero and solving for the remaining m variables is called a basic solution.

The m variables are called basic variables and they form the basic solution. The n-m variables which are put to zero are called as non-basic variables.

Degenerate basic solution:

A basic solution is said to be a degenerate basic solution if one or more of the basic variables are zero.

Basic Feasible solution:

A feasible solution which is also basic is called a Basic Feasible solution.

 1.8 ALGORITHM OF SIMPLEX METHOD

 Assuming the existence of an initial basic feasible solution, an optimal solution to any L.P.P by simplex method is found as follows:

 Step 1: Check whether the objective function is to be maximized or minimized. If it is to be minimized, then convert it into a problem of maximization, by

Minimize Z = -Maximize (-Z)

Step 2: Check whether all bi’s are positive. If any of the bi’s is negative, multiply both sides of that constraint by -1 so as to make its right hand side positive.

Step 3: By introducing slack / surplus variables, convert the inequality constraints into equations and express the given L.P.P into its standard form.

Step 4: Find an initial basic feasible solution and express the above information conveniently in the following simplex table.

 

Step 5: Compute the net evaluations Zj –Cj (j= 1,2,3…..n) by using the relation

Zj –Cj = CBaj- Cj

Examine the sign of Zj –Cj

a)     If all Zj –Cj ≥ 0 then the current basic solution XB is optimal.

b)    If atleast  Zj –Cj < 0 then the current basic solution XB is not optimal, go to next step.

 Step 6: (To find the entering variable)

The entering variable is the non-basic variable corresponding to the most negative value Zj –Cj. Let it be xr for some j = r. The entering variable column is known at the bottom. If more than one variable has the same most negative Zj –Cj, any of these variables may be selected arbitrarily as the entering variable.

 Step 7: (To find the leaving variable)

Compute the ratio;

(i.e) the ratio between the solution column and the entering variable column by considering only the positive denominators.

a)     If all air ≤ 0, then there is an unbounded solution to the given L.P.P.

b)    If all air > 0, then the leaving variable is the basic variable corresponding to the minimum ratio θ. If,

  

then the basic variable xk leaves the basis. The leaving variable row is called the key row or pivot row or pivot equation and the element at the intersection of the pivot column and pivot row is called the pivot element or key element or leading element.

Step 8:

Drop the leaving variable and introduce the entering variable along with its associated value under CB column. Convert the pivot element to unity by dividing the pivot equation by the pivot element and all other elements in its column to zero by making use of 

  •  New pivot equation = old pivot equation / pivot element

  •  New equation (all other rows including Zj –Cj row)

    New equation = (Corresponding element) X New pivot equation

Step 9: Go to step 5 and repeat the procedure until either an optimum solution is obtained or there is an indication of an unbounded solution. 

 Example:

Maximize z = 3x1 + 2x2

Subject to

-x1 + 2x2 ≤ 4
3x1 + 2x2 ≤  14
   x1 – x2 ≤  3

x1, x2 ≥ 0

Solution:

First, convert every inequality constraints in the LPP into an equality constraint, so that the problem can be written in a standard from. This can be accomplished by adding a slack variable to each constraint. Slack variables are always added to the less than type constraints.

 Converting inequalities to equalities

-x1 + 2x2 + x3 = 4
3x1 + 2x2 + x4 = 14
x1 – x2 + x5 = 3
x1, x2, x3, x4, x5 ≥  0

where x3, x4 and x5 are slack variables.

Since slack variables represent unused resources, their contribution in the objective function is zero. Including these slack variables in the objective function, we get

Maximize z = 3x1 + 2x2 + 0x3 + 0x4 + 0x5

Initial basic feasible solution

Now we assume that nothing can be produced. Therefore, the values of the decision variables are zero. x1 = 0, x2 = 0, z = 0

When we are not producing anything, obviously we are left with unused capacity
x3 = 4, x4 = 14, x5 =

We note that the current solution has three variables (slack variables x3, x4 and x5) with non-zero solution values and two variables (decision variables x1 and x2) with zero values. Variables with non-zero values are called basic variables. Variables with zero values are called non-basic variables.

Iteration 1:

    

cj

3

2

0

0

0

    

cB

Basic variables
B

x1

x2

x3

x4

x5

Solution values
b (=XB)

0

x3

-1

2

1

0

0

4

0

x4

3

2

0

1

0

14

0

x5

1

-1

0

0

1

3

zj-cj

 

-3

-2

0

0

0

 

 

a11 = -1, a12 = 2, a13 = 1, a14 = 0, a15 = 0, b1 = 4
a21 = 3, a22 = 2, a23 = 0, a24 = 1, a25 = 0, b2 = 14
a31= 1, a32 = -1, a33 = 0, a34 = 0, a35 = 1, b3 = 3

Calculating values for the index row (zj – cj)

z1 – c1 = (0 × (-1) + 0 × 3 + 0 × 1) - 3 = -3
z2 – c2 = (0 × 2 + 0 × 2 + 0 × (-1)) - 2 = -2
z3 – c3 = (0 × 1 + 0 × 0 + 0× 0) - 0 = 0
z4 – c4 = (0 × 0 + 0 × 1 + 0 × 0) - 0 = 0
z5 – c5 = (0 × 0 + 0×0 + 0×1) – 0 = 0

Choose the smallest negative value from zj – cj (i.e., – 3). So column under x1 is the key column.
Now find out the minimum positive value
Minimum (14/3, 3/1) = 3
So row x5 is the key row.
Here, the pivot (key) element = 1 (the value at the point of intersection).
Therefore, x5 departs and x1 enters.

We obtain the elements of the next table using the following rules:

    1. If the values of zj – cj are positive, the inclusion of any basic variable will not increase the value of the objective function. Hence, the present solution maximizes the objective function. If there are more than one negative values, we choose the variable as a basic variable corresponding to which the value of zj – cj is least (most negative) as this will maximize the profit.

    2. The numbers in the replacing row may be obtained by dividing the key row elements by the pivot element and the numbers in the other two rows may be calculated by using the formula:

Calculating values for Iteration 2

 x3 row

a11 = -1 – 1 × ((-1)/1) = 0
a12 = 2 – (-1) × ((-1)/1) = 1
a13 = 1 – 0 × ((-1)/1) = 1
a14 = 0 – 0 × ((-1)/1) = 0
a15 = 0 – 1 × ((-1)/1) = 1
b1 = 4 – 3 × ((-1)/1) = 7

x4 row

a21 = 3 – 1× (3/1) = 0
a22 = 2 – (-1) × (3/1) = 5
a23 = 0 – 0 × (3/1) = 0
a24 = 1 – 0 × (3/1) = 1
a25 = 0 – 1 × (3/1) = -3
b2 = 14 – 3 × (3/1) = 5

x1 row

a31 = 1/1 = 1
a32 = -1/1 = -1
a33 = 0/1 = 0
a34 = 0/1 = 0
a35 = 1/1 = 1
b3 = 3/1 = 3

Iteration 2:

 

cj

3

2

0

0

0

 

cB

Basic variables B

x1

x2

x3

x4

x5

Solution values
b (= XB)

0

x3

0

1

1

0

1

7

0

x4

0

5

0

1

-3

5

3

x1

1

-1

0

0

1

3

zj-cj

 

0

-5

0

0

3

 

 

Calculating values for the index row (zj – cj)

z1 – c1 = (0 × 0 + 0 × 0 + 3 × 1) - 3 = 0
z2 – c2 = (0 × 1 + 0 × 5 + 3 × (-1)) – 2 = -5
z3 – c3 = (0 × 1 + 0 × 0 + 3 × 0) - 0 = 0
z4 – c4 = (0 × 0 + 0 × 1 + 3 × 0) - 0 = 0
z5 – c5 = (0 × 1 + 0 × (-3) + 3 × 1) – 0 = 3

Key column = x2 column
Minimum (7/1, 5/5) = 1
Key row = x4 row
Pivot element = 5
x4 departs and x2 enters.

Calculating values for table 3

x3 row

a11 = 0 – 0× (1/5) = 0
a12 = 1 – 5 × (1/5) = 0
a13 = 1 – 0 × (1/5) = 1
a14 = 0 – 1× (1/5) = -1/5
a15 = 1 – (-3) × (1/5) = 8/5
b1 = 7 – 5 × (1/5) = 6

x2 row

a21 = 0/5 = 0
a22 = 5/5 = 1
a23 = 0/5 = 0
a24 = 1/5
a25 = -3/5
b2 = 5/5 = 1

x1 row

a31 = 1 – 0 × (-1/5) = 1
a32 = -1 – 5× (-1/5) = 0
a33 = 0 – 0 × (-1/5) = 0
a34 = 0 – 1 × (-1/5) = 1/5
a35 = 1 – (-3) × (-1/5) = 2/5
b3 = 3 – 5 × (-1/5) = 4

Note: Don't convert the fractions into decimals, because many fractions cancel out during the process while the conversion into decimals will cause unnecessary complications.

Final iteration:

 

cj

3

2

0

0

0

 

cB

Basic variables
B

x1

x2

x3

x4

x5

Solution values
b (= XB)

0

x3

0

0

1

-1/5

8/5

6

2

x2

0

1

0

1/5

-3/5

1

3

x1

1

0

0

1/5

2/5

4

zj-cj

 

0

0

0

1

0

 

 

Result:

Since all the values of zj – cj are positive, this is the optimal solution.
x1 = 4, x2 = 1

                              Max z = 3 X 4 + 2 X 1 = 14.

The largest profit of Rs.14 is obtained, when 1 unit of x2 and 4 units of x1 are produced. The above solution also indicates that 6 units are still unutilized, as shown by the slack variable x3 in the XB column.

Minimization Case:

 In the previous section, the simplex method was applied to linear programming problems where the objective was to maximize the profit with less than or equal to type constraints. In many cases, however, constraints may of type ≥ or = and the objective may be minimization (e.g., cost, time, etc.). Thus, in such cases, simplex method must be modified to obtain an optimal policy.

Consider the general linear programming problem

Minimize z = c1x1 + c2x2 + c3x3 + .........+ cnxn

subject to

a11x1 + a12x2 + a13x3 + .........+ a1nxn ≥ b1
a21x1 + a22x2 + a23x3 + .........+ a2nxn≥  b2
................................................................
   am1x1 + am2x2 + am3x3 + .........+ amnxn≥  bm
x1, x2,....., xn≥ 0

Changing the sense of the optimization

             Any linear minimization problem can be viewed as an equivalent linear maximization problem, and vice versa.

Min. z = c1x1 + c2x2 + c3x3 + .........+ cnxn

It can be written as

Max. z = - (c1x1 + c2x2 + c3x3 + .........+ cnxn)

Converting inequalities to equalities

             Introducing surplus variables (negative slack variables) to convert inequalities to equalities

a11x1 + a12x2 + a13x3 + .........+ a1nxn - s1 = b1
a21x1 + a22x2 + a23x3 + .........+ a2nxn - s2 = b2

….................................................................
    am1x1 + am2x2 + am3x3 + .........+ amnxn - sm = bm
x1, x2,....., xn ≥ 0
s1, s2,....., sm ≥ 0

An initial basic feasible solution is obtained by setting x1 = x2 =........ = xn = 0

-s1 = b1 or s1 = -b1
-s2 = b2 or s2 = -b2
 ..............................
  -sm = bm or sm = -bm

which is not feasible because it violates the non-negativity stipulation, (i.e., s1≥  0). Therefore, we need artificial variables.

After introducing artificial variables, the set of constraints can be written as

a11x1 + a12x2 + a13x3 + .........+ a1nxn - s1 + A1 = b1
a21x1 + a22x2 + a23x3 + .........+ a2nxn - s2 + A2 = b2
..............................................................................
am1x1 + am2x2 + am3x3 + .........+ amnxn - sm + Am = bm

x1, x2,....., xn ≥ 0
s1, s2,....., sm ≥ 0
A1, A2,....., Am ≥ 0

Now, an initial basic feasible solution can be obtained by setting all the decision and surplus variables to zero. Thus, an initial basic feasible solution to LPP is
       A1 = b1 , A2 = b2, ....., Am = bm

Now to obtain an optimal solution, we must drive out the artificial variables. The two methods to solve linear programming problems in such cases are:

  • Two Phase method

  • Big-M- method

LIMITATIONS OF SIMPLEX METHOD:

  • Inability to deal with multiple objectives.

  • Inability to handle problems with integer variables.

  • Solution methods to LP problems with integer or Boolean variables are still far less efficient than those which include continuous variables only.

Last modified: Thursday, 3 October 2013, 6:17 AM