Chapter 2.2 Quantitative Analysis New

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 44

2.2.

Simplex method

2.2.1.Simplex method for solving LP models

 To solve LP models with numerous decision variables and con-


straints, one need a solution procedure such as simplex algo-
rithm.

 The simplex technique involves generating a series of solutions


in tabular form, called tableaus.
2.2.1.Simplex method… cont’d

 By inspecting the bottom row of each tableau, one can immedi-


ately tell if it represents the optimal solution.
 Each tableau corresponds to a corner point of the feasible solu-
tion space.

 The first tableau corresponds to the origin. Subsequent tableaus


are developed by shifting to an adjacent corner point in the di-
rection that yields the highest (smallest) rate of profit (cost).
This process continues as long as a positive (negative) rate of
profit (cost) exists
2.2.1.Simplex method… cont’d

 Steps in Simplex method for solving LP models:

1. Initialization:
a. Transform all the constraints to equality by introducing
slack, surplus, and artificial variables as follows:
Constraint type Variable to be added

≤ + slack (s)

≥ - Surplus (s) + artificial (A)

= + Artificial (A)
2.2.1.Simplex method… cont’d

2. Test for optimality:

Case 1: Maximization problem:


 The current basic feasible (BF) solution is optimal if every co-
efficient in the objective function row is non-negative.

Case 2: Minimization problem:


 The current BF solution is optimal if every coefficient in the
objective function row is non-positive.
2.2.1.Simplex method… cont’d

1. Initialization:
b. Construct the initial simplex tableau:
Basic X1 … Xn S1 …... Sn A …. A RHS
vari- 1 n
able
S b1
Coefficient of the constraints
A bm
Z Objective function coefficient Z
In different signs value
2.2.1.Simplex method… cont’d

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).

 Put a box around the column above this variable, and


call it the “pivot column”.
2.2.1.Simplex method… cont’d

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”
2.2.1.Simplex method… cont’d

Step 3: Solve for the new BF solution by using elementary row op-
erations (multiply or divide a row by a non-zero constant; sub-
tract a multiple of corresponding coefficients of pivot column
and corresponding values of pivot row from the old row values)
to construct a new simplex tableau, and then return to the opti-
mality test.
 The specific elementary row operations are as follows:
