Anda di halaman 1dari 34

Simplex Method

MSci331Week 3~4

1
Simplex Algorithm
Consider the following LP, solve using
Simplex:
MAX Z 3 x1 2 x2
s.t. 2 x1 x2 100
x1 x2 80
x1 x2 40
x1 , x2 0

2
Step 1: Preparing the LP

3
Step 2: Express the LP in a
tableau form

Z X1 X2 S1 S2 S3 RHS Rati
o
Row 1 -3 -2 0 0 0 0 --
0
Row - 2 1 1 0 0 100
1
Row - 1 1 0 1 0 80
2
Row - 1 0 0 0 1 40
3

4
Step 3: Obtain the initial basic
feasible solution (if available)
a) Set n-m variables equal to 0 These n-m variables the NBV

b) Check if the remaining m variables satisfy the condition of BV

= If yes, the initial feasible basic solution (bfs) is readily a available


= else, carry on some ERO to obtain the initial bfs

Z X1 X2 S1 S2 S3 RHS Rati
o
Row 1 -3 -2 0 0 0 0 --
0
Row - 2 1 1 0 0 100
1
5
Row - 1 1 0 1 0 80
Step 4: Apply the Simplex
Algorithm
a) Is the initial bfs optimal? (Will bringing a NBV improve the value of Z?)
b) If yes, which variable from the set of NBV to bring into the set of BV?
- The entering NBV defines the pivot column
c) Which variable from the set of BV has to become NBV?
- The exiting BV defines the pivot row
Pivot cell
Z X1 X2 S1 S2 S3 RHS Rati
o
Row 1 -3 -2 0 0 0 0 --
0
Row - 2 1 1 0 0 100 100/
1 2
6
Row - 1 1 0 1 0 80 80/1
Summary of Simplex Algorithm for
Set: n-m=0 Papa Louis
m
0
BFS
(intial)

BFS (1)

BFS (2)

BFS (3)
1

The optimal solution is x1=20, x2=60 The optimal value is Z=180


The BFS at optimality x1=20, x2=60, s3=20 7
Geometric Interpretation of Simplex
Algorithm

8
Class activity
Consider the following LP:

This is a maximizing LP, in normal form. So an initial BFS exists.

9
Class activity

10
Class activity

Z x1 x2 s1 s2 s3 s4 RH
S
1 -3 -3 0 0 0 0 10 ----
0 -
1 1 1 0 0 0 4
1 2 0 1 0 0 6
2 -3 0 0 1 0 2 11
Class activity

Make this coefficient equal 1 and pivot


all other rows relative to it

Z x1 x2 s1 s2 s3 s4 RH
S
1 -3 -3 0 0 0 0 10 ----
4/1
0 -
6/1
1 1 1 0 0 0 4
2/2*
1 2 0 1 0 0 6
---
2 -3 0 0 1 0 2 12
Class activity

Z x1 x2 s1 s2 s3 s4 RH
0 -7.5 0 0 3/2 0 S
103
1 -3
0 -3
2.5 01 0
0 0
-1/2 0
0 10
3 ----
0 3.5 0 1 -1/2 0
05
-
1 1 1 0 0 0 4
10 2
1/2
00 1
0
0
1/2
0
1
6
5
1 - 0 0 1/2 0 1 13
Class activity

Make this coefficient equal 1 and pivot


all other rows relative to it

Z x1 x2 s1 s2 s3 s4 RH
0 -7.5 0 0 3/2 0 S
103
1 -3
0 -3
2.5 01 0
0 0
-1/2 0
0 10
3 ----
3/2.5*
0 -
0 3.5 0 1 -1/2 0 5 5/3.5
1 1 1 0 0 0 4
---
10 2
1/2
00 1
0
0
1/2
0
1
65 5/0.5
1 - 0 0 1/2 0 1 14
Class activity

Z x1 x2 s1 s2 s3 s4 RH
0 -7.5
0 03 0 3/2
0 0 S
103
112
1 0 1 2/5 0 -1/5 0 6/5 ----
0 3.5
0 -1.4
0 11 -1/2
1/5 00 0.8
5
-

1 -3/2
0 0
3/5 0 1/2
0.8 00 1
2.8
0 1/2
0 -1/5
0 0 1/2
0.6 11 4.4
5
15
Example: LP model with Minimization
Objective
Solve the following LP model:

Min z 2 x1 3x2 MAX z 2 x1 3 x2


s.t. s.t.
x1 x2 4 x1 x2 4
x1 x2 6 x1 x2 6
x1 , x2 0 x1 , x2 0
Initial Tableau

16
Example: LP model with Minimization
Objective
Iteration 0

Iteration 1

Optimality test: z 12 5 x1 3s1


17
> Constraint
x2
Max Z 2 x1 3x2
40
s.t.
35 x1 x2 5
30 x1 3 x2 35
25 x1 20
20
Constraint 1
20 3.5 x1 5 x2 35
Constraint 3
15
xx11,,xx22 00
Z
10
Constraint 2
5

5 10 15 20 25 30 35 40
x1
Constraint 4 New feasible region
18
Equality Constraint
x2
Max Z 2 x1 3x22
40 s.t.
35 x1 x22 5
30 x1 3 x22
35
25 x1 20
20
Constraint 1
20
Constraint 3
15
xx11,,xx22 00
Z
10
Constraint 2
5

5 10 15 20 25 30 35 40
x1
New feasible region
19
The Problem of Finding an Initial
Feasible BV
Max Z 2 x1 3x2 4 x3
s.t. x1 x2 x3 30
An LP Model 2 x1 x2 3x3 60
x1 x2 2 x3 20
x1, x2 , x3 0

Max Z 2 x1 3x2 4 x3 0s1 0e2


s.t. x1 x2 x3 s1 30
Standard 2 x1 x2 3x3 e2 60
Form x1 x2 2 x3 20
x1, x2 , x3, s1, e2 0

Cannot find an initial basic


variable that is feasible.

20
Example: Solve Using the Big M
Method
MAX 3 x1 x2 y1 z
s.t. x1 x2 y1 5 z 25
3 x1 3 x2 4 y1 2 z 12
x1 x2 y1 z 0

x1 , x2 , y1 , z 0 Write in standard form

MAX 3 x1 x2 y1 z
s.t. x1 x2 y1 5 z s1 25
3 x1 3 x2 4 y1 2 z 12
x1 x2 y1 z e3 0
x1 , x2 , y1 , z, s1 , e3 0

21
Example: Solve Using the Big M
Method
MAX 3 x1 x2 y1 z
s.t. x1 x2 y1 5 z s1 25
3 x1 3 x2 4 y1 2 z 12
x1 x2 y1 z e3 0
x1 , x2 , y1 , z, s1 , e3 0

Adding artificial variables

MAX 3 x1 x2 y1 z 0s1 0e3 Ma2 Ma3


s.t. x1 x2 y1 5 z s1 25
3x1 3 x2 4 y1 2 z a2 12
x1 x2 y1 z e3 a3 0
x1 , x2 , y1 , z, s1 , e3 , a2 , a3 0
22
Example: Solve Using the Big M
Method
MAX 3x1 x2 y1 z 0s1 0e3 Ma2 Ma3
s.t. x1 x2 y1 5 z s1 25
3x1 3x2 4 y1 2 z a2 12
x1 x2 y1 z e3 a3 0
x1 , x2 , y1 , z, s1 , e3 , a2 , a3 0

Put in tableau form

Coefficient of RHS MRT


Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 -3 1 1 1 0 M 0 M 0
s1 1 0 1 -1 1 5 1 0 0 0 25
a2 2 0 3 -3 -4 2 0 1 0 0 12
a3 3 0 1 -1 -1 -1 0 0 -1 1 0

23
Example: Solve Using the Big M
Method
Eliminating a2 from row 0 by operations: new Row 0 = old Row 0 -M*old
Coefficient of RHS MRT
Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 -3 1 1 1 0 M 0 M 0
s1 1 0 1 -1 1 5 1 0 0 0 25
a2 2 0 3 -3 -4 2 0 1 0 0 12
a3 3 0 1 -1 -1 -1 0 0 -1 1 0

Coefficient of RHS MRT


Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 -3-3M 1+3M 1+4M 1-2M 0 0 0 M -12M
s1 1 0 1 -1 1 5 1 0 0 0 25
a2 2 0 3 -3 -4 2 0 1 0 0 12
a3 3 0 1 -1 -1 -1 0 0 -1 1 0

