0% found this document useful (0 votes)
5 views

Unit 6

The document provides an overview of the Simplex Method, a mathematical approach used to solve linear programming problems with multiple variables and constraints. It explains the key concepts, assumptions, and the iterative process involved in finding optimal solutions, illustrated through the Wyndor Glass Co. example. The document also details the setup of the simplex method, including converting inequality constraints into equality constraints and the role of basic and nonbasic variables.

Uploaded by

Lap Sang Ho
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Unit 6

The document provides an overview of the Simplex Method, a mathematical approach used to solve linear programming problems with multiple variables and constraints. It explains the key concepts, assumptions, and the iterative process involved in finding optimal solutions, illustrated through the Wyndor Glass Co. example. The document also details the setup of the simplex method, including converting inequality constraints into equality constraints and the role of basic and nonbasic variables.

Uploaded by

Lap Sang Ho
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

(EE3006/3006A)

Unit 6. Simplex Method


1. Introduction
• The essence of the simplex method
• The key solution concepts

2. Simplex Method
• Setting up the simplex method
• The algebra of simplex method
• Simplex method in tabular form

(EE3006/3006A)

1. Introduction
 Why use simplex method?
 Most of real-life linear-programming (LP) problems depend
on many variables;
 Graphical method can only solve LP problems with 2 variables;

 Simplex method can be used to solve LPs with hundreds of


constraints and variables;
 Simplex method allows the development of computer-based
approaches to solve LP problems.

1
(EE3006/3006A)

1.1 The essence of the simplex method

 Simplex
-> Assumptions
methodofisLPs:
an algebraic procedure;
->
– The underlying
Linearity concepts
implies that of the function
the objective simplexand
method areconstraints
all of the geometric; are
in linear relationship.
-> Understanding these
(Proportionality and geometric
additivity concepts isofvery
are consequences helpful
the linear for
assumption. )
thorough comprehension of their algebraic equivalents.
– Nonnegativity simply means that all decision variables must take positive
or zero values.
– Divisibility means that the optimal values of decision variables may be
fractional depending upon the application.
– Certainty requires that the parameters of LP model are known or can be
accurately estimates.

(EE3006/3006A)

Example: Wyndor Glass Co. problem (Ref. 1, pp. 26-28)


The WYNDOR GLASS Co. produces high-quality glass products, including window
and glass doors. It has three plants. Aluminum frames and hardware are made in Plant 1,
wood frames are made in Plant 2, and Plant 3 produces the glass and assembles the
products.
Because of declining earnings, top management has decided to revamp the
company’s product lines. Unprofitable products are being discontinued to release
production capacity for launching two new products with better potential: Product 1
(glass door with aluminum frame), Product 2 (double-hung wood-framed window):
Production Time per Batch, Hours Product Time Available
Plant Product 1 Product 2 per Week, Hours
1 1 0 4
2 0 2 12
3 3 2 18
Profit per batch $3,000 $5,000

How many batches of each new product should be produced per week to maximize
the profit?
4

2
(EE3006/3006A)

$3K $5K

Mathematical Programming

The LP problem can be written as:


Maximize : Z =3 x1 + 5 x2 (Objective function)
subject to: x1 ≤ 4
2 x2 ≤ 12 (Constrains)
3 x1 +2 x2 ≤ 18
and
x1 ≥ 0, x2 ≥ 0. (Hidden conditions)
5

(EE3006/3006A)

x2 • Constraint boundaries
(0,9)
x1 ≤ 4 • Feasible region
• Edges of the feasible region

(0,6) (2,6) (4,6)  Corner-point solutions


2 x2 ≤ 12
(the points of intersection)
 Corner-point feasible (CPF)
solutions
(4,3)
(the corners of the feasible region)
Feasible region Linearity => CPF solutions are potential optimal solutions
3 x1 +2 x2 ≤ 18
 Adjacent CPF solutions
(in a problem with n decision variables,
(0,0) (4,0) (6,0)
two CPF solutions share n-1 constraint
x1 boundaries)

3
(EE3006/3006A)

 Iterative solution-search method for LPs

Initialization
(Start from an initial CPF solution)

Is the current
Yes
CPF solution Stop
optimal?

No
Move to a better
adjacent CPF solution

 Optimality Test (1) in the Simplex method:


-> If a CPF solution has no adjacent solution that is better, it then must be
an optimal solution.
7

(EE3006/3006A)

• Initial CPF solution


