0% found this document useful (0 votes)
26 views37 pages

Or C3 Simplex Method

Chapter 3 discusses the Simplex Method for solving linear programming problems, detailing its geometric and algebraic approaches. It covers the setup of the Simplex Method, including the use of slack and surplus variables, and outlines the Big M and Two-phase methods for handling different types of constraints. The chapter emphasizes the iterative nature of the Simplex Method and provides a structured process for finding optimal solutions.

Uploaded by

jioulam10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views37 pages

Or C3 Simplex Method

Chapter 3 discusses the Simplex Method for solving linear programming problems, detailing its geometric and algebraic approaches. It covers the setup of the Simplex Method, including the use of slack and surplus variables, and outlines the Big M and Two-phase methods for handling different types of constraints. The chapter emphasizes the iterative nature of the Simplex Method and provides a structured process for finding optimal solutions.

Uploaded by

jioulam10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Chapter 3

SOLVING LP PROBLEMS:
THE SIMPLEX METHOD

Instructor: Assoc. Prof. Dr. PHAN THỊ MAI HÀ


TABLE OF CONTENTS
1. Introduction about Simplex Method
2. Setting up the Simplex Method
3. The Algebra of the Simplex Method
4. The Simplex Method in Tabular Form
5. The Big M Method
6. The Two-phase Method

2
INTRODUCTION OF THE SIMPLEX METHOD
❖ Simplex method: general procedure for solving linear
programming problems
▪ Geometric method
▪ Algebraic procedure.
❖ The geometric method:
▪ Only works for two-dimensional problems, i.e. problems
that have two variables
▪ It requires solving a system of equations for every corner
point.
❖ Real-life optimization problems:
▪ Thousands of variables and thousands of constraints
▪ Astronomical numbers of corner points
▪ Making the above technique impossible... even on super-
computers 3
INTRODUCTION OF THE SIMPLEX METHOD

❖ The Wyndor Glass Co.


- constraint boundary
- corner-point solutions
- optimality test: no better
adjacent CPF solutions

4
INTRODUCTION OF THE SIMPLEX METHOD

❖ Geometric method:
- Focus solely on CPF solutions
- Iterative algorithm:

- First initialization: origin (all decision variables equal to zero)


- Adjacent CPF solution is faster

5
INTRODUCTION OF THE SIMPLEX METHOD

❖ Geometric method :
- Focus on adjacent CPF solution that have positive rate of
improvement in Z
- If no adjacent CPF’s positive rate of improvement → optimal
solution

6
INTRODUCTION OF THE SIMPLEX METHOD
The geometric of the simplex method
Maximize Z = 3x1 + 5x2 x2
Subject to
x1 ≤4
2x2 ≤ 12 9 3x1 + 2 x2 = 18
3x1 + 2x2 ≤ 18 8
x1 ≥0 7
(6,2) x1 = 4
x2 ≥ 0. (6,0) 6
Z= 36 2 x2 = 12
Z= 30
❑ Start at any feasible extreme point. 5
4
❑ Move to an adjacent extreme point Feasible (4,3)
with better objective value. 3 region Z= 27
2
❑ Continue until no adjacent extreme
point has a better objective value. 1

(0,0) 0 1 2 3 4 5 6 7 x1
Z=0 (4,0)
Z= 12
7
SETTING UP THE SIMPLEX METHOD
❖ The algebra of the simplex method:
LP Standard form:
1. Non-negativity constraints for all variables.
2. All remaining constraints are expressed as equality constraints.
3. The right-hand side vector, b, is non-negative.
Slack variables:
❑ Added since the constraints are in terms of inequalities (≤).
❑ Measure the amount of “unused resource.”
Surplus variable :
❑ Added since the constraints are in terms of inequalities ().
Convert : Max. Z = - Min (- Z)
Example: Max Z = 5x1 + 3x2 has the same solution with
Min (-Z) = - 5x1 - 3x2 8
SETTING UP THE SIMPLEX METHOD
❖ The algebra of the simplex method:
Original form After converting

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


Subject to Subject to
x1 ≤4 x1 + s1 =4
2x2 ≤ 12 2x2 + s2 = 12
3x1 + 2x2 ≤ 18 3x1 + 2x2 + s3 = 18
x1 ≥ 0
x2 ≥ 0. x1≥ 0, x2 ≥ 0, s1 ≥0, s2 ≥0, s3 ≥0.

m: number of constraints
n: number of variables
n – m: number of non-basic variables
m = 3; n = 5 ➔ Number of nonbasic = 2, basic = 3.

