You are on page 1of 26

Optimization Linear Programming

Matrix Standard Form of an LP Model

1
Optimization Linear Programming

Tabular Standard Form of an LP Model

2
Optimization Linear Programming/Simplex Method

➢ Simplex Method

• Used for solving LP problems will be presented


• Put into the form of a table, and then a number of
mathematical steps are performed on the table
• Moves from one extreme point on the solution boundary to
another until the best one is found, and then it stops
• A lengthy and tedious process but computer software
programs are now used easily instead
• Programs do not provide an in-depth understanding of how
those solutions are derived
• Can greatly enhance one's understanding of LP

3
Optimization Linear Programming/Simplex Method

Standard Form Linear Programming


• We define the standard form of a linear programming problem as:
– One whose objective function is maximization
– One whose constraints are expressed as equations and whose right hand
side is non-negative (after the introduction of slack and surplus variables)
– One in which all the decision variables are non-negative
• A solution is any specification of values for the decision variables.
• A feasible Solution is a solution for which all the constraints are satisfied.
• The feasible region is the set of all feasible solutions.
• An Optimal Solution is a feasible solution that has the most favorable value
of the objective function.
• A Corner-point feasible (CPF) solution is a solution that lies at a corner of
the feasible region.
• A Basic Solution is a corner-point solution.
• A Basic Feasible Solution is a CPF solution for which all the variables are
greater than or equal to zero.
4
Optimization Linear Programming/Simplex Method

Conceptual Outline of the Steps of the Simplex Algorithm

• Step 0: Using the standard form determine a starting basic feasible solution
by setting n-m non-basic variables to zero.

• Step 1: Select an entering variable from among the current non-basic


variables, which gives the largest per-unit improvement in the value of the
objective function. If none exists stop; the current basic solution is optimal.
Otherwise go to Step 2.

• Step 2: Select a leaving variable from among the current basic variables that
must now be set to zero (become non-basic) when the entering variable
becomes basic.
• Step 3: Determine the new basic solution by making the entering variable,
basic; and the leaving variable, non-basic, and return to Step 1.

5
Optimization Linear Programming/Simplex Method

Setting up the Reddy-Mikks Problem

• For Instance the Reddy-Mikks Is expressed as:


Problem:
Maximize z = 3XE + 2XI z - 3XE - 2XI - 0S1 - 0S2 - 0S3- 0S4=0
Subject to: Subject to:
XE + 2XI  6 (1) XE + 2XI + S1 =6 (1)
2XE + XI  8 (2) 2XE + XI + S2 =8 (2)
-XE + XI  1 (3) -XE + XI + S3 =1 (3)
XI  2 (4) XI + S4 = 2 (4)
XE , XI  0 XE , XI,, S1,, S2,, S3,, S4  0

Maximization is implied by the (+1)z since it is


the objective function of the standard form.

Because they provide an immediate basic feasible solution


we choose the slack variables as the initial basic variables
6
Optimization Linear Programming/Simplex Method

Simplex Tableau
The tabular form of the simplex method uses a simplex tableau to
display the system of equations yielding the current basic feasible
solution.
There are different ways to design the tableau a common design is as
follows:
Initial Tableau for the R-M problem (Iteration 0)

Header Basic Eq. Z XE XI S1 S2 S3 S4 Rt Side


Var. (Sol)
Objective Function z 0 1 -3 -2 0 0 0 0 0
S1 1 0 1 2 1 0 0 0 6

S2 2 0 2 1 0 1 0 0 8
Constraints
S3 3 0 -1 1 0 0 1 0 1
S4 4 0 0 1 0 0 0 1 2

7
Optimization Linear Programming/Simplex Method

Steps of the Simplex Algorithm


• Step 0: Optimality test: the current basic feasible solution is optimal if every
coefficient in row 0 of the tableau is non-negative. If it is, stop; if not
perform an additional iteration.
• Step 1: Determine the entering variable by selecting the variable having the
most negative coefficient in row 0. The corresponding column is called the
pivot column.
• Step 2: Determine the leaving variable by applying the minimum ratio test:
– Pick out each coefficient in the pivot column having a positive value
– Divide the right hand of each row by each of these positive coefficients
– Determine the smallest of these ratios
– The basic variable for the row corresponding to the smallest ratio is the
leaving variable. Replace this variable with the entering variable in the
next tableau.
– The row with the smallest ratio is called the pivot row. The number in
the intersection of the pivot column and row is the pivot element.
• Step 3: Solve for the new basic feasible solution (BFS) by using elementary
row operations.
8
Optimization Linear Programming/Simplex Method

Iteration 0 (Steps 0,1,2)

Iter- Basic Eq. Z XE XI S1 S2 S3 S4 RHS