x2 2 • Optimality test
(0,6) (2,6) • If not optimal, then move to a better
1 Z=36
Z=30 adjacent CPF solution:
– Consider the edges that emanate
from current CPF solution;
(4,3)
Z=27 – Move along the edge that
increases Z;
– Stop at the first constraint
boundary;
(0,0) (4,0)
0 Z=0 Z=12 – Solve for the intersection of the new
x1 boundaries;
– Back to optimality test;

4
(EE3006/3006A)

1.2 The key solution concepts


1) The simplex method focus only on CPF solutions;
2) The simplex method is an iterative algorithm;
3) If possible, use the origin as the initial CPF solution;
4) Move always to an adjacent and better CPF solution;
5) Don’t calculate the Z value at adjacent solutions, instead move
directly to the one that ‘looks’ better, i.e., with the higher rate of
improvement.

(EE3006/3006A)

5) Don’t calculate the Z value at adjacent solutions, instead move


directly to the one that ‘looks’ better, i.e. with the higher rate of
improvement.
x2
(e.g., at the first iteration, moving from (0,6) (2,6)
(0, 0) along the edge on the x1 axis 1 Z=36
Z=30
would give a rate of improvement of
3, whereas moving along the edge on
the x2 axis would give a rate of (4,3)
improvement of 5) r=30/6= 5 Z=27

6) The modified Optimality Test (2)


looks at the rate of improvement: 0
(0,0) (4,0)
Z=0 Z=12 x1
if all rate of improvement are
r=12/4= 3
negative, it is an optimal solution.

10

5
(EE3006/3006A)

2. Simplex Method
2.1 Setting up the simplex method
 Augmented standard form
=> Convert inequality constraints to equality constraints by adding slack (or
surplus) variables.

Original Form Augmented Standard Form

Maximize: Z = 3x1+5x2 Maximize: Z = 3x1+5x2


subject to: x1 ≤4 subject to: x1 +x3 =4
2x2 ≤ 12 2x2 +x4 = 12
3x1+ 2x2 ≤ 18 3x1+ 2x2 +x5 = 18
and and
x1, x2 ≥ 0 x 1, x 2 , x 3 , x 4 , x 5 ≥ 0
11

(EE3006/3006A)

x2
 Augmented solutions:
(0,9,4,-6,0)
Basic infeasible solution

Basic feasible solution (BFS)


(0,6,4,0,6) (2,6,2,0,0) (4,6,0,0,-6)
Nonbasic feasible solution

(2,3,2,6,6)
(4,3,0,6,0)

(0,2,4,8,14)

(0,0,4,12,18) (4,0,0,12,6) (6,0,-2,12,0)

x1 12

6
(EE3006/3006A)

 Degree of freedom, Nonbasic- & Basic variables

 In an LP, the number of variables > the number of constraint equations.


Their difference is called as the degree of freedom of the system.
(e.g., in Wyndor Glass, degrees of freedom (d.f.) = 2)
 In BFSs, the zero-value variables are called as nonbasic variables.
 The values of the rest variables, called as basic variables, can be obtained
by solving the system of equations.
 The basis of an LP: the set of basic variables.
 If basic variables satisfy the nonnegativity constraint, we have a basic
feasible (BF) solution.
 Two BF solutions are adjacent if all but one of their basic (nonbasic)
variables are the same. (Note: not the values)

13

(EE3006/3006A)

• Example of a BF solution (0, 6, 4, 0, 6):


Augmented Form

Maximize Z = 3x1+ 5x2

subject to x1 +x3 =4
2x2 +x4 = 12
3x1+ 2x2 +x5 = 18

x1, x2, x3, x4, x5 ≥ 0

Algebraically, x1 and x4 are chosen as nonbasic variables, and then solve the system of
equations:
x3 = 4 x3 = 4
2x2 = 12 x2 = 6
2x2 + x5 = 18 x5 = 6
 Here, (0, 6, 4, 0, 6) is also called as the augmented CPF solution, whose CPF
solution is (0, 6).
14

7
(EE3006/3006A)

• Example of adjacent BF solutions:

Augmented Form

Maximize Z = 3x1+ 5x2

subject to x1 +x3 =4
2x2 +x4 = 12
3x1+ 2x2 +x5 = 18

x1, x2, x3, x4, x5 ≥ 0

(0, 0, 4, 12, 18) & (0, 6, 4, 0, 6)

1 2 1 4

 Their nonbasic variables (x1, x2) and (x1, x4) are the same with just one
exception: x2 has been replaced by x4.
15

(EE3006/3006A)

2.2 The algebra of Simplex method

…… Ref. 1, pp. 112

16

8
(EE3006/3006A)

Wyndor Glass

Maximize Z = 3x1+ 5x2


 Initialization:
