Part 3 Linear Programming - National Cheng Kung University

Download Report

Transcript Part 3 Linear Programming - National Cheng Kung University

Part 3 Linear Programming
3.3 Theoretical Analysis
Matrix Form of the Linear
Programming Problem
Ax  b
f  cT x
where
A   B mm
cT   cTB
D ( n m )m 
x 
x   B
x D 
| cTD 
Thus, the linear programming problem
can be written as
min  cTB x B  cTD x D 
s.t.
Bx B  Dx D  b
xB  0
xD  0
LP Solution in Matrix Form
For a basic solution
x T   x TB
| 0T  ; x B  B 1b; f  cTB x B
For any solution
x B  B 1b  B 1Dx D
f  cTB x B  cTD x D
 cTB  B 1b  B 1Dx D   cTD x D
 cTB B 1b   cTD  cTB B 1D  x D
Let
rDT  cTD  cTB B 1D
Tableau in Matrix Form
Initial Tableau
 A mn
 c T
 1n
bm1   Bmm
 T

0   c B
Dm( n m )
T
c D
The canonical form
 I mm

 01m
1
B Dm( n m )
T
rD
B b m1 
T 1 
c BB b 
1
bm1 

0 
Criteria for Determining A
Minimum Feasible Solution
Suppose we have a basic feasible solution
 xTB 0T    y10 y20
ym 0 0 0
0
together with a tableau having an identity matrix
appearing in the 1st m columns
a1 a2
am
am 1
an
b
1
0
0
y1,m 1
y1n
y10
0
1
0
y2,m 1
y2 n
y20
0
0
1
ym ,m 1
ymn
ym 0
The corresponding objective function
f 0  c1 y10  c2 y20 
 cm ym 0
If arbitrary values are assigned to the
nonbasic variables, we can easily solve
for basic variables as
x1  y10 
x2  y20 
n

j  m 1
y1 j x j
n

j  m 1
y2 j x j
the basic variables from the objective func.
f  cT x
 f 0   cm 1  f m 1  xm 1   cm  2  f m  2  xm  2

  cn  f n  xn
where
f j  c1 y1 j  c2 y2 j 
and j  m  1, m  2,
 cm ymj
,n
Theorem (Improvement of Basic
Feasible Solution)
• Given a non-degenerate basic feasible solution
with corresponding objective function f0,
suppose for some j there holds cj-fj<0. Then
there is a feasible solution with objective value
f<f0.
• If the column aj can be substituted for some
vector in the original basis to yield a new basic
feasible solution, this new solution will have f<f0.
• If aj cannot be substituted to yield a basic
feasible solution, then the solution set K is
unbounded and the objective function can be
made arbitrarily small (negative) toward minus
infinity.
Optimality Condition
If for some basic feasible
solution cj-fj or rj is larger than
or equal to zero for all j, then
the solution is optimal.
Symmetric Form of Duality (1)
Dual
Primal
max f  x   c x n1
min g  y   b
s.t.
s.t.
A mn x n1  b m1
ATnm y m1  c n1
x n1  0
y m1  0
T
1n
T
1m
y m1
Symmetric Form of Duality (2)
1. MAX in primal; MIN in dual.
2. <= in constraints of primal; >= in constraints of dual.
3. Number of constraints in primal = Number of variable in
dual
4. Number of variables in primal = Number of constraints
in dual
5. Coefficients of x in objective function = RHS of
constraints in dual
6. RHS of the constraints in primal = Coefficients of y in
dual
7. f(xopt)=g(yopt)
Symmetric Form of Duality (3)
Dual
Primal
min f  x   c x n1
max g  y   b
s.t.
s.t.
T
1n
A mn x n1  b m1
x n1  0
T
1m
A
T
n m
y m1  c n1
y m1  0
y m1
Example
Batch
Reactor B
Batch
Reactor A
Batch
Reactor C
Products
P1, P2, P3, P4
Raw materials
R1, R2, R3, R4
P1
P2
P3
P4
capacity
time
A
1.5
1.0
2.4
1.0
2000
B
1.0
5.0
1.0
3.5
8000
C
1.5
3.0
3.5
1.0
5000
profit
/batch
$5.24
$7.30
$8.34
$4.18
time/batch
Example: Primal Problem
max f  x   5.24 x1  7.30 x2  8.34 x3  4.18 x4
s.t.
1.5 x1  x2  2.4 x3 
x1  5 x2 
x4  2000
x3  3.5 x4  8000
x1  3x2  3.5 x3 
x4  5000
x1 , x2 , x3 , x4  0
where x1 , x2 , x3 and x4 are the number of batches
of P1, P2, P3 and P4 to be manufactured.
Example: Dual Problem
min g  x   2000 y1  8000 y2  5000 y3
s.t.
1.5 y1 
y 2  1.5 y3  5.24
y1  5 y2 + 3.0 y3  7.30
2.4y1 
y2  3.5 y3  8.34
y1  3.5 y2 
y3  4.18
y1 , y2 , y3  0
where y1 , y2 and y3 are the changes in optiaml
total profit w.r.t. changes in capacity time
for batch reactors A, B and C.
Property 1
For any feasible solution to the primal
problem and any feasible solution to the
dual problem, the value of the primal
objective function being maximized is
always equal to or less than the value of
the dual objective function being
minimized.
Proof
A mn x n1  b m1
y
A
T
1m
T
n m
A mn x n1  y
T
1m
y m1  c n1 or y
b m1
T
1m
A m n  c
 y1Tm A mn x n1  c1Tn x n1
