Part 2 The Simplex Algorithm
Part 2 The Simplex Algorithm
1
The Simplex Algorithm
We saw how to solve containing two variables of linear programm
problems graphically.
Unfortunately, most real life LPs have many variables, so a simplex meth
s needed to solve LPs with more than two variables.
2
How to Solve an LP to Standard Form
he simplex procedure for a maximization problem with all constraints consists of the follow
teps.
tep 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.
aking the microcomputer problem its standard form is as follows:
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
X1, X2 ≥ 0 X1, X2, S1, S2, S3 ≥ 0
3
tep 2: Develop the initial tableau: the initial tableau always represents the
Nothing” strategy, so that the decision variables are initially non-ba
List the variables across the top of the table and write the objective func
coefficient of each variable just above it.
it
There should be one row in the body of the table for each constraint. List t
iables in the basis column, one per row.
In the Cj column, enter the objective function coefficient of zero for each sla
riable. (Cj - coefficient of variable j in the objective functio
Compute values for row Zj
5
EXERCISE 1
eather limited manufactures two types of belts: the deluxe model and the regular model. Ea
ype requires 1 square yard of leather. A regular belt requires 1 hour of skilled labor, and a
eluxe belt requires 2 hours. Each week, 40 square yard of leather and 60 hours of skilled
abor are available. Each regular belt contributes $3 to profit and each deluxe belt, $4. if w
efine The appropriate LP is
Max z = 4X1 + 3X2
1 = number of deluxe belts produced weekly
S. t. X1 + X2 ≤ 40 (Leather cons
2X1 + X2 ≤ 60 (Labor constr
2 = number of regular belts produced weekly
X1, X2 ≥ 0
7
ol/n 60 50 0 0 0
asis CjX1 X2 S1 S2 S3 RHSV Ratio
1 0 4 10 1 0 0 100 25
2 0 2* 1 0 1 0 22 11
3 0 3 3 0 0 1 39 13
Zj 0 0 0 0 0 0
Cj - Zj 60 50 0 0 0
1 60 1 ½ 0 ½ 0 11 22
3 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
ol/n 60 50 0 0 0
asis CjX1 X2 S1 S2 S3 RHSV X1 = 9
X2 = 4
1 0 0 1 6 -16/3 24
S1 =
HOU
1 1 0 0 1 -1/3 9 MAX Z =
0 BIR
2 0 1 0 -11 2/3 4
0
Zj 60 50 0 10 40/3 740
Cj - Zj 0 0 0 -10
10 -40/3
12
INITIAL TABLEAU
ol/n 45 70 0 0 0
asis CjX1 X2 S1 S2 S3 RHSV Ratio
1 0 9 12 1 0 0 720 60
2 0 2 6 0 1 0 300 50
3 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
ol/n 45 70 0 0 0
asis Cj X1 X2 S1 S2 S3 RHSV
1 0 5 0 1 -2
2 0 120 24
3 0 2/3 1 0 -1/6
1/6 1 25 75
14
THIRD TABLEAU
Sol/n 45 70 0 0 0
asis Cj X1 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
3 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
17
EXERCISE 2
Max z = 4X1 + 3X2
S. t. X1 + X2 40
2X1 + X2 60
X1, X2 ≥ 0
Required:
19
… CONT’D
HINT:
Method:
20
MINIMIZATION LINEAR PROGRAMMING PROBL
THE BIG M-METHOD
METHOD (CHARNES PENALTY MET
he Big-M
M method is a technique, which is used in removing artificial
ariables from the basis. In this method; we assign coefficients to artificia
ariables, undesirable from the objective function point of view.
When a bfs is not readily apparent, the Big M method may be used to so
he problem.
22
Description of Big M Method
Step 1: Modify the constraints so that the right-hand
right side of each constraint is nonnegative. T
equires that each constraint with a negative right-hand
right side be multiplied through by-1.
emember that if you multiply an inequality by any negative number, the direction of the
nequality is reversed.
Step 1: Identify each constraint that is now (after step 1) an = or ≥ constraint. In step
Step 2: Convert each inequality constraint to standard form. This means that if constraint i is a ≤
onstraint, we add a slack variable Si,, and if constraint i is a ≥ constraint, we subtract an excess
ariable 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 ai. Als
dd 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 var
Mai to the objective function. If the LP is a max problem, add (for each artificial variable) -Mai to the obje
unction.
Step 5: (I) Determine the variable to enter the basic solution. We identify the column with the largest nega
alue in the Cj - Zj row of the table.
I) Next we determine the departing variable from the basic solution. The leaving variable is the one with th
mallest non-negative ratio.
If an artificial variable goes out of solution, then we discard it totally and even this variable may not form
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 + 9X2 We introduce both surplus and artificial variabl
S. t. 3X1 + 6X2 ≥ 36 into both constraints as follows.
8X1 + 4X2 ≥ 64
Min Z = 7X1 + 9X2 + 0S1 + 0S2 + MA1 + MA2
X1, X2 ≥ 0
Subject to: 3X1+6X2 - S1+A1 = 36
8X1+4X2 - S2+A2 = 64
25
INITIAL SIMPLEX TABLEAU
Cj 7 9 0 0 M M Quantity
asic V. X1 X2 S1 S3 A1 A2
1 M 3 6 -1 0 1 0 36
2 M 8 4 0 -1 0 1 64
26
SECOND SIMPLEX TABLEAU
Cj 7 9 0 0 M Quantity
asic 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
asic V. X1 X2 S1 S2
2 9 0 1 -2/9 ½ 8/3
Cj - Zj 0 0 11/9 5/12
28
he third tableau represents a final tableau since it is the optimal solution
X1 = 20/3,
X2 = 8/3, and
1 M 2 3 -1 0 1 0 90
2 M 4 3 0 -1 0 1 120
Zj 6M 6M -M -M M M 210M
j - Zj 3-6M 4-6M M M 0 0
31
SECOND SIMPLEX TABLEAU
j 3 4 0 0 M Quantity
asic V. X1 X2 S1 S2 A1
1 M 0 3/2 -1 1/2 1 30
1 3 1 3/4 0 -1/4 0 30
j - Zj 0 7/4-3/2M M 3/4-1/2M 0
32
THIRD SIMPLEX TABLEAU
Cj 3 4 0 0 Quantity
asic V. X1 X2 S1 S2
2 4 0 1 -2/3 1/3 20
1 3 1 0 1/2 -1/2 15
j - Zj 0 0 7/6 1/6
33
Therefore, as the values in Cj - Zj are entirely of
zeros and negatives, then the minimization problem
optimal.
X1 = 15,
X2 = 20, and
Min Z = $125.
34
EXERCISE 4: Solve by Big-M
M Method
35
EXERCISE 5: Solve by Big-M
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
M Method
Min. Z = 2X1 + 3X2
X1 + X2 ≥ 250
2X1 + X2 600
X1, X2 ≥ 0
37
SOME SPECIAL ISSUES IN LP
. Redundant Constraint
a constraint when plotted on a graph doesn’t form part of the boundary making the feasib
egion of the problem that constraint is said to be redundant.
he same maximum value of the objective function might be possible with a number of differe
ombinations of values of the decision variables.
With simplex method this condition can be detected by examining the Cj - Zj row of the final
ableau. If a zero appears in the column of a non-basic
non variable (i.e., a variable that is not i
olution), it can be concluded that an alternate solution exists.
38
3. Infeasible Solution
egativity condition.
he company has made a contract with an automobile manufacturer to provide 24,000 gaso
super 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
A is $1,500 per day and refinery B is $2,400 per day.
EXERCISE 7: Determine the number of days the gasoline company should op
each refinery at a minimum running cost by graphic method.
40
AX. PROBLEMS WITH MIXED CONSTRAINTS
EXAMPLE 5
Standardization
Max Z = 6X1 + 8X2 +0S1 + 0S3 - MA2 - MA
Max Z = 6X1 + 8X2
S. t:
S. t:
X2 4
X2 + S 1 = 4
X1 + X 2 = 9 X1 + X 2 + A 2 = 9
6X1 + 2X2 > 24 6X1 + 2X2 - S3 + A3 = 24
X1, X2 > 0 All variables are > 0.
41
INITIAL SIMPLEX TABLEAU
Cj 6 8 0 0 -M -M Quantity
asic V. X1 X2 S1 S3 A2 A3
1 M 0 1 1 0 0 0 4
2 -M 1 1 0 0 1 0 9
3 -M 6 2 0 -1 0 1 24
j - Zj -6+7M 8+3M 0 -M 0 0
42
SECOND SIMPLEX TABLEAU
j 6 8 0 0 -M Quantity
asic V. X1 X2 S1 S3 A2
1 M 0 1 1 0 0 4
2 -M 0 2/3 0 1/6 1 5
1 6 1 1/3 0 -1/6 0 4
j - Zj 0 6+2/3M 0 11+M/6 0
43
THIRD SIMPLEX TABLEAU
6 8 0 0 -M Quantity
V. X1 X2 S1 S3 A2
8 0 1 1 0 0 4
-M 0 0 -2/3 1/6 1 7/3
6 1 0 -1/3 -1/6 0 8/3
6 8 6+2/3M -1-M/6 -M 48-7/3M
Zj 0 0 -6-2/3M 11+M/6 0
44
FOURTH SIMPLEX TABLEAU
Cj 6 8 0 0 Quantity
asic V. X1 X2 S1 S3
X2 8 0 1 1 0 4
3 0 0 0 -4 1 14
X1 6 1 0 -1 0 5
j 6 8 2 0 62
j - Zj 0 0 -2 0
45
his above tableau represents the final tableau since it is the optima
olution with entirely of zeros and negative values in the Cj - Zj row.
X1 = 5,
X2 = 4,
S3 = 14, and
46
5. UNBOUNDED SOLUTIONS
solution is unbounded if the objective function can be improved without limit and no
iolating the feasibility condition.. Here, the objective function value can also be increa
nfinitely. The solution is unbounded if there are no positive ratios in determining the
eaving variable.
negative ratio means that increasing a basic variable would increase resources!
zero ratio means that increasing a basic variable would not use any resources. This
ondition generally arises because the problem is incorrectly formulated.
47
6. DEGENERACY
n the process of developing the next simplex tableau of not optimal, the
here are ways of dealing with ties in a specific fashion; however, it will
sually suffice to simply select one row (variable) arbitrarily and proceed