Chapter Two-Linear Proramming
Chapter Two-Linear Proramming
Resource Requirements
Labor Clay Profit
Product
(hr/unit) (lb/unit) ($/unit)
Bowl 1 4 40
Mug 2 3 50
Resource 40 120
PROBLEM DEFINITION EXAMPLE CONT’D
Non-Negativity x1 0; x2 0
Constraints:
MODEL FORMULATION EXAMPLE
60
50
40
30
20
Coordinates
for graphical
10
analysis
0 10 20 30 40 50 60
GRAPHICAL REPRESENTATION OF CONSTRAINTS:
COORDINATE AXES
Lines Corner
2 and 4 (0,40)
1 and 3 (40, 0)
(3 and 4) (24, 8)
1. Initialization:
a. Transform all the constraints to equality by introducing
slack, surplus, and artificial variables as follows:
≥ + slack (s)
= + Artificial (A)
The Simplex Method for Solving LP Models
3. Iteration:
Step 1: determine the entering basic variable by selecting
the variable (automatically a non-basic 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).
Solution
Initialization
1. Standard form Sometimes it is called
Maximize Z, the augmented form of
the problem because the
Subject to
original form has been
Z - 3X1- 5X2 =0 augmented by some
supplementary variables
X1 + S1 = 4 needed to apply the
simplex method.
2 X2 + S2 = 12
3X1 +2X2 + S3 = 18
X 1 , X 2, S 1, S 2, S 3 0
The Simplex Method for Solving LP Models
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
Notes:
The basic feasible solution at the initial tableau
is (0, 0, 4, 12, 18) where:
X1 = 0, X2 = 0, S1 = 4, S2 = 12, S3 = 18, and Z = 0
Where S1, S2, and S3 are basic variables.
X1 and X2 are non-basic variables.
The solution at the initial tableau is associated
to the origin point at which all the decision
variables are zero.
The Simplex Method for Solving LP Models
Optimality test:
Iteration:
Step 1: Determine the entering variable by selecting the
variable with the most negative in the last row.
From the initial tableau, in the last row (Z row), the
coefficient of X1 is -3 and the coefficient of X2 is -5;
therefore, the most negative is -5.
Consequently, X2 is the entering variable.
X2 is surrounded by a box and it is called the pivot
column.
The Simplex Method for Solving LP Models
Iteration:
2. For the other row apply this rule:
New row = old row – (the coefficient of this row in the pivot column) x (new
pivot row).
For S1
1 0 1 0 0 4
-
0 (0 1 0 1/2 0 6)
1 0 1 0 0 4
For S3
3 2 0 0 1 18
-
2 (0 1 0 1/2 0 6)
3 0 0 -1 1 6
for Z Substitute this values in
-3 -5 0 0 0 0 the table
-
-5(0 1 0 1/2 0 6)
-3 0 0 5/2 0 30
5.4. The Simplex Method for Solving LP Models
Iteration:
This solution is not optimal, since there is a negative numbers in
the last 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
The most negative value; The smallest ratio is
therefore, X1 is the 6/3 =2; therefore, S3 is
entering variable the leaving variable
The Simplex Method for Solving LP Models
Iteration:
Apply the same rules we will obtain this solution:
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 X 1 =
2, X2 = 6 and S1 = 2; the non-basic variables are S2 = S3 = 0,Z = 36.
Exercise:
The Plastic manufacturing company produces two products:
Bowls/Product I and mugs/Product II. The raw material
requirements, space needed for storage, production rates, and
selling prices for these products are given below:
Constraints Bowls / Product I Mugs/ Product II
Storage space (m2/unit 4 5
Raw material (Ib/ unit) 5 3
Production rate 1 2
(Units/hr=60 minutes)
Selling price ($/unit 13 11
The total amount of raw material available per day for both products is 1575Ib.
The total storage space for all products is 1500 m2, and a maximum of 420 minutes
per day can be used for production.
How many units of bowls/product I and mugs/product II product should the
company to produce per day to maximize its total income/profit? ( Use simplex
method).
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”
© 2002 Prentice-Hall, Inc Ch 2-46
Simplex method incase of Artificial variables
“Big M method”
• Solve the following linear programming problem
by using the simplex method:
• Min Z =2 X1 + 3 X2
S.t.
½ X1 + ¼ X 2 ≤ 4
X1 + 3X2 20
X1 + X2 = 10
X1, X2 0
© 2002 Prentice-Hall, Inc Ch 2-47
Big M method
• Solution
Step 1: standard form
Min Z,
s.t.
Z – 2 X1 – 3 X2 - M A1 -M A2 =0
½ X1 + ¼ X 2 + S 1 =4
X1 + 3X2 - S 2 + A1 = 20
X1 + X 2 + A2 = 10
X1, X2 ,S1, S2, A1, A2 0
Where: M is a very large number
© 2002 Prentice-Hall, Inc Ch 2-48
• Notes
Big M method
M, a very large number, is used to ensure that the values of A 1 and A2, …, and An will
be zero in the final (optimal) tableau as follows:
1. If the objective function is Minimization, then A1, A2, …, and An must be added to
the RHS of the objective function multiplied by a very large number (M).
Example: if the objective function is Min Z = X1+2X2, then the obj. function should be
Min Z = X1 + X2+ MA1 + MA2+ …+ MAn
OR
Z – X1 - X2- MA1 - MA2- …- MAn = 0
Basic X1 X2 S1 S2 A1 A2 RHS
variables
2 3 0 0 M M
S1 ½ ¼ 1 0 0 0 4
A1 1 3 0 -1 1 0 20
A2 1 1 0 0 0 1 10
Z -2 -3 0 0 -M -M 0
Note that one of the simplex rules is violated, which is the basic variables A 1,
and A2 have a non zero value in the z row; therefore, this violation must be
corrected before proceeding in the simplex algorithm as follows.
© 2002 Prentice-Hall, Inc Ch 2-50
Big M method
• To correct this violation before starting the simplex
algorithm, the elementary row operations are used
as follows:
New (Z row) = old (z row) ± M (A1 row) ± M (A2 row)
In our case, it will be positive since M is negative in the Z row,
as following:
Old (Z row): -2 -3 0 0 -M -M 0
M (A1 row): M 3M 0 -M M o 20M
M (A2 row): M M 0 0 0 M 10M
New (Z row):2M-2 4M-3 0 -M 0 0 30M
© 2002 Prentice-Hall, Inc Ch 2-51
It becomes zero
Big M method
• The initial tableau will be:
Basic X1 X2 S1 S2 A1 A2 RHS
variables
2 3 0 0 M M
S1 1/2 1/4 1 0 0 0 4
A1 1 3 0 -1 1 0 20
A2 1 1 0 0 0 1 10
Z 2M-2 4M-3 0 -M 0 0 30M
• Since there is a positive value in the last row, this solution is not optimal
• The entering variable is X2 (it has the most positive value in the last row)
• The leaving variable is A1 (it has the smallest ratio)
© 2002 Prentice-Hall, Inc Ch 2-52
Big M method
• First iteration
Basic X1 X2 S1 S2 A1 A2 RHS
variables
2 3 0 0 M M
This solution is optimal, since there is no positive value in the last row. The
optimal solution is:
X1 = 5, X2 = 5, S1 = ¼
© 2002 Prentice-Hall, Inc Ch 2-54
A = A = 0 and Z = 25
1 2
Special cases
• In the final tableau, if one or more artificial variables (A1, A2, …)
still basic and has a nonzero value, then the problem has an
infeasible solution
• If there is a zero under one or more non-basic variables in the last
tableau (optimal solution tableau), then there is a multiple
optimal solution.
• 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.