Uploaded by ze wang

Indr262LectureNotes 5-TheorySimplexMethod

advertisement
INDR 262 Optimization Models and Mathematical Programming
THEORY OF THE SIMPLEX METHOD
Terminology:
Constraint Boundary Equation: an equation obtained by replacing its sign ( ≥ , ≤ , or = ) by an
equality sign (=).
Boundary: the boundary of the feasible region contains (1) the feasible solutions that satisfy
one or more of the constraint boundary equations.
CPF: is a feasible solution that exists at the constraints of more than one constraint boundary
equations (i.e., it does not lie on any line segment connecting two other feasible
solutions).
For any linear programming problem with n decision variables, each CPF solution lies at the
intersection of n constraint boundaries.
Adjacent CPF solutions: A CPF solution lies at the intersection of n constraint boundaries. An
edge of the feasible region is feasible line segment that lies at the
intersection of n-1 constraint boundaries.
Two CPF solutions are adjacent if the line segment connecting them
is an edge of the feasible region. Each CPF solution has n edges each
one leading to one of the n adjacent CPF solutions.
Properties of CPF Solutions:
Property 1: a) If there is exactly one optimal solution, then it must be a CPF solution.
b) If there are multiple optimal solutions, then at least two must be adjacent CPF
solutions.
Proof:
a) Assume that there is a single optimal solution which is not a CPF solution.
x* : optimal solution
z* : objective function value of the optimal solution
since x* is not a CPF solution, there must be two other feasible solutions (x1 and x2) such that
the line segment joining them contains the optimal solution, x*. Let z1 and z2 denote the
objective function value for solutions x1 and x2 respectively.
x* = αx1 + (1-α)x2
z* = αz1 + (1-α)z2
and 0<α<1
These cases are possible:
1) z*= z1= z2
contradicts with the assumption so there are more than one CPF solutions.
2) z1< z*< z2
x* is not an optimal solution.
1
*
2
3) z > z > z
- It is impossible to have a single optimal solution that is not a CPF solution.
b) complete the proof as an exercise.
Hint: When you have multiple optimal solutions, the objective function is parallel to a
constraint boundary equation.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
1
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
Property 2: There are only a finite number of CPF solutions.
m: constraints
n: variables
- CPF solutions will involve solving n out of m+n constraint boundary equations (m:
functional constraints, n: non-negativity constraints). The number of solutions is given by:
⎛ m + n ⎞ (m + n) !
⎜
⎟=
m! n!
⎝ n ⎠
Example: m=3, n=2 (Wyndor Glass Co.)
⎛ 3 + 2 ⎞ (3 + 2) ! 120
=
= 10 possible solutions and 5 are CPF solutions.
⎜
⎟=
3! 2 !
12
⎝ 2 ⎠
Property 3: If a CPF solution has no adjacent CPF solutions that are better, then there are no
better solutions anywhere. Therefore, such a CPF solution is guaranteed to be an
optimal solution assuming that the problem possesses at least one optimal
solution.
Proof: complete the proof as an exercise.
Hint: For a CPF solution to have better objective function value than all of its adjacent
CPF solutions while not being the optimal solution, the feasible region must be
nonconvex.
Augmented Form of the LP Problem
LP Model constraints:
(1) a11x1 + a12x2 +
(2) a21x1 + a22x2 +
...
...
...
...
(m) am1x1 + am2x2 +
… + a1nxn + xn+1
… + a2nxn
+ xn+2
…
...
…
…
...
…
… + amnxn
+ xn+m
‫׀‬
slack variables
= b1
= b2
…
…
= bm
‫׀‬
Definitions:
Basic Solutions:
Augmented corner-point solutions
BF Solutions:
CPF solutions
Defining Equations: set of n constraint boundary equations for each corner point solution.
Indicating Variable: A unique variable for each constraint to indicate whether that constraint’s
boundary equation is satisfied by the current solution. (≥ type constraints
involve two variables)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
2
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
Augmented Form
Constr.
Boundary
Eqn.
Indicating
Variable
Constraint
Constraint Form
≤
∑ aij x j ≤ bi
∑ aij x j + xn+i = bi
∑ aij x j = bi
xn+i
≥
∑ aij x j ≥ bi
∑ aij x j + xn+i − xSi = bi
∑ aij x j = bi
xn+i − xSi
=
∑ aij x j = bi
∑ aij x j + xn+i = bi
∑ aij x j = bi
xn +i
Non-neg.
xj≥0
xj≥0
xj=0
xj
n
j =1
n
j =1
n
j =1
n
j =1
n
j =1
n
j =1
n
j =1
n
j =1
n
j =1
Example: Wyndor Glass Co.
max z= 3x1+ 5x2
s.t.
x1
≤ 4
2x2 ≤ 12
3x1+ 2x2 ≤ 18
x1
≥ 0
x2 ≥ 0
Constraint
Augmented Form
Constraint
Boundary Eqn.
x1
≤ 4 x1+
x3
= 4 x1
= 4
2x2≤12
2x2 +x4 =12
2x2=12
3x1+2x2≤18 3x1+2x2
+x5=18 3x1+2x2=18
x1
≥ 0 x1
≥ 0 x1
= 0
x2≥ 0
x2
≥ 0
x2= 0
CPF Solution Defining Eqns
x1
= 0
(0,0)
x2= 0
x1
= 0
(0,6)
2x2=12
2x2=12
(2,6)
3x1+2x2=18
3x1+2x2=18
(4,3)
x1
= 4
x1
= 4
(4,0)
x2= 0
Indicating
Variable
x3
x4
x5
x1
x2
BF Solution
Non-basic Var.
(0,0,4,12,18)
x1, x2
(0,6,4,0,6)
x1, x4
(2,6,2,0,0)
x4, x5
(4,3,0,6,0)
x3, x5
(4,0,0,12,6)
x2, x3
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
3
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
Summary of the Matrix Form of the Simplex Method
Notation
max z=cx
st
Ax=b
x≥0
BV
NB
b
aj
B
cj
cB
ui
Formulae
B-1aj
cBB-1aj-cj
B-1b
cBB-1ui
cBB-1b
Method
Step 0
Step 1
Step 2
Step 3
Step 4
any set of basic variables
any set of nonbasic variables
right-hand side vector of the original problem
column for xj in the constraints of the original problem
mxm constraints whose jth column is the column for BVj in the original constraints
coefficients of xj in the objective function
1xm row vector whose jth element is the objective function coefficient for BVj
mx1 column vector with ith element is 1 and all other elements equal to 0
column for xj in BV tableau
coefficient of xj in row 0
right-hand side of constraints in BV tableau
coefficient of slack variables in BV in row 0
right-hand side of BV in row 0
(1)
(2)
(3)
(4)
(5)
Identify the initial BF solution. Initially, B-1=I.
For the current tableau, compute cBB-1.
Evaluate equation (2) for all nonbasic variables (NB). If every nonbasic variable
has nonnegative value, the current basis is optimal with an objective function value
given by equation (5). If the current basis is not optimal, select the nonbasic
variable with the most negative coefficient in row 0, call this variable the entering
basic variable, xk.
In order to determine the leaving basic variable, compute xk’s column in the
current tableau using equation (1) and compute the right-hand side of the current
tableau using equation (3). Then use the minimum ratio test to determine the row
in which xk should enter the basis. We now know the set of basic variables (BV)
for the new tableau.
Use the column for xk in the current simplex tableau to determine the ero’s needed
to enter xk into the basis. Perform these ero’s on the current B-1. This will yield
the new B-1. Return to Step 1.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
4
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
Example 1:
Consider the Wyndor Glass Company problem:
max
s.t.
z = 3x1 + 5x2
x1
max
s.t.
≤4
2x2 ≤ 12
3x1 + 2x2 ≤ 18
x1
z = 3x1 + 5x2
x1
+ x3
è
2x2
3x1 + 2x2
≥0
NB0 = {x1, x2}
+ x4
= 12
+ x5 = 18
x1, x2 , x3, x4 , x5 ≥ 0
x2 ≥ 0
0) BV0 = {x3, x4, x5}
=4
cB= [0 0 0]
⎡ 1 0 0 ⎤
⎢
⎥
B0 = ⎢ 0 1 0 ⎥
⎢ 0 0 1 ⎥
⎣
⎦
cN = [3 5]
⎡ 1 0 0 ⎤
⎢
⎥
B0−1 = ⎢ 0 1 0 ⎥
⎢ 0 0 1 ⎥
⎣
⎦
Iteration 1:
⎡ 1 0 0 ⎤
⎢
⎥
1) c B B −1 = ⎡⎢ 0 0 0 ⎤⎥⎢ 0 1 0 ⎥ = ⎡⎢ 0 0 0 ⎤⎥
⎣
⎦
⎣
⎦
⎢ 0 0 1 ⎥
⎣
⎦
⎡ 1 ⎤
⎢
⎥
2) z1 − c1 = c B B0−1a1 − c1 = ⎡⎢ 0 0 0 ⎤⎥⎢ 0 ⎥ − 3 = −3
⎣
⎦
⎢ 3 ⎥
⎣
⎦
⎡ 0 ⎤
⎢
⎥
z 2 − c2 = ⎡⎢ 0 0 0 ⎤⎥⎢ 2 ⎥ − 5 = −5
⎣
⎦
⎢ 2 ⎥
⎣
⎦
⇒
x2 enters the basis
⎡ 0 ⎤
⎢
⎥
3) the column for x2 is ⎢ 2 ⎥
⎢ 2 ⎥
⎣
⎦
⎡ 1 0 0 ⎤⎡ 0 ⎤ ⎡ 0 ⎤
⎢
⎥⎢
⎥ ⎢
⎥
update a2: B0−1a2 = ⎢ 0 1 0 ⎥⎢ 2 ⎥ = ⎢ 2 ⎥
⎢ 0 0 1 ⎥⎢ 2 ⎥ ⎢ 2 ⎥
⎣
⎦⎣
⎦ ⎣
⎦
⎡ 1 0 0 ⎤⎡ 4 ⎤ ⎡ 4 ⎤
⎢
⎥⎢
⎥ ⎢
⎥
update b: B b = ⎢ 0 1 0 ⎥⎢ 12 ⎥ = ⎢ 12 ⎥
⎢ 0 0 1 ⎥⎢ 18 ⎥ ⎢ 18 ⎥
⎦ ⎣
⎦
⎣
⎦⎣
−1
0
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
5
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
⇒
conduct the minimum ratio test:
⎧ 4 12 18 ⎫
min ⎨ , , ⎬
⎩0 2 2 ⎭
x2 enters the basis in row 2,
update the variables sets:
BV1={x3, x2, x5}, NB1 = {x1, x4}
4) ero’s:
new row 0 = old row 0 + (5/2) * (old row 2)
new row 1 = old row 1 + (0)
new row 2 =
* (old row 2)
+ (1/2) * (old row 2)
new row 3 = old row 3 + (-1) * (old row 2)
The new basis inverse:
⎡ 1 0 0 ⎤
⎡ 1
0
0 ⎤
⎢
⎥
⎢
⎥
B0−1 = ⎢ 0 1 0 ⎥ ⇒ B1−1 = ⎢ 0 1 / 2 0 ⎥
⎢ 0 0 1 ⎥
⎢ 0 −1 1 ⎥
⎣
⎦
⎣
⎦
Iteration 2:
⎡ 1
0
0 ⎤
⎢
⎥
1) c B B1−1 = ⎡⎢ 0 5 0 ⎤⎥⎢ 0 1 / 2 0 ⎥ = ⎡⎢ 0 5 / 2 0 ⎤⎥
⎣
⎦
⎣
⎦
⎢ 0 −1 1 ⎥
⎣
⎦
⎡ 1 ⎤
⎢
⎥
2) z1 − c1 = ⎡⎢ 0 5 / 2 0 ⎤⎥⎢ 0 ⎥ − 3 = −3
⎣
⎦
⎢ 3 ⎥
⎣
⎦
⇒
x1 enters the basis
⎡ 0 ⎤
⎢
⎥
z 4 − c4 = ⎡⎢ 0 5 / 2 0 ⎤⎥⎢ 1 ⎥ − 0 = 5 / 2
⎣
⎦
⎢ 0 ⎥
⎣
⎦
⎡ 1 ⎤
⎢
⎥
3) the column for x1 is ⎢ 0 ⎥
⎢ 3 ⎥
⎣
⎦
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
6
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
⎡ 1 0 0 ⎤⎡ 1 ⎤ ⎡ 1 ⎤
⎢
⎥⎢
⎥ ⎢
⎥
update a1: B1−1a1 = ⎢ 0 1 / 2 0 ⎥⎢ 0 ⎥ = ⎢ 0 ⎥
⎢ 0 −1 1 ⎥⎢ 3 ⎥ ⎢ 3 ⎥
⎦ ⎣
⎦
⎣
⎦⎣
⎡ 1 0 0 ⎤⎡ 4 ⎤ ⎡ 4 ⎤
⎢
⎥⎢
⎥ ⎢
⎥
update b: B1−1b = ⎢ 0 1 / 2 0 ⎥⎢ 12 ⎥ = ⎢ 6 ⎥
⎢ 0 −1 1 ⎥⎢ 18 ⎥ ⎢ 6 ⎥
⎦ ⎣
⎦
⎣
⎦⎣
⇒
conduct the minimum ratio test:
⎧4 6 6⎫
min ⎨ , , ⎬
⎩ 1 0 3⎭
x1 enters the basis in row 3,
update the variables sets:
BV1={x3, x2, x1}, NB1 = {x5, x4}
4) ero’s:
new row 0 = old row 0 + (1)
* (old row 3)
new row 1 = old row 1 + (-1/3) * (old row 3)
new row 2 = old row 2 + (0)
* (old row 3)
new row 3 =
* (old row 3)
+ (1/3)
The new basis inverse:
⎡ 1 0 0 ⎤
⎡ 1 1 / 3 −1 / 3 ⎤
⎢
⎥
⎢
⎥
B1−1 = ⎢ 0 1 / 2 0 ⎥ ⇒ B2−1 = ⎢ 0 1 / 2
0 ⎥
⎢ 0 −1 1 ⎥
⎢ 0 −1 / 3 1 / 3 ⎥
⎣
⎦
⎣
⎦
Iteration 3:
⎡ 1 1 / 3 −1 / 3 ⎤
⎢
⎥
1) c B B2−1 = ⎡⎢ 0 5 3 ⎤⎥⎢ 0 1 / 2
0 ⎥ = ⎡⎢ 0 3 / 2 1 ⎤⎥
⎣
⎦
⎣
⎦
⎢ 0 −1 / 3 1 / 3 ⎥
⎣
⎦
⎡ 0 ⎤
⎢
⎥
2) z 5 − c5 = ⎡⎢ 0 3 / 2 1 ⎤⎥⎢ 0 ⎥ − 0 = 1
⎣
⎦
⎢ 1 ⎥
⎣
⎦
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
7
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
⎡ 0 ⎤
⎢
⎥
z 4 − c4 = ⎡⎢ 0 3 / 2 1 ⎤⎥⎢ 1 ⎥ − 0 = 3 / 2
⎣
⎦
⎢ 0 ⎥
⎣
⎦
no negative coefficients, the current solution is OPTIMAL!
⇒
Calculate the optimal objective function and the optimal values of the decision variables:
⎡ 1 1 / 3 −1 / 3 ⎤⎡ 4 ⎤
⎢
⎥⎢
⎥
z* = c B B2−1b = ⎡⎢ 0 5 3 ⎤⎥⎢ 0 1 / 2
0 ⎥⎢ 12 ⎥
⎣
⎦
⎢ 0 −1 / 3 1 / 3 ⎥⎢ 18 ⎥
⎦
⎣
⎦⎣
⎡ 4 ⎤
⎢
⎥
= ⎡⎢ 0 3 / 2 1 ⎤⎥⎢ 12 ⎥
⎣
⎦
⎢ 18 ⎥
⎣
⎦
= 36
x* = B −1b
B
⎡
⎢
=⎢
⎢
⎣
⎡
⎢
=⎢
⎢
⎣
1 1 / 3 −1 / 3
0 1/ 2
0
0 −1 / 3 1 / 3
2
6
2
⎤⎡ 4 ⎤
⎥⎢
⎥
⎥⎢ 12 ⎥
⎥⎢ 18 ⎥
⎦
⎦⎣
⎤
⎥
⎥
⎥
⎦
Example 2:
max
s .t .
z = 60 x1 + 30 x 2 + 20 x3
8 x1 + 6 x 2 + x3
+ x4
4 x1 + 2 x 2 +1.5x3
= 48
+ x5
2 x1 +1.5x 2 + 0.5x3
x1 ,
x2 ,
= 20
+ x6 = 8
x 3 , x 4 , x5 , x 6 ≥ 0
0) BV0={x4, x5, x6}, NB0={x1, x2, x3}
⎡ 1 0 0 ⎤
⎡ 1 0 0 ⎤
⎢
⎥
⎢
⎥
B0 = ⎢ 0 1 0 ⎥ ⇒ B0−1 = ⎢ 0 1 0 ⎥
⎢ 0 0 1 ⎥
⎢ 0 0 1 ⎥
⎣
⎦
⎣
⎦
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
8
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
cB= [0 0 0],
cN= [60 30 20]
Iteration 1:
⎡ 1 0 0 ⎤
⎢
⎥
1) c B B0−1 = ⎡⎢ 0 0 0 ⎤⎥⎢ 0 1 0 ⎥ = ⎡⎢ 0 0 0 ⎤⎥
⎣
⎦
⎣
⎦
⎢ 0 0 1 ⎥
⎣
⎦
⎡ −8 ⎤
⎢
⎥
2) z1 − c1 = c B B0−1a1 − c1 = ⎡⎢ 0 0 0 ⎤⎥⎢ 4 ⎥ − 60 = −60
⎣
⎦
⎢ 2 ⎥
⎣
⎦
⇒
x1 enters the basis
⎡ 6 ⎤
⎢
⎥
z 2 − c2 = ⎡⎢ 0 0 0 ⎤⎥⎢ 2 ⎥ − 30 = −30
⎣
⎦
⎢ 1.5 ⎥
⎣
⎦
⎡ 1 ⎤
⎢
⎥
z 3 − c3 = ⎡⎢ 0 0 0 ⎤⎥⎢ 1.5 ⎥ − 20 = −20
⎣
⎦
⎢ 0.5 ⎥
⎣
⎦
⎡ 8 ⎤
⎢
⎥
3) the column for x1 is ⎢ 4 ⎥
⎢ 2 ⎥
⎣
⎦
⎡ 1 0 0 ⎤⎡ 8 ⎤ ⎡ 8 ⎤
⎢
⎥⎢
⎥ ⎢
⎥
update a1: B a = ⎢ 0 1 0 ⎥⎢ 4 ⎥ = ⎢ 4 ⎥
⎢ 0 0 1 ⎥⎢ 2 ⎥ ⎢ 2 ⎥
⎣
⎦⎣
⎦ ⎣
⎦
−1
0 1
⎡ 1 0 0 ⎤⎡ 48 ⎤ ⎡ 48 ⎤
⎢
⎥⎢
⎥ ⎢
⎥
update b: B b = ⎢ 0 1 0 ⎥⎢ 20 ⎥ = ⎢ 20 ⎥
⎢ 0 0 1 ⎥⎢ 8 ⎥ ⎢ 8 ⎥
⎣
⎦⎣
⎦ ⎣
⎦
−1
0
⇒
conduct the minimum ratio test:
⎧ 48 20 8 ⎫
min ⎨ , , ⎬
⎩ 8 4 2⎭
x1 enters the basis in row 3,
update the variables sets:
BV1={x4, x5, x1}, NB1 = {x6, x2, x3}
cB=[0 0 60], cN=[0 30 20]
4) ero’s:
new row 1 = old row 1 + (-8/2) * (old row 3)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
9
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
new row 2 = old row 2 + (-4/2) * (old row 3)
new row 3 =
+ (1/2) * (old row 3)
The new basis inverse:
⎡ 1 0 0 ⎤
⎡ 1 0 −4
⎢
⎥
⎢
B0−1 = ⎢ 0 1 0 ⎥ ⇒ B1−1 = ⎢ 0 1 −2
⎢ 0 0 1 ⎥
⎢ 0 0 1/ 2
⎣
⎦
⎣
⎤
⎥
⎥
⎥
⎦
Iteration 2:
⎡ 1 0 −4
⎢
1) c B B1−1 = ⎡⎢ 0 0 60 ⎤⎥⎢ 0 1 −2
⎣
⎦
⎢ 0 0 1/ 2
⎣
⎤
⎥ ⎡
⎤
⎥ = ⎢⎣ 0 0 30 ⎥⎦
⎥
⎦
⎡ 0 ⎤
⎢
⎥
2) z 6 − c6 = ⎡⎢ 0 0 30 ⎤⎥⎢ 0 ⎥ − 0 = 30
⎣
⎦
⎢ 1 ⎥
⎣
⎦
⎡ 6 ⎤
⎢
⎥
z 2 − c2 = ⎡⎢ 0 0 30 ⎤⎥⎢ 2 ⎥ − 30 = 15
⎣
⎦
⎢ 1.5 ⎥
⎣
⎦
⎡ 1 ⎤
⎢
⎥
z 3 − c3 = ⎡⎢ 0 0 30 ⎤⎥⎢ 1.5 ⎥ − 20 = −5
⎣
⎦
⎢ 0.5 ⎥
⎣
⎦
⎡ 1
⎢
3) the column for x3 is ⎢ 3 / 2
⎢ 1/ 2
⎣
x3 enters the basis
⎤
⎥
⎥
⎥
⎦
⎡ 1 0 −4
⎢
update a3: B1−1a3 = ⎢ 0 1 −2
⎢ 0 0 1/ 2
⎣
⎡ 1 0 −4
⎢
update b: B1−1b = ⎢ 0 1 −2
⎢ 0 0 1/ 2
⎣
⇒
⇒
⎤⎡ 1
⎥⎢
⎥⎢ 3 / 2
⎥⎢ 1 / 2
⎦⎣
⎤ ⎡ −1 ⎤
⎥ ⎢
⎥
⎥=⎢ 1/ 2 ⎥
⎥ ⎢ 1/ 4 ⎥
⎦ ⎣
⎦
⎤⎡ 48 ⎤ ⎡ 16 ⎤
⎥⎢
⎥ ⎢
⎥
⎥⎢ 20 ⎥ = ⎢ 4 ⎥
⎥⎢ 8 ⎥ ⎢ 4 ⎥
⎦⎣
⎦ ⎣
⎦
conduct the minimum ratio test:
⎧ 16 4
4 ⎫
min ⎨ ,
,
⎬
⎩ −1 1 / 2 1 / 4 ⎭
x3 enters the basis in row 2,
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
10
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
update the variables sets:
BV1={x4, x3, x1}, NB1 = {x6, x2, x5}
cB=[0 20 60], cN=[0 30 0]
4) ero’s:
new row 1 = old row 1 + (1/(1/2))
* (old row 2)
new row 2 =
* (old row 2)
(1/(1/2))
new row 3 = old row 3 + [(-1/4)/(1/2)] * (old row 2)
The new basis inverse:
⎡ 1 0 −4
⎢
B = ⎢ 0 1 −2
⎢ 0 0 1/ 2
⎣
−1
1
⎤
⎡ 1
2
−8
⎥
⎢
−1
2
−4
⎥ ⇒ B2 = ⎢ 0
⎥
⎢ 0 −1 / 2 3 / 2
⎦
⎣
⎤
⎥
⎥
⎥
⎦
Iteration 3:
⎡ 1
2
−8
⎢
⎤
−1 ⎡
1) c B B2 = ⎢ 0 20 60 ⎥⎢ 0
2
−4
⎣
⎦
⎢ 0 −1 / 2 3 / 2
⎣
⎤
⎥ ⎡
⎤
⎥ = ⎢⎣ 0 10 10 ⎥⎦
⎥
⎦
⎡ 0 ⎤
⎢
⎥
2) z 6 − c6 = ⎡⎢ 0 10 10 ⎤⎥⎢ 0 ⎥ − 0 = 10
⎣
⎦
⎢ 1 ⎥
⎣
⎦
⎡ 6 ⎤
⎢
⎥
z 2 − c2 = ⎡⎢ 0 10 10 ⎤⎥⎢ 2 ⎥ − 30 = 5
⎣
⎦
⎢ 1.5 ⎥
⎣
⎦
⎡ 0 ⎤
⎢
⎥
z 5 − c5 = ⎡⎢ 0 10 10 ⎤⎥⎢ 1 ⎥ − 0 = 10
⎣
⎦
⎢ 0 ⎥
⎣
⎦
⇒
no negative coefficients, the current solution is OPTIMAL!
Calculate the optimal objective function and the optimal values of the decision variables:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
11
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
z* = c B B2−1b
⎡ 1
2
−8
⎢
⎡
⎤
= ⎢ 0 20 60 ⎥⎢ 0
2
−4
⎣
⎦
⎢ 0 −1 / 2 3 / 2
⎣
⎤⎡ 48 ⎤
⎥⎢
⎥
⎥⎢ 20 ⎥
⎥⎢ 8 ⎥
⎦⎣
⎦
= 280
x* = B2−1b
B
⎡
⎢
=⎢
⎢
⎣
⎡
⎢
=⎢
⎢
⎣
1
2
−8
0
2
−4
0 −1 / 2 3 / 2
24
8
2
⎤⎡ 48 ⎤
⎥⎢
⎥
⎥⎢ 20 ⎥
⎥⎢ 8 ⎥
⎦⎣
⎦
⎤
⎥
⎥
⎥
⎦
The LP Problem
max z = cx
s.t.
where
Ax ≤ b
x ≥0
c = ⎡⎢ c1 c2 . . cn ⎤⎥
⎣
⎦
⎡ a
⎡ x ⎤
⎡ b ⎤
a12
⎢ 11
⎢ 1 ⎥
⎢ 1 ⎥
⎢ a
⎢ x ⎥
⎢ b ⎥
a 22
⎢ 21
⎢ 2 ⎥
⎢ 2 ⎥
x =⎢ . ⎥, b =⎢ . ⎥, A =⎢ .
.
⎢ .
⎢ . ⎥
⎢ . ⎥
.
⎢
⎢
⎥
⎢
⎥
⎢ a m1 a m 2
⎢ xn ⎥
⎢ bn ⎥
⎣
⎦
⎣
⎦
⎣
. . a1n ⎤⎥
. . a 2n ⎥
⎥
. .
. ⎥
. .
. ⎥
⎥
. . a mn ⎥
⎦
⇒ The augmnted form is obtained by introducing a column vector of slack variables:
⎡ x
⎢ n+1
⎢ xn+2
⎢
xs = ⎢ .
⎢ .
⎢ x
⎢⎣ n+m
⎤
⎥
⎥
⎥
⎥
⎥
⎥
⎥⎦
⇒ The following linear system represents the constraints:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
12
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
⎡
⎤
⎡ A ,I ⎤⎢ x ⎥ = b
⎣
⎦ x
⎢⎣ s ⎥⎦
⎡ x ⎤
⎥≥ 0
and ⎢
⎢⎣ x s ⎥⎦
Since the above system of linear equations is not square, a basic feasible solution is obtained
by setting n variables to zero (non-basic variables) and the remaining variables can have nonnegative values (basic variables).
The basic variables are represented as xB, and the
submatrix, B, in [A, I] selected such that B includes only the columns for basic variables.
The simplex iterations of a linear programming problem in the matrix form can be represented
as follows:
•
initially
⎡ 1 −c
⎢
⎣ 0 A
•
⎡ z ⎤
⎤
0 ⎥⎢ x ⎥ = ⎡⎢ 0 ⎤⎥
⎢
⎥
I ⎦⎢ x ⎥ ⎣ b ⎦
⎣ s ⎦
after any iteration
RHS is updated:
⎡ z ⎤ ⎡ 1 c B −1
B
⎢
⎥=⎢
x
⎢⎣ B ⎥⎦ ⎢⎣ 0 B −1
⎤⎡
−1
⎤ ⎡
⎥⎢ 0 ⎥ = ⎢ c B B b
⎥⎦⎣ b ⎦ ⎢⎣ B −1b
The system of equations are updated:
⎡
−1 ⎤⎡
−1
⎤ ⎡
⎢ 1 c B B ⎥⎢ 1 −c 0 ⎥ = ⎢ 1 −c + c B B A
⎢⎣ 0 B −1 ⎥⎦⎣ 0 A I ⎦ ⎢⎣ 0
B −1 A
⎤
⎥
⎥⎦
⎤
c B B −1 I ⎥
B −1 I ⎥⎦
The following system is obtained at each iteration:
⎡
⎤
⎡
⎤⎢ z ⎥ ⎡
⎤
−1
−1
−1
⎢ 1 −c + c B B A c B B I ⎥⎢ x ⎥ = ⎢ c B B b ⎥
⎢⎣ 0
B −1 A
B −1 I ⎥⎦⎢ x ⎥ ⎢⎣ B −1b ⎥⎦
⎣ s ⎦
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
13
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
THE REVISED SIMPLEX METHOD
Given the following LP:
max z=cx
st
Ax=b
x≥0
0) Find an initial basic feasible solution, xB, with basis B. Partition the variables into two sets
as the set of basic variables, XB, and the set of nonbasic variables, XN. The objective
function coefficients of basic and nonbasic variables are also partitioned into cB and cN
respectively.
1) For the current tableau, calculate y=cBB-1.For each nonbasic variable in XN, calculate the
reduced cost coefficient using, zj–cj = yaj-cj.
2) Calculate zk–ck = max {zj–cj}. If zk–ck ≥ 0, then the optimal solution is found. Otherwise
go to step 3.
3) Update the relevant columns:
ak = B −1ak where ak is the coefficients of variable k in the constraints of initial
formulation and ak is the coefficients of variable k in the constraints for the
current iteration
−1
where b is the right-hand-side values in the constraints of initial formulation
b =B b
and b is the right-hand-side values in the constraints of for the current
iteration
4) Determine the leaving variable by conducting minimum ratio test:
⎧⎪ b i
⎫⎪
br
= min ⎨ : a ik > 0⎬
a rk 1≤i ≤m ⎪⎩ a ik
⎪⎭
Designate the row of the leaving basic variable with r.
5) Pivot at ark . Pivoting on yrk updates the B-1 for the current basis. Lets examine the
algebraic operations for the basis update and develop an efficient representation.
(B )
−1
new ij
⎧ 1
−1
Bnew
if i = r
⎪
rj
a
⎪ rk
=⎨
a ij
⎪ −1
−1
B
−
⎪ old ij a Bold rj if i ≠ r
⎩
rk
(
( )
)
( )
This relationship can be represented as,
−1
−1
Bnew
= E Bold
E is defined as the following augmented matrix:
E = ⎡⎣U1 ,U 2 ,...,U r−2 ,U r−1 ,η , U r+1 ,U r+2 ,...,U m ⎤⎦
where
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
14
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
U i is the m -dimensional column vector with its i th element equal to 1 and the rest are equal to 0
⎡η ⎤
⎢ 1⎥
a
1
⎢η ⎥
η = ⎢ 2 ⎥ is the m -dimensional column vector with ηi =
when i = r and ηi = − ik when i ≠ r
a rk
a rk
⎢... ⎥
⎢⎣ηm ⎥⎦
6) Update XB, XN, cB, cN, B-1, N and go back to 1.
Example: Consider the Wyndor Glass Company problem:
max z = 3x1 + 5x2
s.t.
x1
+ x3
2x2
3x1 + 2x2
=4
+ x4
= 12
+ x5 = 18
x1, x2 , x3, x4 , x5 ≥ 0
0) Initial basic feasible solution:
xB = {x3, x4, x5}
xN = {x1, x2}
cB= [0 0 0]
⎡ 1 0 0 ⎤
⎢
⎥
B0 = ⎢ 0 1 0 ⎥
⎢ 0 0 1 ⎥
⎣
⎦
cN = [3 5]
⎡ 1 0 ⎤
⎢
⎥
N =⎢ 0 2 ⎥
⎢ 3 2 ⎥
⎣
⎦
⎡ 1 0 0 ⎤
⎢
⎥
B0−1 = ⎢ 0 1 0 ⎥
⎢ 0 0 1 ⎥
⎣
⎦
Iteration 1:
⎡ 1 0 0 ⎤
⎢
⎥
1) y = c B B −1 = ⎡⎢ 0 0 0 ⎤⎥⎢ 0 1 0 ⎥ = ⎡⎢ 0 0 0 ⎤⎥
⎣
⎦
⎣
⎦
⎢ 0 0 1 ⎥
⎣
⎦
⎡ 1 ⎤
⎢
⎥
2) z1 − c1 = ya1 − c1 = ⎡⎢ 0 0 0 ⎤⎥⎢ 0 ⎥ − 3 = −3
⎣
⎦
⎢ 3 ⎥
⎣
⎦
⎡ 0 ⎤
⎢
⎥
z 2 − c2 = ya 2 − c2 = ⎡⎢ 0 0 0 ⎤⎥⎢ 2 ⎥ − 5 = −5 ⇒
⎣
⎦
⎢ 2 ⎥
⎣
⎦
x2 enters the basis
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
15
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
⎡ 0 ⎤
⎢
⎥
3) the column for x2 is ⎢ 2 ⎥
⎢ 2 ⎥
⎣
⎦
update
⎡ 1 0 0 ⎤⎡ 0 ⎤ ⎡ 0 ⎤
⎢
⎥⎢
⎥ ⎢
⎥
a 2 = B0−1a 2 = ⎢ 0 1 0 ⎥⎢ 2 ⎥ = ⎢ 2 ⎥
⎢ 0 0 1 ⎥⎢ 2 ⎥ ⎢ 2 ⎥
⎣
⎦⎣
⎦ ⎣
⎦
update
⎡ 1 0 0 ⎤⎡ 4 ⎤ ⎡ 4 ⎤
⎢
⎥⎢
⎥ ⎢
⎥
b = B0−1b = ⎢ 0 1 0 ⎥⎢ 12 ⎥ = ⎢ 12 ⎥
⎢ 0 0 1 ⎥⎢ 18 ⎥ ⎢ 18 ⎥
⎦ ⎣
⎦
⎣
⎦⎣
⎧ 4 12 18 ⎫
4) conduct the minimum ratio test: min ⎨ , , ⎬
⎩0 2 2 ⎭
x2 enters the basis in row 2 (r=2).
5) B1−1 = EB0−1
E = ⎡⎢ U 1 U 2 U 3
⎣
⎡ 1 0 0 ⎤
⎤ = ⎢ 0 1/ 2 0 ⎥
⎥
⎦⎥ ⎢
⎢ 0 −1 1 ⎥
⎣
⎦
The new basis inverse:
⎡ 1
0
0 ⎤⎡ 1 0 0 ⎤ ⎡ 1
0
0 ⎤
⎢
⎥
⎢
⎥
⎢
⎥
B1−1 = EB0−1 = ⎢ 0 1 / 2 0 ⎥⎢ 0 1 0 ⎥ = ⎢ 0 1 / 2 0 ⎥
⎢ 0 −1 1 ⎥⎢ 0 0 1 ⎥ ⎢ 0 −1 1 ⎥
⎣
⎦⎣
⎦ ⎣
⎦
6) Current Solution:
xB = {x3, x2, x5}
xN = {x1, x4}
cB= [0 5 0]
⎡ 1 0 0 ⎤
⎢
⎥
B1−1 = ⎢ 0 1/ 2 0 ⎥
⎢ 0 −1 1 ⎥
⎣
⎦
cN = [3 0]
⎡ 1 0 ⎤
⎢
⎥
N =⎢ 0 1 ⎥
⎢ 3 0 ⎥
⎣
⎦
Iteration 2:
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
16
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
⎡ 1
0
0 ⎤
⎢
⎥
1) y = c B B1−1 = ⎡⎢ 0 5 0 ⎤⎥⎢ 0 1 / 2 0 ⎥ = ⎡⎢ 0 5 / 2 0 ⎤⎥
⎣
⎦
⎣
⎦
⎢ 0 −1 1 ⎥
⎣
⎦
⎡ 1 ⎤
⎢
⎥
2) z1 − c1 = ya1 − c1 = ⎡⎢ 0 5 / 2 0 ⎤⎥⎢ 0 ⎥ − 3 = −3
⎣
⎦
⎢ 3 ⎥
⎣
⎦
⇒
x1 enters the basis
⎡ 0 ⎤
⎢
⎥
z 4 − c4 = ya 4 − c4 = ⎡⎢ 0 5 / 2 0 ⎤⎥⎢ 1 ⎥ − 0 = 5 / 2
⎣
⎦
⎢ 0 ⎥
⎣
⎦
⎡ 1 ⎤
⎢
⎥
3) the column for x1 is ⎢ 0 ⎥
⎢ 3 ⎥
⎣
⎦
update
⎡ 1 0 0 ⎤⎡ 1 ⎤ ⎡ 1 ⎤
⎢
⎥⎢
⎥ ⎢
⎥
a1 = B1−1a1 = ⎢ 0 1/ 2 0 ⎥⎢ 0 ⎥ = ⎢ 0 ⎥
⎢ 0 −1 1 ⎥⎢ 3 ⎥ ⎢ 3 ⎥
⎦ ⎣
⎦
⎣
⎦⎣
update
⎡ 1 0 0 ⎤⎡ 4 ⎤ ⎡ 4 ⎤
⎢
⎥⎢
⎥ ⎢
⎥
b = B1−1b = ⎢ 0 1/ 2 0 ⎥⎢ 12 ⎥ = ⎢ 6 ⎥
⎢ 0 −1 1 ⎥⎢ 18 ⎥ ⎢ 6 ⎥
⎦ ⎣
⎦
⎣
⎦⎣
⎧4 6⎫
4) conduct the minimum ratio test: min ⎨ ,− , ⎬
⎩ 1 3⎭
x1 enters the basis in row 2 (r=3).
5) B2−1 = EB1−1
E = ⎡⎢ U 1 U 2 U 3
⎣
⎡ 1 0 −1/ 3
⎤=⎢ 0 1
0
⎦⎥ ⎢
⎢ 0 0 1/ 3
⎣
⎤
⎥
⎥
⎥
⎦
The new basis inverse:
⎡ 1 0 −1 / 3 ⎤⎡ 1
0
0 ⎤ ⎡ 1 1 / 3 −1 / 3 ⎤
⎢
⎥
⎢
⎥ ⎢
⎥
B2−1 = EB1−1 = ⎢ 0 1
0 ⎥⎢ 0 1 / 2 0 ⎥ = ⎢ 0 1 / 2
0 ⎥
⎢ 0 0 1 / 3 ⎥⎢ 0 −1 1 ⎥ ⎢ 0 −1 / 3 1 / 3 ⎥
⎣
⎦⎣
⎦ ⎣
⎦
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
17
Metin Turkay
INDR 262 Optimization Models and Mathematical Programming
6) Current solution:
xB = {x3, x2, x1}
xN = {x5, x4}
cB= [0 5 3]
⎡ 1 1/ 3 −1/ 3
⎢
B2−1 = ⎢ 0 1/ 2
0
⎢ 0 −1/ 3 1/ 3
⎣
cN = [0 0]
⎡ 0 0 ⎤
⎢
⎥
N =⎢ 0 1 ⎥
⎢ 1 0 ⎥
⎣
⎦
⎤
⎥
⎥
⎥
⎦
Iteration 3:
⎡ 1 1 / 3 −1 / 3 ⎤
⎢
⎥
1) y = c B B2−1 = ⎡⎢ 0 5 3 ⎤⎥⎢ 0 1 / 2
0 ⎥ = ⎡⎢ 0 3 / 2 1 ⎤⎥
⎣
⎦
⎣
⎦
⎢ 0 −1 / 3 1 / 3 ⎥
⎣
⎦
⎡ 0 ⎤
⎢
⎥
2) z 5 − c5 = ya5 − c5 = ⎡⎢ 0 3 / 2 1 ⎤⎥⎢ 0 ⎥ − 0 = 1
⎣
⎦
⎢ 1 ⎥
⎣
⎦
⎡ 0 ⎤
⎢
⎥
z 4 − c4 = ya 4 − c4 = ⎡⎢ 0 3 / 2 1 ⎤⎥⎢ 1 ⎥ − 0 = 3 / 2
⎣
⎦
⎢ 0 ⎥
⎣
⎦
3) No negative coefficients, the current solution is OPTIMAL!
Solution:
⎡ x ⎤
⎡ 1 1/ 3 −1/ 3 ⎤⎡ 4
⎢ 3 ⎥
⎢
⎥⎢
x B = ⎢ x 2 ⎥ = B2−1b = ⎢ 0 1/ 2
0 ⎥⎢ 12
⎢
⎥
⎢ 0 −1/ 3 1/ 3 ⎥⎢ 18
⎢⎣ x1 ⎥⎦
⎣
⎦⎣
⎡ 2 ⎤
⎢
⎥
z = c B B2−1b = c B x B = ⎡⎢ 0 5 3 ⎤⎥⎢ 6 ⎥ = 36
⎣
⎦
⎢ 2 ⎥
⎣
⎦
⎤ ⎡ 2 ⎤
⎥ ⎢
⎥
⎥=⎢ 6 ⎥
⎥ ⎢ 2 ⎥
⎦ ⎣
⎦
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
18
Metin Turkay
Download