Or C3 Simplex Method
Or C3 Simplex Method
SOLVING LP PROBLEMS:
THE SIMPLEX 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
4
INTRODUCTION OF THE SIMPLEX METHOD
❖ Geometric method:
- Focus solely on CPF solutions
- Iterative algorithm:
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
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?
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
Optimal
End
solution Yes
No
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)
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
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 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