ation Var. (Sol)
z 0 1 -3 -2 0 0 0 0 0
S1 1 0 1 2 1 0 0 0 6 6/1
0 S2 2 0 2 1 0 1 0 0 8 8/2
S3 3 0 -1 1 0 0 1 0 1
S4 4 0 0 1 0 0 0 1 2

Pivot
Element
Entering Variable: Select the variable with Leaving Variable: Smallest
the most negative coefficient in the ratio obtained by dividing
objective function the RHS of each row by the
positive coefficients of the
entering variable (Column)

9
Optimization Linear Programming/Simplex Method

Iteration 0 (Step 3)
• To get the new BFS we perform the following steps:
1. Divide the pivot row by the pivot element and call it the “new pivot
row”. Copy the result in the tableau for the next iteration.
2. For every row of the current tableau (excluding the pivot row) subtract
the product of its pivot-column coefficient times the new pivot row.
Copy the result in the corresponding row of the next-iteration tableau.
Make sure to properly identify the new basic variable.
• M-R Example: New pivot 1:
Iter- Basic Eq. Z XE XI S1 S2 S3 S4 RHS
ation Var. (Sol)
z 0 1
S1 1 0
1 XE 2 0 1 1/2 0 1/2 0 0 8/2
S3 3 0
S4 4 0

10
Optimization Linear Programming/Simplex Method

M-R Example: New Row 1

Basic Eq. Z XE XI S1 S2 S3 S4 RHS


Var. (Sol)
Original Equation 1 S1 1 0 1 2 1 0 0 0 6
Minus (1) times new pivot row S2 2 0 1 1/2 0 1/2 0 0 8/2 (-1)

New Equation 1 S1 1 0 0 1.5 1 -0.5 0 0 2

Resulting Tableau (Partial)


Iter- Basic Eq. Z XE XI S1 S2 S3 S4 RHS
ation Var. (Sol)
z 0 1
S1 1 0 0 1.5 1 -0.5 0 0 2
XE 2 0 1 0.5 0 0.5 0 0 4
1 S3 3 0
S4 4 0

11
Optimization Linear Programming/Simplex Method

Basic Eq. Z XE XI S1 S2 S3 S4 RHS


Var. (Sol)
Original Equation 0 xI Z 0 1 -3 -2 0 0 0 0 0
Minus (-3) times new pivot row 8 S2 2 0 1 1/2 0 1/2 0 0 8/2

New Equation 0 Z 0 1 0 -0.5 0 1.5 0 0 12

We select
Increasing to increase
Increasing the value
XI by unit
4 XE by unit of XE
results in an
results in an
increase of
increase of How much can
Z of 2 units
Z of 3 units we increase
2 X E?
XE =0 The amount of the
XI =0 increase is limited by
S1 =6 the constraints (One
S2 =8 xE
of the slack variables
2 4 6
becomes zero or non-
S3 =1 basic)
S4 =2 12
Optimization Linear Programming/Simplex Method

Iteration 1

Iter- Basic Eq. Z XE XI S1 S2 S3 S4 RHS


ation Var. (Sol)
z 0 1 0 -0.5 0 1.5 0 0 12
S1 1 0 0 1.5 1 -0.5 0 0 2 2/1.5
XE 2 0 1 0.5 0 0.5 0 0 4 4/0.5
1 S3 3 0 0 1.5 0 0.5 1 0 5 5/1.5
S4 4 0 0 1 0 0 0 1 2 2/1.0

Entering Variable: Select the variable with


the most negative coefficient in the
objective function Leaving Variable: Smallest
ratio obtained by dividing
the RHS of each row by the
positive coefficients of the
entering variable (Column)

13
Optimization Linear Programming/Simplex Method

Iteration 2

Iter- Basic Eq. Z XE XI S1 S2 S3 S4 RHS


ation Var. (Sol)
z 0 1 0 0 0.33 1.33 0 0 12.66
XI 1 0 0 1 0.66 -0.33 0 0 1.33
2 XE 2 0 1 0 -0.33 0.66 0 0 3.33
S3 3 0 0 0 -1.0 1.0 1 0 3
S4 4 0 0 0 -0.66 0.33 0 1 0.66

Since all the coefficients in the objective function are positive we stop: We have
found the optimal Solution.

The optimum solution is: XE = 3.33, XI = 1.33, and z = 12.66.


Remember: z = 3XE + 2XI

14
Optimization Linear Programming/Simplex Method

Using the Simplex procedure for Minimization problems


• A minimization problem can be converted to a
maximization problem just by multiplying the
objective function by (-1).
• Once this is done the problem is solved exactly
the same as the maximization problem

Example:

Minimize z = x1- 3x2 –2x3 Maximize (-z) = -x1+ 3x2 + 2x3 Max. –z + x1 - 3x2 –2x3 = 0
Subject to: Subject to: Subject to:
3x1 - x2 + 2x3 7 3x1 - x2 + 2x3 7 3x1 - x2 + 2x3 + S1 = 7
-2x1 + 4x2 + 2x3  12 -2x1 + 4x2 + 2x3  12 -2x1 + 4x2 + 2x3+ S2 = 12
-4x1 + 3x2 + 8x3  10 -4x1 + 3x2 + 8x3  10 -4x1 + 3x2 + 8x3 + S3 = 10
x1, x2  0 x1, x2  0 x1, x2, S1 , S2, S3, 0

15
Optimization Linear Programming/Simplex Method

Simplex Solution of Minimization Problem


Iter- Basic Eq Z X1 X2 X3 S1 S2 S3 RHS
ation Var. (Sol)
0 z 0 -1 1 -3 -2 0 0 0 0
S1 1 0 3 -1 2 1 0 0 7
S2 2 0 -2 4 0 0 1 0 12
S3 3 0 -4 3 8 0 0 1 10
1 z 0 -1 -0.5 0 -0.5 0 0.75 0 9
S1 1 0 2.5 0 2.5 1 0.25 0 10
X2 2 0 -0.5 1 0.5 0 0.25 0 3
S3 3 0 -2.5 0 6.5 0 -0.75 1 1
2 z 0 -1 0 0 0 0.2 0.8 0 11
X1 1 0 1 0 1 0.4 0.1 0 4
X2 2 0 0 1 1 0.2 0.3 0 5
S3 3 0 0 0 9 1.0 -0.5 1 11

The optimum solution is: X1 = 4, X2 = 5, X3 = 0, and z = 11.


16
Optimization Linear Programming/Simplex Method

Special Cases in the Simplex Method

• Special types of LP problems need special attentions


• Special types:
– More than one optimal solution
– Unbounded solutions
– Ties for pivot column and/or ties for the pivot row
– Constraints with negative quantity values

17
Optimization Linear Programming/Simplex Method

➢ Multiple Optimal Solutions

• Objective function max. z=40x1+30x2 Objective function

Subject to:
x1 + 2x2≤40
4x1 + 3x2 ≤ 120
x1, x2 , s1, s2 ≥ 0
A
• z is parallel to the constraint line
4x1+ 3x2 = 120
• Endpoints B and C, are referred to as B
alternate optimal solutions

18
Optimization Linear Programming/Simplex Method

Multiple Solutions from the Simplex Tableau


Not in solution
• The optimal simplex tableau is: but has a 0 coef.
• How do we know that multiple
optimal solution exist?
• Determined from the row z
• Negative row z values represent
profit 0
• Values of zero indicate no
increase or loss
• Coefficients of x1 and s1 have
zero values
• Coefficient of x2 has a value of
zero and it is not part of basic
solution.

19
Optimization Linear Programming/Simplex Method

Multiple Solutions from the Simplex Tableau (cont.)

• If x2 enters solution, we will


have a new solution without
changing z
• Multiple optimal solution is
indicated by a value of zero
in row z for a nonbasic
variable
• To determine alternate
solution, select x2 as the
entering variable and then
determine pivot row as
usual.

20
Optimization Linear Programming/Simplex Method

➢ Unbounded Problems

• Occur where feasible solution


area is not closed.
• Objective function increases
indefinitely without ever reaching
a maximum value
– Never reaches boundary of
the feasible solution area
z=4x1+2x2
Subject to:
x1≥4
x2≤2
x1, x2≥0

21
Optimization Linear Programming/Simplex Method

Unbounded Problems (cont.)


First tableau
• In second tableau, s1 is chosen
as the entering variable
because it has most negative
coefficient in row Z
• There is no leaving variable
because one row value is -4
and the other is undefined
• Indicates that solution is
unbounded
Second tableau
• A solution is unbounded if row
value ratios are all negative or
undefined
• Occurs as a result of making
errors in defining problem or
in formulating LP problem.

22
Optimization Linear Programming/Simplex Method

➢ 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

23
Optimization Linear Programming/Simplex Method

Tie for the Pivot Row

• In second tableau, we will see


a tie for pivot row between s1,
and s3 rows
• S3 row is selected arbitrarily,
the resulting third tableau will
be shown:

S1 ratio: 12/6 =2
S3 ratio: 10/5 =2

24
Optimization Linear Programming/Simplex Method

Loop in Solutions
• A value of zero
for s1 indicates a degeneracy
condition
• s2 is entering variable and s1
as pivot row.

• Optimal solution did not


change
• Graphical analysis of this
problem is shown in the next
slide:

25
Optimization Linear Programming/Simplex Method

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 loops back
to same solution B
• Two tableaus represent two
different basic feasible solutions
with two different model
constraint equations.

26

You might also like