subject to x1 +x3 =4
• Find an initial basic feasible 2x2 +x4 = 12
3x1+ 2x2 +x5 = 18
solution
• Remember from key concepts: x1, x2, x3, x4, x5 ≥ 0
“If possible, use the origin as the
initial CPF solution”
• Equivalent to:
Choose original variables to be nonbasic (xi=0, i=1,…n) and let the slack
variables be basic (xj=bj, j=1,…m)
Let x1=0 and x2=0, then
(1) x1 +x3 =4 => x3=4
(2) 2x2 +x4 = 12 => x4=12
(3) 3x1+2x2 +x5 = 18 => x5 =18
17

(EE3006/3006A)

Wyndor Glass

Maximize Z = 3x1+ 5x2


 Optimality test:
subject to x1 +x3 =4
• Are any adjacent BF solutions 2x2 +x4 = 12
3x1+ 2x2 +x5 = 18
better than the current one?
• Rewrite Z in terms of nonbasic x1, x2, x3, x4, x5 ≥ 0
variables and investigate rate of
improvement.
• Current nonbasic variables: x1, x2

• Corresponding Z: 3x1+5x2

• These rates of improvement (3, 5) are positive. Therefore, this BFS


(0, 0, 4, 12, 18) is not optimal.

18

9
(EE3006/3006A)

Wyndor Glass

Maximize Z = 3x1+ 5x2


 Step 1 of iteration-1:
subject to x1 +x3 =4
• Which edge to move on? 2x2 +x4 = 12
3x1+ 2x2 +x5 = 18
• Determine the direction of
movement by selecting the x1, x2, x3, x4, x5 ≥ 0
entering basic variable

• Choose the direction of steepest ascent


Increase x1: Rate of improvement in Z is 3
Increase x2: Rate of improvement in Z is 5
• Entering basic variable = x2

19

(EE3006/3006A)

Wyndor Glass

Maximize Z = 3x1+ 5x2


 Step 2 of iteration-1:
subject to x1 +x3 =4
• How far can we go? 2x2 +x4 = 12
3x1+ 2x2 +x5 = 18
• Determine where to stop by
selecting the leaving basic x1, x2, x3, x4, x5 ≥ 0
variable

• Keeping the nonbasic variable x1=0, and then one can derive equations:
(1) x1 +x3 =4
(2) 2x2 +x4 = 12 => x2 = (12-x4)/2 => x2 ≤ 6 (minimum)
(3) 3x1+2x2 +x5 = 18 => x2 = (18-x5)/2 => x2 ≤ 9

• Leaving basic variable = x4


(=> how to choose if Eqn. 3 is: x2 ≤ -9 ? )

20

10
(EE3006/3006A)

 Step 3 of iteration-1:
• Convert the system of equations to a more proper form
for the new BF solution
• Normalize the coefficient of the entering basic variable (x2) in its own
equation to 1.

• Eliminate the entering basic variable (x2) from all but its own equation
by elementary algebraic operations:
(0) Z- 3x1-5x2 =0 => Z - 3x1 +2.5x4 = 30
(1) x1 +x3 =4 => x1 + x3 =4
(2) 2x2 +x4 = 12 => x2 + 0.5x4 =6
(3) 3x1+2x2 +x5 = 18 => 3x1 - x4 + x 5 = 6

21

(EE3006/3006A)

Wyndor Glass1)

Maximize Z = 3x1 - 2.5x4 +30


 Optimality test :
subject to x1 +x3 =4
• Are any adjacent BF solutions x2 + 0.5x4 =6
3x1 - x 4 + x5 = 6
better than the current one?
x1 , x 2 , x 3 , x4 , x 5 ≥ 0

• (Rewrite Z in terms of nonbasic variables and) Investigate rate of


improvement:
Z = 30 +3x1 – 2.5x4
• Because x1 has a positive coefficient (i.e. increasing x1 would lead to an
adjacent BF solution is better than the current BF solution), current
solution is not optimal.

22

11
(EE3006/3006A)

Wyndor Glass1)

Maximize Z = 3x1 - 2.5x4 +30


 Step 1 of iteration-2:
subject to x1 +x3 =4
• Which edge to move on? x2 + 0.5x4 =6
3x1 - x 4 + x5 = 6
• Determine the direction of
x1 , x 2 , x 3 , x4 , x 5 ≥ 0
movement by selecting the
entering basic variable

• Choose the direction of steepest ascent:


Increase x1: Rate of improvement in Z is 3
Increase x4: Rate of improvement in Z is -2.5
• Entering basic variable = x1

23

(EE3006/3006A)

Wyndor Glass1)

Maximize Z = 3x1 - 2.5x4 +30


 Step 2 of iteration-2:
subject to x1 +x3 =4
• How far can we go? x2 + 0.5x4 =6
3x1 - x 4 + x5 = 6
• Determine where to stop by
x1 , x 2 , x 3 , x4 , x 5 ≥ 0
selecting the leaving basic
variable

• Keeping the nonbasic variable x4=0, and then one can derive equations :
(1) x1 +x3 =4 => x1=4- x3 x1 ≤ 4
(2) x2 +0.5x4 =6
(3) 3x1 - x4 +x5 = 6 x1 = (6-x5 )/3 x1 ≤ 2 (minimum) √

• Leaving basic variable = x5

24

12
(EE3006/3006A)

 Step 3 of iteration-2:
• Convert the system of equations to a more proper form for the new BF
solution
• Normalize the coefficient of the entering basic variable (x1) in its own
equation to 1.

25

(EE3006/3006A)

 Optimality test :
• Are any adjacent BF solutions
better than the current one?

( )

Because both coefficients

26

13
(EE3006/3006A)

* Example 1:
Use the simplex method in algebraic form to solve the following problem:
Maximize: Z = 5 x1 + 8 x2 + x3,
subject to: x1 + 2 x2 + 3 x3 ≤ 10,
2 x1 + 2 x2 + x3 ≤ 16,
and x1 ≥ 0, x2 ≥ 0, x3 ≥ 0.
Solution:
The augmented form of the problem can be written as:
Maximize: Z = 5 x1 + 8 x2 + x3,
subject to: x1 + 2 x2 + 3 x3 + x4 = 10,
2x1 + 2x2 + x3 + x5 = 16,
and x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0.
 Initialization:
Choose original variables to be nonbasic, i.e. x1=0, x2=0, x3=0.
Then, x4=10, x5=16.

27

(EE3006/3006A)

 Iteration 1: (nonbasic v.: x1=0, x2=0, x3=0)


Choose the direction of steepest ascent to: x2 as it has highest rate of improvement 8.
Thus, entering basic variable is x2.
x1 + 2 x2 + 3 x3 + x4 = 10, => x2 =(10- x4)/2 (x2 <5) √
2x1 + 2x2 + x3 + x5 = 16, => x2 =(16- x5)/2 (x2 <8)
Therefore, x4 should be the leaving basic variable.
Then, the problem can be rewritten as: Maximize: Z = 5 x1 + 8 x2 + x3,
Maximize: Z = x1 - 11x3 - 4x4+40, subject to: x1 + 2 x2 + 3 x3 + x4 = 10,
subject to: 0.5x1 + x2 + 1.5 x3 +0.5 x4 = 5, 2x1 + 2x2 + x3 + x5 = 16,
x1 - 2x3 - x4 + x5 =6, and x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0.
and x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0.

 Iteration 2: (nonbasic v.: x1=0, x3=0, x4=0)


Choose x1 as the direction of steepest ascent because its rate of improvement is positive.
Thus, the entering basic variable is x1.

28

14
(EE3006/3006A)

 Iteration 2: (nonbasic v.: x1=0, x3=0, x4=0)


Choose x1 as the direction of steepest ascent because its rate of improvement is positive.
Thus, the entering basic variable is x1.
0.5x1 + x2 + 1.5 x3 +0.5 x4 = 5, => x1 =10- 2x2 (x1 <10)
x1 - 2x3 - x4 + x5 =6, => x1 =6- x5 (x1 <6) √
Therefore, x5 should be the leaving basic variable.
Then, the problem can be rewritten as: Maximize: Z = x1 - 11x3 - 4x4+40,
Maximize: Z = –9x3 –3x4 – x5+46, subject to: 0.5x1 + x2 + 1.5 x3 +0.5 x4 = 5,
subject to: x2 + 2.5 x3 + x4 – 0.5x5 = 2, x1 - 2x3 - x4 + x5 =6,
x1 - 2x3 - x4 + x5 =6, and x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0.
and x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0.

Because the coefficients of x3, x4, and x5 are negative, current solution is optimal.
Correspondingly, the nonbasic variables x3 = x4 = x5 = 0, the basic variables: x1=6, x2=2,
and Z = 46.
Check: Z = 5×6 + 8×2 + 1×0 = 46.

29

(EE3006/3006A)

2.3 Simplex method in tabular form


 The algebraic form of the simplex method may be the best one
for learning the underlying logic of the algorithm, but it is not the
most convenient form for performing the required calculation;
 Tabular form can be used to quickly solve a problem by hand;
 The tabular form of the simplex method records only the essential
information of the (evolving) system of equations:
 Basic variables corresponding to equations
 Coefficients of the variables
 Constants on the right-hand-sides

