Professional Documents
Culture Documents
ECE 307 - Techniques For Engineering Decisions: Topic 3: Introduction To The Simplex Algorithm
ECE 307 - Techniques For Engineering Decisions: Topic 3: Introduction To The Simplex Algorithm
Decisions
Topic 3: Introduction to the Simplex Algorithm
George Gross
Department of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
Ax = b
unknowns:
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
1
SOLUTION OF SYSTEMS OF LINEAR
EQUATIONS
⎧⎪ x1 − 2 x 2 + x 3 − 4 x 4 + 2 x 5 = 2 (i )
S1 ⎨
⎪⎩ x1 − x 2 − x 3 − 3 x 4 − x 5 = 4 ( ii )
is nontrivial
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
⎧⎪ x1 − 2 x2 + x3 − 4 x4 + 2 x5 = 2
S2 ⎨
⎪⎩ x2 − 2 x3 + x4 − 3 x5 = 2
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
2
DEFINITIONS
A basic variable is a variable x i that appears
with the coefficient 1 in an equation and with the
coefficient 0 in all the other equations
The variables x j that are not basic are called
nonbasic variables
In the system S 2 , x 1 appears as a basic variable;
x 2 , x 3 , x 4 and x 5 are nonbasic variables
Basic variables may be generated through the
use of elementary row operations
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
DEFINITIONS
3
CANONICAL SYSTEM FORM
We transform the system S2 into the canonical
form of system S3 :
⎧ x1 − 3 x3 − 2 x4 − 4 x5 = 6
S3 ⎪⎨
⎪⎩ x2 − 2 x3 + x4 − 3 x5 = 2
4
BASIC FEASIBLE SOLUTION
⎛ 5⎞ 5!
⎜ ⎟ = = 10
2
⎝ ⎠ 3! 2!
5
SIMPLEX METHODOLOGY EXAMPLE
max Z = 5 x 1 + 2 x 2 + 3 x 3 − x 4 + x 5
s .t .
⎧
canonical ⎪ x 1 + 2 x 2 + 2 x 3 + x 4 = 8 (*)
⎪
⎨
form ⎪
⎪⎩3 x 1 + 4x2 + x3 + x5 = 7 (**)
xi ≥ 0 i = 1, … ,5
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x1 = x 2 = x 3 = 0 x4 = 8, x5 = 7
Z = − 8 + 7 = −1
6
ADJACENT FEASIBLE SOLUTION
7
ADJACENT FEASIBLE SOLUTION
x1 + x 4 = 8
3 x1 + x5 = 7
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
⎧ 7⎫ 7
min ⎨8, ⎬ =
⎩ 3⎭ 3
8
ADJACENT FEASIBLE SOLUTION
x 2 = x 3 = 0 and x 5 = 0
max Z = 5 x 1 + 2 x 2 + 3 x 3 − x 4 + x 5
s .t .
⎧ x + 2x + 2 x3 + x4 = 8 (*)
canonical ⎪⎪
1 2
⎨
form ⎪
⎪⎩ 3 x 1 + 4 x 2 + x3 + x5 = 7 (**)
xi ≥ 0 i = 1, … ,5
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
9
ADJACENT FEASIBLE SOLUTION
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
10
THE SIMPLEX SOLUTION METHOD
nonbasic variable
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
11
SIMPLEX ALGORITHM FOR
MAXIMIZATION
Step 3: select a nonbasic variable to become
the new basic variable; check the limits
on the nonbasic variable – the limiting
constraint determines the basic variable
that is being replaced by the selected
nonbasic variable
Step 4: determine the canonical form for the
new set of basic variables through
elementary row operations; compute the
basic feasible solution, Z and return to
Step 2
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
of so-called tableaus
12
THE SIMPLEX TABLEAU
cj 5 2 3 –1 1
constraint
cB basic constants
x1 x2 x3 x4 x5
variables
–1 x4 1 2 2 1 8
1 x5 3 4 1 1 7
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
13
THE SIMPLEX TABLEAU
We interpret as the change in Z corresponding
to a unit increase in x j
cj 5 2 3 –1 1 constraint
basic constants
cB x1 x2 x3 x4 x5
variables
–1 x4 1 2 2 1 8
1 x5 3 4 1 1 7
cT 3 0 4 0 0 Z = –1
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
SIMPLEX TABLEAU
14
THE SIMPLEX TABLEAU
2 x5 (7/1) = 7
min { 4, 7 } = 4
max Z = 5 x 1 + 2 x 2 + 3 x 3 − x 4 + x 5
s .t .
⎧ x + 2x + 2 x3 + x4 = 8 (*)
canonical ⎪⎪
1 2
⎨
form ⎪
⎪⎩ 3 x 1 + 4 x 2 + x3 + x5 = 7 (**)
xi ≥0 i = 1, … , 5
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
15
THE SIMPLEX TABLEAU
For the new basic feasible solution, we put the
equations into canonical form
cj 5 2 3 –1 1
constraint
cB basic
x1 x2 x3 x4 x5 constants
variables
3 x3 1/2 1 1 1/2 4
1 x5 5/2 3 –1/2 1 3
cT 1 –4 0 –2 0 Z = 15
x 3 = 4, x 5 = 3
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
16
THE SIMPLEX TABLEAU
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
17
THE SIMPLEX TABLEAU
The following elementary row operations are
used
cj 5 2 3 –1 1
constraint
cB basic x1 x2 x3 x4 x5 constants
variables
3 x3 2/5 1 3/5 – 1/5 17/5
16.2 > 15
c j ≤ 0 implies optimality
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
18
SIMPLEX TABLEAU EXAMPLE
max Z = 3 x1 + 2x2
s .t .
− x1 + 2x2 ≤ 4
x1 + 2x2 ≤ 14
x1 − x2 ≤ 3
x1 ≥ 0 x 2 ≥ 0
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x1 , …, x5 ≥ 0
x 3 , x 4 , x 5 are fictitious variables
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
19
SIMPLEX TABLEAU EXAMPLE
cj 3 2 0 0 0 constraint
cB basic
x1 x2 x3 x4 x5 constants
variables
0 x3 –1 2 1 4
0 x4 3 2 1 14
0 x5 1 –1 1 3
cT 3 2 0 0 0 Z = 0
c j = c j − ( c BT • column corresponding to x j )
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
20
SIMPLEX TABLEAU EXAMPLE
cj 3 2 0 0 0 constraint
cB basic
x1 x2 x3 x4 x5 constants
variables
0 x3 1 1 1 7
0 x4 5 1 –3 5
3 x1 1 –1 1 3
cT 0 5 0 0 –3 Z = 9
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
components
c j = c j −( c T
B i column corresponding to x j )
for each nonbasic variable x j
definition
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
21
SIMPLEX TABLEAU EXAMPLE
min {7 , 1, ∞} = 1
22
SIMPLEX TABLEAU EXAMPLE
cj 3 2 0 0 0 constraint
cB basic
x1 x2 x3 x4 x5 constants
variables
0 x3 1 –1/5 8/5 6
2 x2 1 1/5 –3/5 1
3 x1 1 1/5 2/5 4
cT 0 0 0 –1 Z = 14
cj ≤ 0∀ j ⇒ optimum
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
1 8
x3 − x + x = 6 ⎫
5 4 5 5
x2 + 1
x − 2
x = 1 ⎬
⎪
5 4 5 5
x1 + 1
x + 2
x = 4 ⎭
⎪
5 4 5 5
given by
x4 = x5 = 0
x3 = 6
x2 = 1
x1 = 4
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
23
LINEAR PROGRAMMING EXAMPLE
s .t .
− x1 + 2x2 ≤ 4
3 x1 + 2 x 2 ≤ 14
x1 − x 2 ≤ 3
x1 ≥ 0 x 2 ≥ 0
The graphical representation corresponds to
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x2 = 4
x2
x + 2
-
D
3
3
=
3x 1
2
- x
E
+
3x 1
2x 2
2
1
-x
3x 1
=1
tableau 3
2x 2
4
+
2x 2
1
C
Z
=
=9
Z
tableau 1
=3
B
A x1
1 2 3 tableau 2
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
24
LINEAR PROGRAMMING EXAMPLE
25
LINEAR PROGRAMMING EXAMPLE
cj 3 2 0 0 0
constraint
cB basic x1 x2 x3 x4 x5 constants
variables
0 x3 5/8 –1/8 1 15/4
2 x2 1 3/8 1/8 13/4
cT 0 0 0 –1 0 Z = 14
cj ≤ 0 ∀ j
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
5 13 15
x1 = , x2 = , x3 = x4 = 0 , x5 =
2 4 4
cj ≤ 0 ∀ j
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
26
ALTERNATE OPTIMAL SOLUTION
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
MINIMIZATION LP
s.t .
Ax = b
x≥0
In the simplex scheme, replace the optimality
check by the following :
if each coefficient c j is ≥ 0 , stop; else, select
the nonbasic variable with the most negative
value in c to become the new basic variable
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
27
MINIMIZATION LP
min Z = cT x max Z ′ = (− c T ) x
s.t . s.t .
Ax = b Ax = b
x ≥ 0 x ≥ 0
with the solutions of Z and Z ′ related by
min{ Z } = − max { Z ′}
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
28
COMPLICATIONS IN THE SIMPLEX
METHODOLOGY
cj 0 0 0 2 0 3/2 constraint
cB basic
x1 x2 x3 x4 x5 x6 constants
variables
0 x1 1 1 –1 0 2
0 x2 1 2 0 1 4
0 x3 1 1 1 1 3
cT 0 0 0 2 0 3/2 Z = 0
29
COMPLICATIONS IN THE SIMPLEX
METHODOLOGY
3
cj 0 0 0 2 0
2 constraint
cB basic constants
variables x1 x2 x3 x4 x5 x6
2 x4 1 1 –1 2
0 x2 –2 1 2 1 0
0 x3 –1 1 1 1 1
cT –2 0 0 0 2 3/2 Z = 4
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
x1 = 0 x 2 = 0 x 3 = 1 x 4 = 2 x 5 = 0 x 6 = 0 ,
30
DEGENERACY
DEGENERACY
cj 0 0 0 2 0 3
2 constraint
cB basic
x1 x2 x3 x4 x5 x6 constants
variables
2 x4 1/2 1 1/2 2
0 x5 –1 1/2 1 1/2 0
0 x3 1 –1 1 0 1
cT 0 –1 0 0 0 1/2 Z = 4
ECE 307 © 2005, 2006 George Gross, University of Illinois at Urbana-Champaign, All Rights Reserved.
31
DEGENERACY
DEGENERACY
32
MINIMUM RATIO RULE COMPLICATIONS
cj 2 3 0 0 constraint
cB basic
x1 x2 x3 x4 constants
variables
0 x3 1 –1 1 2
0 x4 –3 1 1 4
2 3 0 0 Z = 0
cT
33
MINIMUM RATIO RULE COMPLICATIONS
cj 2 3 0 0 constraint
cB basic constants
variables x1 x2 x3 x4
0 x3 –2 1 1 6
3 x2 –3 1 1 4
cT 11 0 0 –3 Z = 12
1
−2 x 1 + x 3 = 6 x1 = x − 3
2 3
1 4
−3 x 1 + x 2 = 4 x1 = x2 −
3 3
In fact, as x 1 increases so do x 2 and x 3 and Z
34