24
Example: Solve Using the Big M
Method
Eliminating a3 from the new row 0 by operations: new Row=old
Row-M*old Row 3 Coefficient of RHS MRT
Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 -3-3M 1+3M 1+4M 1-2M 0 0 0 M -12M
s1 1 0 1 -1 1 5 1 0 0 0 25
a2 2 0 3 -3 -4 2 0 1 0 0 12
a3 3 0 1 -1 -1 -1 0 0 -1 1 0

Coefficient of RHS MRT


Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 -3-4M 1+4M 1+5M 1-M 0 0 M 0 -12M
s1 1 0 1 -1 1 5 1 0 0 0 25
a2 2 0 3 -3 -4 2 0 1 0 0 12
a3 3 0 1 -1 -1 -1 0 0 -1 1 0

25
Example: Solve Using the Big M
Method
The initial basic variables are s1=25, a2=12, and a3=0. Now ready
to proceed for the simplex algorithm.
Coefficient of RHS MRT
Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 -3-4M 1+4M 1+5M 1-M 0 0 M 0 -12M
s1 1 0 1 -1 1 5 1 0 0 0 25
a2 2 0 3 -3 -4 2 0 1 0 0 12
a3 3 0 1 -1 -1 -1 0 0 -1 1 0

The initial Tableau

Coefficient of RHS MRT


Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 -3-4M 1+4M 1+5M 1-M 0 0 M 0 -12M
s1 1 0 1 -1 1 5 1 0 0 0 25 25
a2 2 0 3 -3 -4 2 0 1 0 0 12 4
a3 3 0 1 -1 -1 -1 0 0 -1 1 0 0

26
Example: Solve Using the Big M
Method
Using EROs change the column of x1 into a unity vector.
Coefficient of RHS MRT
Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 -3-4M 1+4M 1+5M 1-M 0 0 M 0 -12M
s1 1 0 1 -1 1 5 1 0 0 0 25 25
a2 2 0 3 -3 -4 2 0 1 0 0 12 4
a3 3 0 1 -1 -1 -1 0 0 -1 1 0 0

Iteration 1
Coefficient of RHS MRT
Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 0 -2 -2+M -2-5M 0 0 -3-3M -3+4M -12M
s1 1 0 0 0 2 7 1 0 1 -1 25 3.57
a2 2 0 0 0 -1 5 0 1 3 -3 12 2.4
x1 3 0 1 -1 -1 -1 0 0 -1 1 0 --

27
Example: Solve Using the Big M
Method
Using EROs change the column of z into a unity vector.
Coefficient of RHS MRT
Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 0 -2 -2+M -2-5M 0 0 -3-3M -3+4M -12M
s1 1 0 0 0 2 7 1 0 1 -1 25 3.57
a2 2 0 0 0 -1 5 0 1 3 -3 12 2.4
x1 3 0 1 -1 -1 -1 0 0 -1 1 0 --

Iteration 2
Coefficient of RHS MRT
Basic Row/Eq. no.
W x1 x2 y1 z s1 a2 e3 a3
0 1 0 -2 -12/5 0 0 (2+5M)/5 -9/5 (-21/5)+M 4.8
s1 1 0 0 0 17/5 0 1 -7/5 -16/5 16/5 8.2 2.35
z 2 0 0 0 -1/5 1 0 1/5 3/5 -3/5 2.4 --
x1 3 0 1 -1 -6/5 0 0 1/5 --2/5 2/5 2.4 --

Students to try more iterations. The solution is infeasible. See the 28


Special case 1: Alternative
Optima
Max z x1 0.5 x2
s.t. 2 x1 x2 4
x1 2 x2 3
x1 , x2 0

See Notes on this slide (below) for more information 29


Special case 1: Alternative
Optima
Max z x1 0.5 x2
s.t. 2 x1 x2 4
x1 2 x2 3
x1 , x2 0

30
Special case 2: Unbounded
LPs
MAX z 2 x1 x2
s.t. x1 x2 1
x1 2 x2 2
x1, x 2 0

s1 0
x1 1

See Notes on this slide (below) for more information 31


Special Case 3: Degeneracy

32
Special Case 5: Degeneracy

Iteration
0

Iteration
1

Iteration
2
33
Special Case 5: Degeneracy
Degeneracy reveals from practical standpoint that the model
has at least one redundant constraint.

34

Anda mungkin juga menyukai