1. Divide the pivot row by the “pivot number” (the number in
the intersection of the pivot row and pivot column)
2. Compute each other row new entry by using New tableau
row values = Old value of the row – (the coefficient of this
row in the pivot column) x (new pivot row).
3. Enter the calculated values to the new tableau row.
2.2.1.Simplex method … cont’d

 Example (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
2.2.1.Simplex method … cont’d

 Solution
 Initialization
1. Standard form Sometimes it is called the augmented form
Maximize Z, of the problem because the original form
Subject to has been augmented by some supplemen-

Z - 3X1- 5X2 =0 tary variables needed to apply the simplex

method.

X1 + S1 = 4
2 X2 + S2 = 12
3X1 +2X2 + S3 = 18
X1 , X2, S1, S2, S3  0
2.2.1.Simplex method … cont’d

 A basic solution is an augmented corner point solution.


 A basic solution has the following properties:
1. Each variable is designated as either a non-basic variable or
a basic variable.
2. The number of basic variables equals the number of func-
tional constraints. Therefore, the number of non-basic vari-
ables equals the total number of variables minus the number
of functional constraints.
3. The non-basic variables are set equal to zero.
4. The values of the basic variables are obtained as simultane-
ous solution of the system of equations (functional con-
straints in augmented form). The set of basic variables are
called “basis”.
5. If the basic variables satisfy the non-negativity constraints,
the basic solution is a Basic Feasible (BF) solution.
2.2.1.Simplex method … cont’d

2. Initial tableau Entering vari-

able
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

Leaving Pivot column Pivot Pivot row

variable number
2.2.1.Simplex method … cont’d

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.
2.2.1.Simplex method … cont’d

Optimality test:
By investigating the last row of the initial
tableau, we find that there are some negative
numbers. Therefore, the current solution is not
optimal.
2.2.1.Simplex method … cont’d

 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.
2.2.1.Simplex method … cont’d

Step 2: Determining the leaving variable by using


the minimum ratio test as following:
Basic vari- Entering RHS Ratio
able variable X2
(1) (2) (2)(1)

S1 0 4 None
S2 2 12 6
Leaving Smallest ratio
S3 2 18 9
2.2.1.Simplex method … cont’d

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 vari- X1 X2 S1 S2 S3 RHS


able
S1
X2 0 1 0 1/2 0 6
S3
Z

Note that X2 becomes in the basic variables list instead


2.2.1.Simplex method … cont’d
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 the table
-3 -5 0 0 0 0
-
-5(0 1 0 1/2 0 6)
-3 0 0 5/2 0 30
2.2.1.Simplex method … cont’d
 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; there- The smallest ratio is 6/3 =2;
fore, X1 is the entering variable therefore, S3 is the leaving
2.2.1.Simplex method … cont’d
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 X1 = 2, X2 = 6 and S1 = 2; the non-basic variables are S2 = S3 = 0,Z = 36.
 Homework exercise:
The Plastic manufacturing company produces two products: Bowls/Product I and mugs/Product II. The raw ma-

terial requirements, space needed for storage, production rates, and selling prices for these products are given be-

low:

Constraints Bowls / Product I Mugs/ Product II


Storage space (m2/unit 4 5
Raw material (Ib/ unit) 5 3
Production rate (Units/ 1 2
hr=60 minutes)
Selling price ($/unit 13 11

2
The total amount of raw material available per day for both products is 1575Ib. The total storage space for all products is 1500 m , and a max-

imum 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).


2.2.1.Simplex method … cont’d
Minimization problem
Solve the following linear programming problem by using the sim-
plex method (Big M method):
•Min Z = 2 X1 + 3 X2
S.t.
½ X1 + ¼ X2 ≤ 4
X1 + 3X2  20
X1 + X2 = 10
X1, X2  0
2.2.1.Simplex method … cont’d
Solution:
Step 1: standard form
Min Z= 2x1+3x2 + MA1+MA2
s.t.
Z – 2 X1 – 3 X2 - M A1 -M A2 =0
½ X1 + ¼ X2 + S1 =4
X1 + 3X2 - S2 + A1 = 20
X1 + X2 + A2 = 10
X1, X2 ,S1, S2, A1, A2 0
Where: M is a very large number
2.2.1.Simplex method … cont’d
Solution:
Step 2: Initial tableau
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 A1, 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.
2.2.1.Simplex method … cont’d
Solution:
Step 2: Initial tableau
To correct the 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, the sign will be positive since M is negative in the Z row, as fol-

lowing:

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


It becomes zero

New (Z row):2M-2 4M-3 0 -M 0 0 30M


2.2.1.Simplex method … cont’d
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)

2.2.1.Simplex method … cont’d
 First iteration:

Basic X1 X2 S1 S2 A1 A2 RHS
variables 2 3 0 0 M M
S1 5/12 0 1 1/12 -1/12 0 7/3

X2 1/3 1 0 -1/3 1/3 0 20/3

A2 2/3 0 0 1/3 -1/3 1 10/3

Z 2/3M-1 0 0 1/3M-1 1-4/3M 0 20+10/3M

• Since there is a positive value in the last row, this solution is not optimal.
• The entering variable is X1 (it has the most positive value in the last row).
• The leaving variable is A2 (it has the smallest ratio).
2.2.1.Simplex method … cont’d
Second iteration:
Basic X1 X2 S1 S2 A1 A2 RHS
variables
S1 0 0 1 -1/8 1/8 -5/8 1/4

X2 0 1 0 -1/2 1/2 -1/2 5

X1 1 0 0 1/2 -1/2 3/2 5

Z 0 0 0 -1/2 ½ -M 3/2-M 25

This solution is optimal, since there is no positive value in the last row. The optimal solution

is:

X1 = 5, X2 = 5, S1 = ¼
Special Cases in the Simplex Method

Special types of LP problems need special attentions


Special types:
• More than one optimal solution (Multiple optimal solu-
tion)
• Infeasible problems
• Unbounded solutions
• Ties for pivot column and/or ties for the pivot row
• Constraints with negative quantity values
Multiple Optimal Solutions

Beaver Creek Pottery Example

Objective function is parallel to to a constraint line.

Maximize Z=$40x1 + 30x2

subject to: 1x1 + 2x2  40

4x1 + 3x2  120

x1, x2  0

Where:

x1 = number of bowls

x2 = number of mugs

30
Multiple Solutions from the Simplex Tableau
Not in solution

But has a 0 coef.


• The optimal simplex tableau is:
• How do we know that multiple Basic Z x1 x2 s1 s2 Solution

optimal solution exist? Z 1 0 0 10 1200


• Determined from the row Z 0
s1 0 0 1.25 1 -0.25 10
• Negative row Z values repre-
sent profit x1 0 1 0.75 0 0.25 30
• Values of zero indicate no in-
crease or loss
• Coefficients of x1and s1 have
zero values
• Coefficient of x2 has a value of
zero and it is not part of basic
solution
Multiple Solutions from the Simplex
Tableau (cont.)
• If x2 enters solution, we Basic Z x1 x2 s1 s2 Solu-
tion
will have a new solution Z 1 0 0 0 10 1200
without changing z
• Multiple optimal solution s1 0 0 1.2
5
1 -
0.25
10
is indicated by a value of
x1 0 1 0.7 0 0.25 30
zero in row Z for a nonba- 5
sic variable
• To determine alternate so-
Basic Z x1 x2 s1 s2 Solution
lution, select x2 as the en-
tering variable and then Z 1 0 0 0 10 1200
determine pivot row as
usual x2 0 0 1 0.8 -0.2 8

x1 0 1 0 -0.6 0.4 24
The Infeasible Solution
• Special case where a LP
has not feasible solution
area
Max Z=5x1+3x2
s.t. 4x1+2x2<=8
x1>=4
X>=6
• Because no point satisfies
all three constraints simul-
taneously, there is no so-
lution.
The Infeasible Solution (cont.)
All values are zero or positive indicating that it is optimal
• Solution: x2=4, A1=4, and A2=2
– Existence of artificial variables in final tableau makes the solution
meaningless
• Occur as a result of making errors in defining problem correctly or in
formulating the LP problem

Basic Z x1 x2 s1 s2 s3 A1 A2 Solution
Z 1 M+1 0 M M 0.5M+1.5 0 0 -0.6M+12

x2 0 2 1 0 0 0.5 0 0 4

A1 0 1 0 -1 0 0 1 0 4

A2 0 -2 0 0 -1 -0.5 0 1 2
An Unbounded Problem

Occur where feasible solution area is not

closed. Objective function increases indefi-

nitely without ever reaching a maximum

value. It Never reaches boundary of the feasi-

ble solution area

Value of objective function increases indefi-

nitely:

35

Maximize Z = 4x1 + 2x2


Unbounded Problems (cont.)
First tableau

Basic Z x1 x2 s1 s2 A1 Solution
• In second tableau, s1 is chosen
as the entering variable be- Z 1 M-4 -2 M 0 0 -4M
cause it has most negative co-
efficient in row Z A1 0 1 0 -1 0 1 4
• There is no leaving variable be-
s2 0 0 1 0 1 0 2
cause one row value is -4 and
the other is undefined
• Indicates that solution is un- Second tableau
bounded Basic Z x1 x2 s1 s2 A1 Solution
• A solution is unbounded if row Z 1 0 -2 -4 0 M+4 16
value ratios are all negative or
undefined X1 0 1 0 -1 0 1 4
• Occurs as a result of making er-
rors in defining problem or in s2 0 0 1 0 1 0 2
formulating LP problem
Degeneracy
• Possible to have a tie for pivot row
• A tie should be broken arbitrarily
• Other choice for leaving variable will posses a zero value in next
tableau
• Solution is said to be degenerate
– Z value never improves
• An example of a degeneracy condition
Maximize Z = 4x1+ 6x2
subject to
6x1+ 4x2 ≤ 24
x2 ≤ 3
5x1+10x2 ≤ 40
Tie for the Pivot Row

• In second tableau, we will Basic Z x1 x2 s1 s2 s3 Solution


Z 1 -4 0 0 6 0 18
see a tie for pivot row be-
s1 0 6 0 1 -4 0 12

tween s1, and s3 rows x2 0 0 1 0 1 0 3

s3 0 5 0 0 -10 1 10
• S3 row is selected arbitrar-
ily, the resulting third
S1 ratio: 12/6 =2

tableau will be shown S3 ratio: 10/5 =2


Loop in Solutions

• A value of zero Basic Z x1 x2 s1 s2 s3 Solution


Z 1 0 0 0 -2 4/5 26

for s1 indicates a degen- s1 0 0 0 1 8 -6/5 0

eracy condition x2 0 0 1 0 1 0 3

x1 0 1 0 0 -2 1/5 2
• s2 is entering variable

and s1 as pivot row


Loops in Solutions (Cont.)

Basic Z x1 x2 s1 s2 s3 Solution

• Optimal solution did not Z 1 0 0 1/4 0 1/2 26

change s2 0 0 0 1/8 1 -3/20 0

• Graphical analysis of this


x2 0 0 1 -1/8 0 3/20 3
problem is shown in the
x1 0 1 0 1/4 0 -1/10 2
next slide
Graphical Analysis
• The intersection causes
the tie for pivot row and
the degeneracy
– Simplex process stays
at point B
• Degeneracy occurs when
a problem continually B
loops back to same solu-
tion
• Two tableaus represent
two different basic feasi-
ble solutions with two dif -
ferent model constraint
equations
HOMEWORKASSIGNMENT

1. Given the following linear programming model:


Min Z=4x1+x2
s.t.
3x1+6x2>=15
8x1+2x2>=12
x1, x2>=0
Solve graphically and using the simplex method.
What type of special case is this problem? Explain?
HOMEWORKASSIGNMENT…CONT’D

2. Transform the following linear programming model into


proper form and setup the initial tableau. Do not solve
it.
Min Z=40x1+55x2+30x3
s.t.
x1+2x2+3x3 <=60
2x1+x2+x3 = 40
x1+3x2+x3>=50
5x2+x3>=100
x1, x2, x3>=0
HOMEWORKASSIGNMENT…CONT’D

3. Given the following linear programming model:


Max Z=x1+2x2-x3
s.t.
4x2+x3<=40
x1-x2<=20
2x1+4x2+3x3<=60
x1, x2, x3>=0
Solve this problem using the simplex method.
What type of special case is this problem? Explain?

You might also like