30

15
(EE3006/3006A)

Wyndor Glass

Maximize Z = 3x1+ 5x2


( => Z - 3x1 - 5x2 =0)
subject to x1 +x3 =4
2x2 +x4 = 12
3x1+ 2x2 +x5 = 18

x 1 , x 2 , x 3, x 4 , x 5 ≥ 0

• Convert to initial tableau (nonbasic variables are not listed)

Basic variable Z x1 x2 x3 x4 x5 r.h.s.

z 1 -3 -5 0 0 0 0

x3 0 1 0 1 0 0 4

x4 0 0 2 0 1 0 12

x5 0 3 2 0 0 1 18
31

(EE3006/3006A)

• Iteration 1:
1) Optimality test (every coefficient in row 0 is nonnegative?)
2) Entering basic variable (steepest ascent => most negative coefficient)
– pivot column

Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.

Z 1 -3 -5 0 0 0 0
x3 0 1 0 1 0 0 4
x4 0 0 2 0 1 0 12
x5 0 3 2 0 0 1 18

32

16
(EE3006/3006A)

3) Leaving basic variable (minimum ratio test) – pivot row

Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.

Z 1 -3 -5 0 0 0 0
x3 0 1 0 1 0 0 4
x4 0 0 2 0 1 0 12
x5 0 3 2 0 0 1 18

33

(EE3006/3006A)

4) Elementary row operations


I. Divide the pivot row by the pivot number;
II. For each row that has non-zero coefficient in the pivot column, do elementary row
operation to eliminate the entering basic variable from the row.

Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.

Z 1 -3 -5 0 0 0 0
x3 0 1 0 1 0 0 4
(0)
x4 0 0 2 0 1 0 12
x5 0 3 2 0 0 1 18

Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.

Z 1 -3 0 0 0 30
x3 0 1 0 1 0 4
(1)
x2 0 0 1 0 0 6
x5 0 3 0 0 1 6

34

17
(EE3006/3006A)

• Iteration 2:
1) Optimality test (Is every coefficient in the first row nonnegative?)
2) Entering basic variable (most negative coefficient) – pivot column
3) Leaving basic variable (minimum ratio test) – pivot row

Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.

Z 1 -3 0 0 0 30

x3 0 1 0 1 0 4

x2 0 0 1 0 0 6

x5 0 3 0 0 1 6

35

(EE3006/3006A)

4) Elementary row operations


I. Divide the pivot row by the pivot number;
II. For each row that has non-zero coefficient in the pivot column, do elementary row
operation to eliminate the entering basic variable from the row.
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.

Z 1 -3 0 0 0 30
x3 0 1 0 1 0 0 4
(1)
x2 0 0 1 0 0 6
x5 0 3 0 0 -1 1 6

Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.

Z 1 0 0 0 1 36

x3 0 0 0 1 -1/3 2
(2)
x2 0 0 1 0 0 6

x1 0 1 0 0 1/3 2

36 x =6.
Every coefficient in the first row is nonnegative => Optimal solution is Z= 36, when x1=2, 2

18
(EE3006/3006A)

• Complete set of the simplex tableaux


Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.

Z 1 -3 -5 0 0 0 0
(0) x3 0 1 0 1 0 0 4
x4 0 0 2 0 1 0 12
x5 0 3 2 0 0 1 18
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.

Z 1 -3 0 0 0 30
x3 0 1 0 1 0 0 4
(1)
x2 0 0 1 0 0 6
x5 0 3 0 0 -1 1 6
Basic
variable
Z x1 x2 x3 x4 x5 r.h.s.

Z 1 0 0 0 1 36

x3 0 0 0 1 -1/3 2
(2)
x2 0 0 1 0 0 6
x1 0 1 0 0 1/3 2
37
The optimal solution is Z= 36, when x1=2, x2=6. Check: Z=3×2+5×6=36.

(EE3006/3006A)

Classwork 6:
Q1. Use the simplex method in tabular form to solve the following
problem:
Maximize: Z = 2x1+x2-3x3+5x4,
subject to: x1 + 2x2 + 2x3 + 4x4 ≤ 44,
2x1 - x2 + x3 + 2x4 ≤ 8,
4x1- 2x2 + x3 – x4 ≤ 10,
and all variables are nonnegative.

38

19
(EE3006/3006A)

Reference:
1. Frederick s. Hillier and Gerald J. Lieberman,
Introduction to Operations Research, Eighth Edition
McGraw Hill, 2000
Chapter 4. Solving Linear Programming Problems: The Simplex
Method, pp. 103 ~ 121.

39

20

You might also like