9
SETTING UP THE SIMPLEX METHOD
x1 x2 s1 s2 s3 Basic Corner NBV BV Basic feasible
solution? point? solution?

0 0 4 12 18 yes yes x1, x2 s1,s2,s3 yes

0 6 4 0 6 yes yes x1, s3 yes

2 6 2 0 0 yes yes s 2 , s3 yes

Slack variables: nonnegative


Nonbasic variables (NBV): the variables are set to 0 to find basic solution
Basic variables (BV) : The variables are solved
Basic feasible solutions (BFS): The basic variables satisfy the
nonnegativity constraints

10
SETTING UP THE SIMPLEX METHOD
1. The entering variable: the most negative (the most positive)
objective function coefficient for maximize Z (for minimize Z).
The column identified is called pivot column.
2. The leaving variable: by dividing amount in RHS by the
corresponding number in the selected column, select smallest
ratio, take only positive number. This row is called pivot row, the
intersection called pivot number.
3. All numbers in the Z-eq. are non-negative for MAXIMIZE
PROBLEM and non-positive for MINIMIZE PROBLEM, reach
optimal.

11
SETTING UP THE SIMPLEX METHOD

12
THE SIMPLEX METHOD IN TABULAR FORM
Start

Convert to LP
standard form

Find the initial


solution

Optimal
End
solution Yes
No

Pivot row, column, Selecting entering variable


number

Selecting leaving variable


13
THE SIMPLEX METHOD IN TABULAR FORM

14
THE SIMPLEX METHOD IN TABULAR FORM

15
THE SIMPLEX METHOD IN TABULAR FORM

16
THE SIMPLEX METHOD IN TABULAR FORM

17
THE SIMPLEX METHOD IN TABULAR FORM

18
THE SIMPLEX METHOD IN TABULAR FORM

19
THE SIMPLEX METHOD IN TABULAR FORM
1. Convert LP problem to standard form
2. Test optimality:
❑ Find initial basis feasible solution(BFS)
❑ Check the initial BFS, if initial BFS is an optimal solution, stop.
▷ Otherwise:
❑ Determine the entering variable ( the most positive coefficient value or
the most negative coefficient in Z-eq for maximize problem or minimize
problem, respectively).
❑ Determine the leaving variable (minimum ratio test).
❑ The pivot number must be equal to 1 in the next iteration.
❑ The rest of number in the pivot column must be equal to 0 in the next
iteration.
▷ When all numbers in the Z-eq. are non-negative for MAXIMIZE
PROBLEM and non-positive for MINIMIZE PROBLEM, reach optimal. 20
THE BIG M METHOD
❖ LP Standard form :
Maximize (Minimize) Z:
subject to:
functional constraints in form (≤),(≥) bi
nonnegativity constraints on all variables
bi ≥ 0 for all i = 1, 2,... , m.
❖ How can we solve “=” forms of the linear programming
model?

21
THE BIG M METHOD
❖ LP Standard form:
Maximize (Minimize) Z:
subject to:
functional constraints in form (≤),(≥) bi
nonnegativity constraints on all variables
bi ≥ 0 for all i = 1, 2,... , m.
❖ How can we solve “=” forms of the linear programming
model?
→ When constraints are equalities, artificial variables are
used to set up an initial solution in the first tableau.

22
THE BIG M METHOD
❖ Step 1: Obtaining an Initial BF Solution (basic feasible)

Maximize Z = 3x1 +5x2


Maximize Z = 3x1 +5x2 +0 s1 +0 s2
subject to subject to
x1 + s1 = 4 No initial
x1 ≤ 4
feasible
2x2 ≤ 12 2x2 + s2 =12
solution
3x1 +2x2 = 18 3x1 +2x2 = 18
x1 ≥ 0, x2 ≥ 0 x1 ≥ 0, x2 ≥ 0, s1 ≥ 0, s2 ≥ 0,

Maximize Z = 3x1+ 5x2 +0 s1 +0 s2 – MA1 Initial BF Solution


subject to Nonbasic variables:
x1 + s1 = 4 x1 = 0, x2 = 0
2x2 + s2 =12 Basic variables:
x3 = 4, x4=12, A1 = 18.
3x1 +2x2 + A1= 18
x1 ≥ 0, x2 ≥ 0, s1 ≥ 0, s2 ≥ 0, A1 >0 M: a huge positive number

The coefficient of slack or surplus variable is zero


