Part 2 The Simplex Algorithm
Part 2 The Simplex Algorithm
1
The Simplex Algorithm
We saw how to solve containing two variables of linear
programming
problems graphically.
Unfortunately, most real life LPs have many variables, so a simp
method
sWe
needed tomost
devote solveofLPs with
this moreto
chapter than two variables.
a discussion of the simplex algorithm
which is used to solve even very large LPs.
2
How to Solve an LP to Standard Form
he simplex procedure for a maximization problem with all constraints consists of the follo
teps.
Step 1: Write the LPM in a standard form: when all of the constraints are written as equalitie
he linear program is said to be in standard form.
An LP in this form is said to be in standard form.
Taking the microcomputer problem its standard form is as follows:
Z max = 60X1 + 50X2 Z max = 60X1 + 50X2 + 0S1 + S2 + 0S3
S. t : 4X1 + 10X2 100 S. t: 4X1 + 10X2 + S1 = 100
2X1 + X2 22 2X1 + X2 + S2 = 22
3X1 + 3X2 39 3X1 + 3X2 + S3 = 39
Incoefficient
variables
the Cj theofbasis
each
in column, variable
column,
enter justper
the one above
objectiverow.it.
function coefficient of zero for
each slack
variable. (Cj - coefficient of variable j in the objective function)
Compute values for row Zj
Computer values for Cj - Zj.
4
Step 3: Develop subsequent tableaus:
3.1 Identify the entering variable - a variable that has a largest positi
value is the Cj - Zj row.
.2 Identify the leaving variable - using the constraint coefficients or substitution
he entering variable column divide each one into the corresponding quantity valu
owever, do not divide by a zero or negative value. The smallest non-negative ra
esults indicate which variable will leave the solution.
tep 4: Find unique vectors for the new basic variable using row operations on th
lement.
Step 5: Compute the Cj - Zj raw
Step 6: If all Cj - Zj values are zeros and negatives you have reached optimali
Step 7: If this is not the case (step 6), rehear step 2 to 5 until you get optimal so
5
EXERCISE 1
Leather limited manufactures two types of belts: the deluxe model and the regular model.
type requires 1 square yard of leather. A regular belt requires 1 hour of skilled labor, and a
deluxe belt requires 2 hours. Each week, 40 square yard of leather and 60 hours of skill
labor are available. Each regular belt contributes $3 to profit and each deluxe belt, $4. if
define The appropriate LP is
Max z = 4X1 + 3X2
X1 = number of deluxe belts produced weekly
S. t. X1 + X2 ≤ 40 (Leather constrain
2X1 + X2 ≤ 60 (Labor constraint)
X2 = number of regular belts produced weekly
X1, X2 ≥ 0
7
Sol/n 60 50 0 0 0
basis CjX1 X2 S1 S2 S3 RHSV Ratio
S1 0 4 10 1 0 0 100 25
S2 0 2* 1 0 1 0 22 11
S3 0 3 3 0 0 1 39 13
Zj 0 0 0 0 0 0
Cj - Zj 60 50 0 0 0
X1 60 1 ½ 0 ½ 0 11 22
S3 0 0 3/2 0 -3/2 1 6 4
Zj 60 30 0 30 0 660
Cj - Zj 0 20 0 -30 0
9
THIRD TABLEAU
Sol/n 60 50 0 0 0
basis CjX1 X2 S1 S2 S3 RHSV X1 = 9 UNITS
X2 = 4 UNITS
S1 0 0 1 6 -16/3 24
S1 = 24
0 HOURS
X1 1 0 0 1 -1/3 9 MAX Z = 740
60 BIRR
X2 0 1 0 -1 2/3 4
50
Zj 60 50 0 10 40/3 740
Cj - Zj 0 0 0 -10 -40/3
12
INITIAL TABLEAU
Sol/n 45 70 0 0 0
basis CjX1 X2 S1 S2 S3 RHSV Ratio
S1 0 9 12 1 0 0 720 60
S2 0 2 6 0 1 0 300 50
S3 0 1 1 0 0 1 75 75
Zj 0 0 0 0 0 0
Cj - Zj 45 70 0 0 0
13
SECOND TABLEAU
Sol/n 45 70 0 0 0
basis Cj X1 X2 S1 S2 S3 RHSV
S1 0 5 0 1 -2 0 120 24
S3 0 2/3 1 0 -1/6 1 25 75
14
THIRD TABLEAU
Sol/n 45 70 0 0 0
basis CjX1 X2 S1 S2 S3 RHSV
X1 45 1 0 1/5 -2/5 0 24
X2 70 0 1 -1/15 3/10 0 42
S3 0 0 0 -2/15 1/10 1 9
Zj 45 70 13/3 3 0 4020
Cj - Zj 0 0 -13/3 -3 0
15
Optimal solutions: X1 = 24 units
X2 = 42 units
S3 = 9 engines
Max Z = Birr 4020
S. t. X1 + X2 40
2X1 + X2 60
X1, X2 ≥ 0
Required:
each type of furniture requires lumber and two types of skilled labor: finishing
and carpentry.
The amount of each resource needed to make each type of furniture is given in
the table
below. Currently, 48 board feet of lumber, 20 finishing hours, and 8 carpentry
hours are
available. A desk sells for $60, a table for $30, and a chair for $20. Dakota
believes that
demand for desks and chairs is unlimited, but at most five tables can be sold.
Because the
available resources have already been purchased, Dakota wants to maximize
19
… CONT’D
HINT:
Method:
20
MINIMIZATION LINEAR PROGRAMMING PROBLEM
THE BIG M-METHOD (CHARNES PENALTY METHO
The Big-M method is a technique, which is used in removing artificia
variables from the basis. In this method; we assign coefficients to artifi
variables, undesirable from the objective function point of view.
Step 1: Identify each constraint that is now (after step 1) an = or ≥ constraint. In ste
Step 2: Convert each inequality constraint to standard form. This means that if constraint
constraint, we add a slack variable Si, and if constraint i is a ≥ constraint, we subtract an ex
variable ei.
23
Description of Big M Method
Step 3: If (after step 1 has been completed) constraint i is a ≥ or = constraint, add an artificial variable a
add the sign restriction ai ≥ 0.
Step 4: Let M denote a very large positive number. If the LP is a min. problem, add (for each artificial va
Mai to the objective function. If the LP is a max problem, add (for each artificial variable) -Mai to the objec
function.
Step 5: (I) Determine the variable to enter the basic solution. We identify the column with the largest ne
value in the Cj - Zj row of the table.
(II) Next we determine the departing variable from the basic solution. The leaving variable is the one wit
smallest non-negative ratio.
If an artificial variable goes out of solution, then we discard it totally and even this variable may not form
of further iterations.
The optimal solution for MIN. is obtained when the Cj - Zj row contains entirely of ZEROS AND POSITIVE v
24
EXAMPLE 3
Min Z = 7X1 + 9XWe2 introduce both surplus and artificial
S. t. 3X1 + 6X2 ≥ 36
variables
8X1 + 4X2 ≥ 64into both constraints as follows.
Min Z = 7X1 + 9X2 + 0S1 + 0S2 + MA1 + MA2
X1, X2 ≥ 0
Subject to: 3X1+6X2 - S1+A1 = 36
8X1+4X2 - S2+A2 =
64
A1 M 3 6 -1 0 1 0 36
A2 M 8 4 0 -1 0 1 64
26
SECOND SIMPLEX TABLEAU
Cj 7 9 0 0 M Quantity
Basic V. X1 X2 S1 S2 A1
A1 M 0 9/2 -1 3/8 1 12
X1 7 1 ½ 0 -1/8 0 8
Cj - Zj 0 11/2-9/2M M 7/8-3/8M 0
27
THIRD SIMPLEX TABLEAU
Cj 7 9 0 0 Quantity
Basic V. X1 X2 S1 S2
X2 9 0 1 -2/9 ½ 8/3
Cj - Zj 0 0 11/9 5/12
28
The third tableau represents a final tableau since it is the optimal solu
X1 = 20/3,
X2 = 8/3, and
A1 M 2 3 -1 0 1 0 90
A2 M 4 3 0 -1 0 1 120
Zj 6M 6M -M -M M M 210M
Cj - Zj 3-6M 4-6M M M 0 0
31
SECOND SIMPLEX TABLEAU
Cj 3 4 0 0 M Quantity
Basic V. X1 X2 S1 S2 A1
A1 M 0 3/2 -1 1/2 1 30
X1 3 1 3/4 0 -1/4 0 30
Cj - Zj 0 7/4-3/2M M 3/4-1/2M 0
32
THIRD SIMPLEX TABLEAU
Cj 3 4 0 0 Quantity
Basic V. X1 X2 S1 S2
X2 4 0 1 -2/3 1/3 20
X1 3 1 0 1/2 -1/2 15
Cj - Zj 0 0 7/6 1/6
33
Therefore, as the values in Cj - Zj are entirely o
zeros and negatives, then the minimization proble
optimal.
X1 = 15,
X2 = 20, and
Min Z = $125.
34
EXERCISE 4: Solve by Big-M Method
35
EXERCISE 5: Solve by Big-M Method
Min Z = 4X1 + 6X2 Solution
S. t. X1 + 2X2 ≥ 80 X1 = 14,
3X1 + X2 ≥ 75 X2 = 33,
X1, X2 ≥ 0 Min. Z = $254.
36
EXERCISE 6: Solve by Big-M Method
Min. Z = 2X1 + 3X2
X1 + X2 ≥
250
2X1 + X2 600
X1, X2 ≥ 0
37
SOME SPECIAL ISSUES IN LP
1. Redundant Constraint
f a constraint when plotted on a graph doesn’t form part of the boundary making the feasib
region of the problem that constraint is said to be redundant.
The same maximum value of the objective function might be possible with a number of diff
combinations of values of the decision variables.
With simplex method this condition can be detected by examining the Cj - Zj row of the fi
tableau. If a zero appears in the column of a non-basic variable (i.e., a variable that is not in
solution), it can be concluded that an alternate solution exists.
38
3. Infeasible Solution
negativity condition.
he company has made a contract with an automobile manufacturer to provide 24,000 gasoli
uper unleaded, 42,000 gallons of regular unleaded and 36,000 gallons of leaded.
he automobile manufacturer wants delivery in not more than 14 days. The cost of running re
is $1,500 per day and refinery B is $2,400 per day.
EXERCISE 7: Determine the number of days the gasoline company
should operate each refinery at a minimum running cost by graphic
method.
40
MAX. PROBLEMS WITH MIXED
CONSTRAINTS
EXAMPLE 5
Standardization
Max Z = 6X1 + 8X2 +0S1 + 0S3 - MA2 - MA3
Max Z = 6X1 + 8X2
S. t:
S. t:
X2 4 X2 + S1 = 4
X1 + X2 = 9 X1 + X2 + A2 = 9
S1 M 0 1 1 0 0 0 4
A2 -M 1 1 0 0 1 0 9
A3 -M 6 2 0 -1 0 1 24
Cj - Zj -6+7M 8+3M 0 -M 0 0
42
SECOND SIMPLEX TABLEAU
Cj 6 8 0 0 -M Quantity
Basic V. X1 X2 S1 S3 A2
S1 M 0 1 1 0 0 4
A2 -M 0 2/3 0 1/6 1 5
X1 6 1 1/3 0 -1/6 0 4
Cj - Zj 0 6+2/3M 0 11+M/6 0
43
THIRD SIMPLEX TABLEAU
Cj 6 8 0 0 -M Quantity
Basic V. X1 X2 S1 S3 A2
X2 8 0 1 1 0 0 4
A2 -M 0 0 -2/3 1/6 1 7/3
X1 6 1 0 -1/3 -1/6 0 8/3
Zj 6 8 6+2/3M -1-M/6 -M 48-7/3M
Cj - Zj 0 0 -6-2/3M 11+M/6 0
44
FOURTH SIMPLEX TABLEAU
Cj 6 8 0 0 Quantity
Basic V. X1 X2 S1 S3
X2 8 0 1 1 0 4
S3 0 0 0 -4 1 14
X1 6 1 0 -1 0 5
Zj 6 8 2 0 62
Cj - Zj 0 0 -2 0
45
This above tableau represents the final tableau since it is the opt
solution with entirely of zeros and negative values in the Cj - Zj
X1 = 5,
X2 = 4,
S3 = 14, and
46
5. UNBOUNDED SOLUTIONS
olution is unbounded if the objective function can be improved without limit and
ating the feasibility condition. Here, the objective function value can also be incr
nitely. The solution is unbounded if there are no positive ratios in determining th
ving variable.
negative ratio means that increasing a basic variable would increase resources!
ero ratio means that increasing a basic variable would not use any resources. Th
ndition generally arises because the problem is incorrectly formulated.
47
6. DEGENERACY
In the process of developing the next simplex tableau of not optimal,
There are ways of dealing with ties in a specific fashion; however, it will
usually suffice to simply select one row (variable) arbitrarily and proceed