Lecture 3-1 Simplex Algorithm
Lecture 3-1 Simplex Algorithm
AND OPTIMIZATION
➢ The simplex method is not used to examine all the feasible solutions.
➢ It deals only with a small and unique set of feasible solutions, the
set of vertex points (i.e., extreme points) of the convex feasible
space that contains the optimal solution.
RELATED CONCEPTS
➢ Standard form: all constraints are equations and all variables are nonnegative.
➢ Basic feasible solution (Bfs): any basic solution where all variables are
nonnegative. (unboundedness/boundedness)
Controlling constraint
1. Pivot row
a. Replace the leaving variable in the Basic column with the entering variable.
New row = (current row) – (Its pivot column coefficient) x (New pivot row)
STEP INVOLVED
Step 1. Determine a starting basic feasible solution.
The appropriate LP is
x1, x2 0
EXAMPLE – LEATHER LIMITED
Convert (1) and (2) to equality constraints, defined for each constraint
s1 unused leather
s1 = 40 – x1 – x2 or x1 + x2 + s1 = 40
s2 = 60 – 2x1 – x2 or 2x1 + x2 + s2 = 60
observe that a point (x1,x2) satisfy the ith constraint if and only if si 0
Subject to x1 + x2 + s1 = 40
2x1 + x2 + s2 = 60
x1, x2,x3, x4 0
EXAMPLE – DIET PROBLEM
Convert the ith constraint to an equality constraint
e1 oversatisfied calories
e1 = 400x1 + 200x2 + 150x3 + 500x4 – 500, or 400x1 + 200x2 + 150x3 + 500x4 – e1 = 500
e2 oversatisfied chocolate
e3 oversatisfied sugar
e4 oversatisfied fat
(x1, x2, x3, x4) satisfies the ith constraint if and only if ei is nonnegative.
EXAMPLE – DIET PROBLEM
min z = 50x1 + 20x2 + 30x3 + 80x4
3x1 + 2x2 – e2 =6
(xi , ei) 0 (I = 1, 2, 3, 4)
EXAMPLE – THE REDDY MIKKS COMPANY
Reddy Mikks produces both interior and exterior paints from two raw
materials, M1 and M2. The following table provides the basic data of the
problem.
Tons of raw material per ton of Maximum daily
Exterior paint Interior paint availability (tons)
Raw material, M1 6 4 24
Raw material, M2 1 2 6
Profit per ton ($ 1000) 5 4
A market survey indicates that the daily demand for interior paint cannot
exceed that for exterior paint by more than 1 ton. Also, the maximum daily
demand for interior paint is 2 tons. Reddy Mikks wants to determine the
optimum (best) product mix of interior and exterior paints that maximizes the
total daily profit.
EXAMPLE – THE REDDY MIKKS COMPANY
LP model
Maximize z = 5x1 + 4 x2
Subject to
6x1 + 4 x2 24
x 1 + 2 x2 6
-x1 + x2 1
x2 2
x1, x2 0
EXAMPLE – THE REDDY MIKKS COMPANY
Expressed in equation form
Maximize z = 5x1 + 4 x2 + 0s1 + 0s2 + 0s3 + 0s4
Subject to
6x1 + 4 x2 + s1 = 24
x 1 + 2 x2 + s2 = 6
-x1 + x2 + s3 = 1
x2 + s4 = 2
x 1 , x 2 , s 1 , s2 , s3 , s4 0
Rewrite the objective function
z – 5x1 – 4x2 = 0
EXAMPLE – THE REDDY MIKKS COMPANY
z x1 x2 s1 s2 s3 s4 solution BV
1 -5 -4 0 0 0 0 0 z
0 6 4 1 0 0 0 24 s1 = 24
0 1 2 0 1 0 0 6 s2 = 6
0 -1 1 0 0 1 0 1 s3 = 1
0 0 1 0 0 0 1 2 s4 = 2
Initial tableau Leaving variable Pivot Equation
Entering variable
R z x1 x2 s1 s2 s3 s4 solution BV Ratio
R0 1 -5 -4 0 0 0 0 0 z
R1 0 6 4 1 0 0 0 24 s1 = 24 24/6 = 4
R2 0 1 2 0 1 0 0 6 s2 = 6 6/1 = 6
R3 0 -1 1 0 0 1 0 1 s3 = 1 1/-1 = -1
R4 0 0 1 0 0 0 1 2 s4 = 2 2/0 = N/A
GAUSS-JORDAN COMPUTATIONS
1. Pivot row
a. Replace the leaving variable in the Basic column with the entering variable
b. New pivot row = Current pivot row Pivot element
= (0 0 1 0 0 0 1 2)
New z = Old z + New x1 value x its coefficient
=0 + 4 x 5 = 20
First tableau
R z x1 x2 s1 s2 s3 s4 solution BV Ratio
R0’ 1 0 -2/3 5/6 0 0 0 20 Z = 20
R1’ 0 1 2/3 1/6 0 0 0 4 x1 = 4 4/(2/3) = 6
R2’ 0 0 4/3 -1/6 1 0 0 2 s2 = 2 2/(4/3) =1.5
R3’ 0 0 5/3 1/6 0 1 0 5 s3 = 5 5/(5/3) =3
R4’ 0 0 1 0 0 0 1 2 s4 = 2 2/1 = 2
EXAMPLE – THE REDDY MIKKS COMPANY
4
1. R2’’ row = R2’ row
3
3 4 1
= (0 0 − 1 0 0 2)
4 3 6
1 3 3
= (0 0 1 − 0 0 )
8 4 2
2
2. R0’’ row = R0’ row – (- ) x R2’’ row
3
2 5 2 1 3 3
= 1 0 − 0 0 0 20 − − 𝑥 (0 0 1 − 0 0 )
3 6 3 8 4 2
3 1
= (1 0 0 0 0 21)
4 2
EXAMPLE – THE REDDY MIKKS COMPANY
2
3. R1’’ row = R1’ row – ( ) x R2’’ row
3
2 1 2 1 3 3
= 0 1 0 0 0 4 − 𝑥 (0 0 1 − 0 0 )
3 6 3 8 4 2
1 1
= (0 1 0 − 0 0 3)
4 2
5
4. R3’’ row = R3’ row – ( ) x R2’’ row
3
5 1 5 1 3 3
= 0 0 0 1 0 5 − 𝑥 (0 0 1 − 0 0 )
3 6 3 8 4 2
3 5 5
= (0 0 0 − 1 0 )
8 4 2
EXAMPLE – THE REDDY MIKKS COMPANY
5. R4’’ row = R4’ row – (1) x R2’’ row
1 3 3
= 0 0 1 0 0 0 1 2 − 1 𝑥 (0 0 1 − 0 0 )
8 4 2
1 3 1
= (0 0 0 − 0 1 )
8 4 2
New z = Old z + New x2 value x its coefficient
= 20 + 1.5 x (2/3) = 21
Optimize tableau
R z x1 x2 s1 s2 s3 s4 solution BV
R0’ 1 0 0 3/4 1/2 0 0 21 Z = 21
R1’ 0 1 0 1/4 -1/2 0 0 3 x1 = 3
R2’ 0 0 1 -1/8 3/4 0 0 1.5 x2 = 1.5
R3’ 0 0 0 3/8 -5/4 1 0 2.5 s3 = 2.5
R4’ 0 0 0 1/8 -3/4 0 1 0.5 s4 = 0.5
EXAMPLE – THE REDDY MIKKS COMPANY
Base on the optimally condition, none of the z-row coefficients are negative.
Hence the last tableau is optimal.
Solution column can be interpreted as
Entering variable
Row Basic Variable Ratio
R0’ z + 15x2 – 5x3 + 30s3 = 240 z = 240
R1’ – x3 + s1 – 4s3 = 16 s1 = 16 16/-1 = -16 (no ratio)
R2’ – x2 + 0.5x3 +s2 – 2s3 =4 s2 = 4 4/0.5 = 8
R3’ x1 + 0.75x2 + 0.25x3 + 0.5s3 =4 x1 = 4 4/0.25 = 16
R4’ x2 +s4 =5 s4 = 5 5/0 = no ratio
R5’ x1, x2, x3, s1, s2, s3, s4 0
Leaving variable Pivot Equation
EXAMPLE – DAKOTA FURNITURE
Row 1’ : no ratio (x3 has negative coefficient in row 1)
Row 2’: 4/0.5 = 8
Row 3’: 4/0.25 = 16
Row 4’: no ratio (x3 has nonpositive coefficient in row 4)
Rearranging the pivot equation gives
R2” - 2x2 + x3 + 2s2 - 4s3 = 8 (R2’× 2).
Row operations with R2’’ eliminate x3 to give the new system
R0’’= R0’ + 5R2’’, R1’’ = R1’ + R2’’, R3’’ = R3’ - .25R2’’,
R4’’ = R4’
EXAMPLE – DAKOTA FURNITURE
Row Basic Variable
R0” z + 5x2 + 10s2 + 10s3 = 280 z = 280
R1” – 2x2 + s1 + 2s2 – 8s3 = 24 s1 = 24
R2” – 2x2 + x3 + 2s2 – 4s3 = 8 x3 = 8
R3” x1 + 1.25x2 – 0.5s2 + 1.5s3 = 2 x1 = 2
R4” x2 +s4 = 5 s4 = 5
x2 = x3 = 0
TABLEAU FORMAT
First tableau
z x1 x2 x3 s1 s2 s3 s4 Solution BV Ratio
1 0 15 -5 0 0 30 0 240 z = 240
0 0 0 -1 1 0 -4 0 16 s1 = 16 -
0 0 -1 0.5 0 1 -2 0 4 s2 = 4 4/0.5 = 8
0 1 0.75 0.25 0 0 0.5 0 4 x1 = 4 4/0.25 = 16
0 0 1 0 0 0 0 1 5 s4 = 5 -
x2 = s3 = 0
x2 = x3 = 0
TABLEAU FORMAT
First tableau
z x1 x2 x3 s1 s2 s3 s4 Solution BV Ratio
1 0 10 -5 0 0 30 0 240 z = 240
0 0 0 -1 1 0 -4 0 16 s1 = 16 None
0 0 -1 0.5 0 1 -2 0 4 s2 = 4 4/0.5 = 8
0 1 0.75 0.25 0 0 0.5 0 4 x1 = 4 4/0.25 = 16
0 0 1 0 0 0 0 1 5 s4 = 5 None
x2 = s3 = 0
z x1 x2 x3 s1 s2 s3 s4 Solution BV
1 0 0 0 0 10 10 0 280 z = 280
0 1.6 0 0 1 1.2 -5.6 0 27.2 s1 = 27.2
0 1.6 0 1 0 1.2 -1.6 0 11.2 x3 = 11.2
0 0.8 1 0 0 -0.4 1.2 0 1.6 x2 = 1.6
0 -0.8 0 0 0 0.4 -1.2 1 3.4 s4 = 3.4
Because x2 has a zero coefficient in the optimal tableau’s row 0, the pivot that
enters x2 into the basis does not change row 0.
In summary, if tables sell for $35, Dakota can obtain $280 in sales revenue by
manufacturing 2 desks and 8 chairs or manufacturing 1.6 tables and 11.2 chairs.
min z = 4x1 - x2
Subject to 2x1 + x2 8
x2 5
x1 - x2 4
x1 , x 2 0
EXAMPLE - SOLUTION
min z = 4x1 - x2
x2 5 (2)
x1 - x2 4 (3)
2x1 + x2 + s 1 = 8 (1)
x2 + s2 =5 (2)
x1 - x2 + s3 =4 (3)
Initial Tableau
EXAMPLE - SOLUTION
z x1 x2 s1 s2 s3 Solution BV Ratio
1 -4 1 0 0 0 0 z =0
0 2 1 1 0 0 8 s1 = 8 8/1 = 8
0 0 1 0 1 0 5 s2 = 5 5/1 = 5
0 1 -1 0 0 1 4 s3 = 4 4/-1 = -4 (None)
First Tableau and optimize
z x1 x2 s1 s2 s3 Solution BV
1 -4 0 0 -1 0 -5 z= -5
0 2 0 1 -1 0 3 s1 = 3
0 0 1 0 1 0 5 x2 = 5
0 1 0 0 1 1 9 s3 = 9
x1 = 0, x2 = 5, z = -5
If all nonbasic variables in row 0 have nonpositive coefficients, then the current bfs is optimal.
METHOD 2
EXAMPLE
min z = 4x1 - x2
Subject to 2x1 + x2 8
x2 5
x1 - x2 4
x1 , x 2 0
EXAMPLE - SOLUTION
Multiply objective function by (-1)
max -z = -4x1 + x2
x2 5 (2)
x1 - x2 4 (3)
2x1 + x2 + s 1 = 8 (1)
x2 + s2 =5 (2)
x1 - x2 + s3 =4 (3)
Initial Tableau
EXAMPLE - SOLUTION
-z x1 x2 s1 s2 s3 Solution BV Ratio
1 4 -1 0 0 0 0 z =0
0 2 1 1 0 0 8 s1 = 8 8/1 = 8
0 0 1 0 1 0 5 s2 = 5 5/1 = 5
0 1 -1 0 0 1 4 s3 = 4 4/-1 = -4 (None)
First Tableau and optimize
-z x1 x2 s1 s2 s3 Solution BV
1 4 0 0 1 0 -5 z= -5
0 2 0 1 -1 0 3 s1 = 3
0 0 1 0 1 0 5 x2 = 5
0 1 0 0 1 1 9 s3 = 9
x1 = 0, x2 = 5, z = -5
If all nonbasic variables in row 0 have positive coefficients, then the current bfs is optimal.
UNBOUNDED LP
EXAMPLE – UNBOUNDED LP
Breadco Bakeries bakes two kinds of bread: French and sourdough. Each loaf of French bread can be
sold for 36¢, and each loaf of sourdough bread for 30¢. A loaf of French bread requires 1 yeast
packet and 6 oz of flour; sourdough requires 1 yeast packet and 5 oz of flour. At present, Breadco has 5
yeast packets and 10 oz of flour. Additional yeast packets can be purchased at 3¢ each, and additional
flour at 4 ¢/oz. Formulate and solve an LP that can be used to maximize Breadco’s profits ( = revenues -
costs).
Define
x1 = number of loaves of French bread baked
x2 = number of loaves of sourdough bread baked
x3 = number of yeast packets purchased
x4 = number of ounces of flour purchased
Then Breadco’s objective is to maximize z = revenues – costs, where
Revenues = 36 x1 + 30 x2 and Costs = 3 x3 + 4 x4
EXAMPLE – UNBOUNDED LP
Thus, Breadco’s objective function is
max z = 36 x1 + 30 x2 - 3 x3 - 4 x4
Constraints 1
Number of yeast packages used to bake bread cannot exceed available yeast plus purchased yeast.
Initial Tableau
z x1 x2 x3 x4 s1 s2 Solution BV Ratio
1 -36 -30 3 4 0 0 0 z=0
0 1 1 -1 0 1 0 5 s1=5 5/1 = 5
0 6 5 0 -1 0 1 10 s2=10 10/6 = 5/3
EXAMPLE – UNBOUNDED LP
First Tableau
z x1 x2 x3 x4 s1 s2 Solution BV Ratio
1 0 0 3 -2 0 6 60 z = 60
0 0 1/6 -1 1/6 1 -1/6 10/3 s1=10/3 (10/3)/(1/6) = 20
0 1 5/6 0 -1/6 0 1/6 5/3 x1=5/3 none
Second Tableau
z x1 x2 x3 x4 s1 s2 RHS BV Ratio
1 0 2 -9 0 12 4 100 z = 100 Ratio test fail !
0 0 1 -6 1 6 -1 20 x4= 20 none
0 1 1 -1 0 1 0 5 x 1= 5 none
An unbounded LP for a max problem occurs when a variable with a negative in a row 0 has a
non positive coefficient in each constraint.
EXAMPLE – UNBOUNDED LP
First Tableau
z x1 x2 x3 x4 s1 s2 Solution BV Ratio
1 0 0 3 -2 0 6 60 z = 60
0 0 1/6 -1 1/6 1 -1/6 10/3 s1=10/3 (10/3)/(1/6) = 20
0 1 5/6 0 -1/6 0 1/6 5/3 x1=5/3 none
Second Tableau
z x1 x2 x3 x4 s1 s2 RHS BV Ratio
1 0 2 -9 0 12 4 100 z = 100 Ratio test fail
0 0 1 -6 1 6 -1 20 x4= 20 none
0 1 1 -1 0 1 0 5 x 1= 5 none
We obtained an unbounded LP because we allowed Breadco to pay 3 + 6(4) = 27¢ for the
ingredients in a loaf of French bread and then sell the loaf for 36 ¢. The profit is 9¢. Because
unlimited purchases of yeast and flour are allowed, it is clear Breadco can manufacture as much
French bread as it desires. This is the cause of unbounded LP.