The coefficient of artificial variable is M 23
THE BIG M METHOD
❖ Step 2 : Converting Equation (0) to standard form
Maximize Z - 3x1 - 5x2 + MA1 = 0
subject to
x1 + s1 = 4
2x2 + s2 = 12
3x1 + 2x2+ A1 = 18
x1 ≥ 0, x2 ≥ 0, s1 ≥ 0, s2 ≥ 0, A1 >0
❖ A basic variable A1 has a nonzero coefficient in Eq. (0), thus A1
must be eliminated
Z − 3x1 − 5x2 + MA1 = 0
− M(3x1 + 2x2 + A1 = 18)
New (0) Z − (3M + 3)x1 − (2M + 5)x2 = −18M.

24
THE BIG M METHOD

25
THE BIG M METHOD
❖ Step 3: Applicating of the Simplex Method
Iteration Basic Eq. x1 x2 s1 s2 A1 RHS
varibles
Z (0) -3M - 3 -2M -5 0 0 0 -18M

0
s1 (1) 1 0 1 0 0 4
s2 (2) 0 2 0 1 0 12
A1 (3) 3 2 0 0 1 18

Iteration Basic Eq. x1 x2 s1 s2 A1 RHS


varibles
Z (0) 0 -2M-5 3M+3 0 0 -6M+12

1 X1 (1) 1 0 1 0 0 4

s2 (2) 0 2 0 1 0 12

A1 (3) 0 2 -3 0 1 6

26
THE BIG M METHOD
❖ Step 3: Applicating of the Simplex Method
Iteration Basic Eq. x1 x2 s1 s2 A1 RHS
varibles
Z (0) 0 0 -9/2 0 M+5/2 27

2 X1 (1) 1 0 1 0 0 4

s2 (2) 0 0 3 1 -1 6

X2 (3) 0 1 -3/2 0 1/2 3

Iteration Basic Eq. x1 x2 s1 s2 A1 RHS


varibles
Z (0) 0 0 0 3/2 M+1 36

3 x1 (1) 1 0 0 -1/3 1/3 2

s2 (2) 0 0 1 1/3 -1/3 2

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

27
THE TWO-PHASE METHOD
❖ For a “Greater than or equal to” constraints, the slack
variable in the equality form has a negative coefficient or
equality constraints do not have slack variables.
❖ If either type of constraints is part of the model, there is
no convenient initial basic solution. In this case we use a
two phase method for the simplex procedure.
▪ Phase 1 has the goal of finding a basic feasible
solution, and
▪ Phase 2 has goal of finding the optimum solution.

28
THE TWO-PHASE METHOD
Big M :
Min Z= 0.4x1 +0.5x2
Min Z = 0.4x1 +0.5x2 + MA1 +MA2
st:
st:
0.3x1 + 0.1x2 ≤ 2.7
0.3x1 + 0.1x2 + s1 = 2.7
0.5x1 + 0.5x2 = 6
0.5x1 + 0.5x2 + A1 = 6
0.6x1+ 0.4x2 ≥ 6
0.6x1 + 0.4x2 - s2 +A2 = 6
x1 , x2 ≥ 0
x1, x2, s1, s2, A1, A2 ≥ 0
Two phase method:
Phase 1: Phase 2:
min Z’ = A1 + A2 min Z= 0.4x1 + 0.5x2
st: st:
0.3x1 + 0.1x2 + s1 = 2.7 0.3x1 + 0.1x2 + s1 = 2.7
0.5x1 + 0.5x2 + A1 = 6 0.5x1 + 0.5x2 = 6
0.6x1+ 0.4x2 - s2 + A2 = 6 0.6x1+ 0.4x2 - s2 = 6
x1, x2, s1, s2, A1, A2 ≥ 0 x1, x2, s1, s2 ≥ 0
29
THE TWO-PHASE METHOD
❖ Convert the original problem in standard form
❖ Phase 1:
▪ Add artificial variables where it is needed
▪ Create phase I objective function as min Z’= ∑ Ai
▪ Convert new objective function into standard form
▪ Check non-negative constraints
❖ Build the tableau
❖ Find the optimal solution for phase 1
❖ Original problem is infeasible if optimal solution of
phase 1 has any of the artificial variables as non-zero.
Otherwise, end phase I, begin phase 2.
❖ Replace the original objective function and find the
optimal solution by regular simplex iteration. 30
THE TWO-PHASE METHOD

31
THE
TWO-
PHASE
METHOD

32
THE TWO-PHASE METHOD

33
THE TWO-PHASE METHOD

34
THE TWO-PHASE METHOD

35
THE TWO-PHASE METHOD
❖ or

36
EXERCISES

❖ :

37

You might also like