Operations Research: Chapter 3 (I)
Operations Research: Chapter 3 (I)
Chapter 3 (i)
12/6/2018 BG 1
Chapter 3 The Simplex Method
The Linear Programming with two variables can be solved graphically. The graphical method
of solving linear programming problem is of limited application in the business problems as
the number of variables is substantially large. If the linear programming problem has larger
number of variables, the suitable method for solving is Simplex Method. The simplex method
is an iterative process, through which it reaches ultimately to the minimum or maximum value
of the objective function.
• Simplex: a linear-programming algorithm that can solve problems having more than two
decision variables.
• The simplex technique involves generating a series of solutions in tabular form, called
tableaus. By inspecting the bottom row of each tableau, one can immediately tell if it
represents the optimal solution. Each tableau corresponds to a corner point of the feasible
solution space. The first tableau corresponds to the origin. Subsequent tableaus are
developed by shifting to an adjacent corner point in the direction that yields the highest
(smallest) rate of profit (cost). This process continues as long as a positive (negative) rate
of profit (cost) exists.
12/6/2018 BG 2
3.1 LP Model in Equation Form
The development of the simplex method computations is facilitated by imposing
two requirements on the LP constraints.
1. All the constraints are equations with nonnegative RHS.
2. All the Variables are nonnegative.
Converting Inequalities into Equations with Nonnegative RHS
In an economic LP model, the RHS represents the availability of a resource, and the
LHS represents the usage of the resource by all the model activities (variables). The
excess amount of the RHS over the LHS yields the unused amount of the resource.
- To convert a (≤)-inequality to an equation, a nonnegative variable is added
to the LHS of the constraints.
E.g. A constraint 6x1 + 4x2 ≤ 24 is converted into 6x1 + 4x2 + s1 = 24, s1 ≥ 0 .
The nonnegative variable s1 is the slack variable (or unused amount) of the
resource.
12/6/2018 BG 3
A (≥)-constraint sets a lower limit on the economic activities of the LP, so that
the amount by which the LHS exceeds the minimum limit represents a surplus.
- To convert a (≥)-inequality to an equation, a nonnegative variable from the
LHS of the constraints.
E.g. A constraint x1 + x2 ≥ 800 is converted into x1 + x2 - S1 = 800, S1 ≥ 0 .
The nonnegative variable S1 is the surplus variable (or extra amount) of the
resource.
The final requirement is the nonnegative RHS of the resulting equation. If the
RHS of the equation happens to be negative, both sides of it is multiplied by -1.
12/6/2018 BG 4
3.2 Transition from Graphical to Algebraic Solution
- In the graphical method, space is intersection of the half spaces representing the
constraints.
- In the algebraic (simplex) method the solution space is represented by m simultaneous
linear equations (constraints) and n nonnegative variables.
m is always less than or equal to n.
If m = n, and the equations are consistent, the system has only one solution.
But if m < n (majority of LPs), then the system of equations will yield an infinite
number of solutions.
E.g. the equation x =2 has m = n = 1, and the solution is unique.
But the equation x + y =1 has m = 1 and n = 2, and it yields an infinite number of
solutions (any point on the straight line x + y = 1 is an solution).
The algebraic solution space (defined by m × n equations, m < n), basic solutions
correspond to the corner points in the graphical solution space. They are determined by
setting n-m variables equal to zero and solving the m equations for the remaining m
variables, provided the resulting solution is unique.
The maximum number of corner points is
12/6/2018 BG 5
Standard Form of LPP
A LPP can be expressed in its standard form as follows;
Maximize
z (x1, x2, …….. xn) = c1x1 + c2x2+ …………… + cnxn
Subject to
a11x1+a12x2+…………+a1nxn = b1
a21x1+a22x2+…………+a2nxn = b2
-
-
an1x1+an2x2+…………+amnxn = bm
Where,
m = no. of constraints
n = no. variables
x1, x2, x3, …….. xn ≥ 0
cj, bj, aij (i = 1, 2, ……. m and j = 1, 2, …….. n) are constructs.
xjs are DV (decision variables).
12/6/2018 BG 6
Standard form of LP problems must have following three characteristics:
1.Objective function should be of maximization or minimization type. If the function is
minimization type, it can converted into maximization type by multiplying it with -1.
y max y
min y = - max y
x
min y
2.All the constraints should be of equality type (done with ‘slack’ and ‘surplus’ variables).
3.All the decision variables should be nonnegative, xj ≥ 0. If xj is unrestricted in sign, its
expressed as xj = xj’ – xj’’ .
Canonical form of LP ?
12/6/2018 BG 7
Simplex Algorithm
The key solution concepts
• Solution Concept 1: the simplex method focuses on CPF solutions.
• Solution concept 2: the simplex method is an iterative algorithm (a
systematic solution procedure that keeps repeating a fixed series of
steps, called, an iteration, until a desired result has been obtained)
with the following structure:
12/6/2018 BG 8
Simplex algorithm
Initialization: setup to start iterations, including
finding an initial CPF solution
if no if yes stop
12/6/2018 BG 9
Simplex algorithm
• Solution concept 3: whenever possible, the initialization of the
simplex method chooses the origin point (all decision variables equal
zero) to be the initial CPF solution.
12/6/2018 BG 10
Simplex algorithm
• Solution concept 5: After the current CPF solution is
identified, the simplex method examines each of the
edges of the feasible region that emanate from this CPF
solution. Each of these edges leads to an adjacent CPF
solution at the other end, but the simplex method doesn’t
even take the time to solve for the adjacent CPF solution.
Instead it simply identifies the rate of improvement in Z
that would be obtained by moving along the edge. And
then chooses to move along the one with largest positive
rate of improvement.
12/6/2018 BG 11
Simplex algorithm
• Solution concept 6: A positive rate of improvement
in Z implies that the adjacent CPF solution is better
than the current one, whereas a negative rate of
improvement in Z implies that the adjacent CPF
solution is worse. Therefore, the optimality test
consists simply of checking whether any of the
edges give a positive rate of improvement in Z. if
none do, then the current CPF solution is optimal.
12/6/2018 BG 12
The simplex method in tabular form
• Steps:
1. Initialization:
a. transform all the constraints to equality by
introducing slack, surplus, and artificial variables as
follows:
≤ + slack (s)
= + Artificial (A)
Simplex method in tabular form
b. Construct the initial simplex tableau
A bm
Z Objective function coefficient Z
In different signs value
Simplex method in tabular form
2. Test for optimality:
Case 1: Maximization problem
the current BF solution is optimal if every coefficient in
the objective function row is nonnegative
Case 2: Minimization problem
the current BF solution is optimal if every coefficient in
the objective function row is nonpositive
12/6/2018 BG 15
Simplex method in tabular form
3. Iteration
Step 1: determine the entering basic variable by selecting the
variable (automatically a nonbasic variable) with the most negative
value (in case of maximization) or with the most positive (in case
of minimization) in the last row (Z-row). Put a box around the
column below this variable, and call it the “pivot column”
12/6/2018 BG 16
Simplex method in tabular form
• Step 2: Determine the leaving basic variable by applying the minimum
ratio test as following:
1. Pick out each coefficient in the pivot column that is strictly positive (>0)
2. Divide each of these coefficients into the right hand side entry for the same
row
3. Identify the row that has the smallest of these ratios
4. The basic variable for that row is the leaving variable, so replace that
variable by the entering variable in the basic variable column of the next
simplex tableau. Put a box around this row and call it the “pivot row”
12/6/2018 BG 17
Simplex method in tabular form
• Step 3: Solve for the new BF solution by using elementary row
operations (multiply or divide a row by a nonzero constant; add or
subtract a multiple of one row to another row) to construct a new
simplex tableau, and then return to the optimality test. The specific
elementary row operations are:
1. Divide the pivot row by the “pivot number” (the number in the
intersection of the pivot row and pivot column)
2. For each other row that has a negative coefficient in the pivot column,
add to this row the product of the absolute value of this coefficient and
the new pivot row.
3. For each other row that has a positive coefficient in the pivot column,
subtract from this row the product of the absolute value of this
coefficient and the new pivot row.
12/6/2018 BG 18
Simplex method
• Example I (All constraints are )
Solve the following problem using the simplex method
• Maximize
Z = 3X1+ 5X2
Subject to
X1 4
2 X2 12
3X1 +2X2 18
X1 , X2 0
12/6/2018 BG 19
Solution
• Initialization
1. Standard form
Maximize Z, Sometimes it is called
the augmented form of
Subject to
the problem because
Z - 3X1- 5X2 =0 the original form has
been augmented by
X1 + S1 = 4 some supplementary
2 X2 + S2 = 12 variables needed to
3X1 +2X2 + S3 = 18 apply the simplex
X1 , X2, S1, S2, S3 0 method
12/6/2018 BG 20
Definitions
• A basic solution is an augmented corner point solution.
• A basic solution has the following properties:
1. Each variable is designated as either a nonbasic variable or a basic variable.
2. The number of basic variables equals the number of functional constraints.
Therefore, the number of nonbasic variables equals the total number of
variables minus the number of functional constraints.
3. The nonbasic variables are set equal to zero.
4. The values of the basic variables are obtained as simultaneous solution of the
system of equations (functional constraints in augmented form). The set of
basic variables are called “basis”
5. If the basic variables satisfy the nonnegativity constraints, the basic solution is
a Basic Feasible (BF) solution.
12/6/2018 BG 21
Z - 3X1- 5X2 =0
Initial tableau X1
2 X2
+ S1
+ S2
= 4
= 12
Entering 3X1 +2X2 + S3 = 18
2. Initial tableau variable X1 , X2, S1, S2, S3 0
Basic X1 X2 S1 S2 S3 RHS
variable
S1 1 0 1 0 0 4
S2 0 2 0 1 0 12
S3 3 2 0 0 1 18
Z -3 -5 0 0 0 0
Optimality test
• By investigating the Z row of the initial tableau, we find that there are some
negative numbers. Therefore, the current solution is not optimal.
12/6/2018 BG 23
Iteration
12/6/2018 BG 24
Iteration
• Step 2: Determining the leaving variable by using the
minimum ratio test as following:
Pivot Column
Iteration
• Step 3: solving for the new BF solution by using
the eliminatory row operations as following:
1. New pivot row = old pivot row pivot number
Basic X1 X2 S1 S2 S3 RHS
variable
S1
X2 0 1 0 1/2 0 6
S3
Z
Note that X2 becomes in the basic
variables list instead of S2
Iteration
12/6/2018 BG 27
Iteration
This solution is not optimal, since there is a negative numbers in the Z row
Basic X1 X2 S1 S2 S3 RHS
variable
S1 1 0 1 0 0 4
X2 0 1 0 1/2 0 6
S3 3 0 0 -1 1 6
Z -3 0 0 5/2 0 30
Basic X1 X2 S1 S2 S3 RHS
variable
S1 0 0 1 1/3 -1/3 2
X2 0 1 0 1/2 0 6
X1 1 0 0 -1/3 1/3 2
Z 0 0 0 3/2 1 36
This solution is optimal; since there is no negative solution in the last row: basic
variables are X1 = 2, X2 = 6 and S1 = 2; the nonbasic variables are S2 = S3 = 0
Z = 36
Example 2: The Reddy Mikks Problem
Solution:
Writing in the standard form
The starting Tableau:
Pivot Column
• By investigating the Z row of the initial tableau, we find that there are some negative
numbers. Therefore, the current solution is not optimal.
• Step 1: Determine the entering variable by selecting the variable with the most negative in the
last row.
• From the initial tableau, in the Z row, the coefficient of x1 is -5 and the coefficient of x2 is -4;
therefore, the most negative is -5. Consequently, x1 is the entering variable.
• So the column with x1 is the pivot column.
Determining the leaving variable by using the minimum ratio test as following:
12/6/2018 BG 32
New pivot row = old pivot row pivot number
New row = old row – (the coefficient of this
row in the pivot column) × (new pivot row)
12/6/2018 BG 33
Now, the new basic solution is (x1, s2, s3, s4) and the new tableau becomes
- 2/3
There is a negative number (-2/3) in the z row. So the solution is still not
optimal. Now x2 becomes the entering variable.
12/6/2018 BG 34
Determining the leaving variable by using the minimum ratio test as following:
12/6/2018 BG 35
New pivot row = old pivot row pivot number
New row = old row – (the coefficient of this row in the pivot column) × (new pivot row)
12/6/2018 BG 36
The computation produces the following tableau.
Based on the optimality condition, none of the z-row coefficients associated with the
nonbasic variables, s1 and s2 are negative. Hence this tableau is optimal.
12/6/2018 BG 37
Interpretation of the optimal tableau:
The optimal values of the variables in the basic column are given in the right-hand-
side solution column.
12/6/2018 BG 38
Notes on the Simplex Tableau
1. In any Simplex tableau, the intersection of any basic variable with itself is always one and the
rest of the column is zeroes.
2. In any simplex tableau, the objective function row (Z row) is always in terms of the nonbasic
variables. This means that under any basic variable (in any tableau) there is a zero in the Z row.
For the non basic there is no condition ( it can take any value in this row).
3. If there is a zero under one or more nonbasic variables in the last tableau (optimal solution
tableau), then there is a multiple optimal solution.
4. When determining the leaving variable of any tableau, if there is no positive ratio (all the
entries in the pivot column are negative and zeroes), then the solution is unbounded.
5. If there is a tie (more than one variables have the same most negative or positive) in determining
the entering variable, choose any variable to be the entering one.
6. If there is a tie in determining the leaving variable, choose any one to be the leaving
variable. In this case a zero will appear in RHS column; therefore, a “cycle” will occur, this
means that the value of the objective function will be the same for several iterations.
7. A Solution that has a basic variable with zero value is called a “degenerate solution”.
8. If there is no Artificial variables in the problem, there is no room for “infeasible solution”.
12/6/2018 BG 39