y
T
1m
b m1  c x n1
T
1n
T
1n
Property 2
If xˆ is a feasible solution to the primal problem
and yˆ is a feasible solution to the dual problem
such that
T
ˆ
c x  b yˆ
T
then xˆ is an optimal solution to the primal problem
and yˆ is an optimal solution to the dual problem.
Proof
According to the previous property, no feasible x
can make cT x larger than bT y. Since xˆ achieves this value,
it is optimal (maximum).
Similarly, no feasible y can bring by below the number
cT x, and any yˆ that achieves this minimum must be optimal.
Duality Theorem
If either the primal or dual problem has a
finite optimal solution, so does the other,
and the corresponding values of
objective functions are equal. If either
problem has an unbounded objective,
the other problem has no feasible
solution.
Additional Insights
If there is an optimal solution to the primal problem,
we can prove by construction that there is an optimal
solution to the dual problem. In fact, if B is the basis
matrix for the primal problem corresponding to an
optimal solution and if c B contains the prices in the basis,
then the optimal solution to the dual is
y T  cTB B 1
Symmetric Form of Duality (3)
Dual
Primal
min f  x   c x n1
max g  y   b
s.t.
s.t.
T
1n
A mn x n1  b m1
x n1  0
T
1m
A
T
n m
y m1  c n1
y m1  0
y m1
LP Solution in Matrix Form
For a basic solution
x T   x TB
| 0T  ; x B  B 1b; f  cTB x B
For any solution
x B  B 1b  B 1Dx D
f  cTB x B  cTD x D
 cTB  B 1b  B 1Dx D   cTD x D
 cTB B 1b   cTD  cTB B 1D  x D
Let
rDT  cTD  cTB B 1D
Relations associated with the
Optimal Feasible Solution of the
Primal problem
rDT  cTD  cTB B 1D  0
let y T  cTB B 1
This vector is a basic feasible solution
of dual problem. Since
y T A  y T B D    y T B y T D 
 cTB
cTB B 1D   cTB
cTD   cT
In addition,
g  y   y T b  cTB B 1b  cTB x B
Example
max  x1  4 x2  3 x3 
PRIMAL
s.t.
2 x1 2 x2
x1 2 x2
 x3  4
2 x3  6
min  4 y1  6 y2 
DUAL
s.t.
2 y1  y2
2 y1 2 y2
 1
 4
2 y 2
 3
y1
x4
x5
x2
x5
x1
2
1
x3
1
2
x4
1
0
x5
0
1
4
6
1 4 3
0
0
0
x1 x2 x3
x4
1 1 1/ 2 1/ 2
1 0
1
1
3
x2
x3
x2
2
2
0
x5
0
1
2
2
8
1
2
0
x5
x1  0
x2  1
x3  2
B 1
x1
x2
x3
x4
3/ 2
1
1
0
0
1
1 1/ 2
1
1
1
2
2
0
0
1
10
1
y1  1
y2  1
cTBB1
Tableau in Matrix Form
Initial Tableau
 A mn
 c T
 1n
bm1   Bmm
 T

0   c B
Dm( n m )
T
c D
The canonical form
 I mm

 01m
1
B Dm( n m )
T
rD
B b m1 
T 1 
c BB b 
1
bm1 

0 
1
r  c  c B D
T
D
T
D
T
B
  c
T
D1
c   c B D1 c B D 2 
  c
T
D1
0   c B D1 c B I 
T
D2
T
B
T
T
B
1
T
B
1
T
B
  c  c B D1 c B 
T
D1
T
B
1
T
B
  c  c B D1 y 
T
D1
T
B
1
T
1
1
1
Example: The Primal Diet
Problem
How can we determine the most economical diet
that satisfies the basic minimum nutritional
requirements for good health? We assume that
there are available at the market n different
foods that the ith food sells at a price ci per unit.
In addition, there are m basic nutritional
ingredients and, to achieve a balanced diet,
each individual must receive at least bj unit of
the jth nutrient per day. Finally, we assume that
each unit of food i contains aji units of the jth
nutrient.
Primal Formulation
n
min  ci xi
i 1
 c x
s.t.
n
a
i 1
x  bj
ji i
j  1, 2,
 or
,m
Ax  b 
T
The Dual Diet Problem
Imagine a pharmaceutical company that produces in pill
form each of the nutrients considered important by the
dietician. The pharmaceutical company tries to convince
the dietician to buy pills, and thereby supplies the
nutrients directly rather than through purchase of various
food. The problem faced by the drug company is that of
determining positive unit prices y1, y2, …, ym for the
nutrients so as to maximize the revenue while at the
same time being competitive with real food. To be
competitive with the real food, the cost a unit of food
made synthetically from pure nutrients bought from the
druggist must be no greater than ci, the market price of
the food, i.e. y1 a1i + y2 a2i + … + ym ami <= ci.
Dual Formulation
max  b j y j   y T b  bT y 
m
j 1
s.t.
m
a
j 1
ji
y j  ci
i  1, 2,
 or
,n
y Ac
T
T
or A y  c 
T
Shadow Prices
How does the minimum cost change if we
change the right hand side b?
If the changes are small, then the corner
which was optimal remains optimal. The
choice of basic variables does not change.
At the end of simplex method, the
corresponding m columns of A make up
the basis matrix B.
minimum cost  cTB B 1b  ( y*)T b
Thus, a small shift of size b changes
the minimum cost by ( y*) b. The
T
solution y * to the dual problem gives
the rate of change of minimum cost of
the primal problem wrt changes in b.