Linear Programming
Linear Programming
Linear Programming
→ schedule production,
→ choose feedstocks,
→ determine new product feasibility,
→ handle constraints for process controllers,
M
min c1 x1 + c2 x2 + c3 x3 + K + cn x n
xi
subject to:
a11 x1 + a12 x2 + a13 x3 + K + a1n x n ! b1
a21 x1 + a22 x2 + a23 x3 + K + a2 n x n ! b2
M M
am1 x1 + am2 x2 + am3 x3 + K + amn x n ! bm
0 ! x i ! x l ,i
bi " 0
min cT x
x
subject to :
Ax"b
0 " x " xl
b!0
Note that:
convention
Linear Programming
A Simple Example:
increasing
fertilizer
3 profit
pr
c (acres)
of
it c
2 on
to
ur
s
1 trucking
feasible
region
1 2
t (acres)
c t P(x)
0 0 0
2 0 1800
0 1 1500
1) unbounded solutions,
2) no feasible region,
3) non-unique solution,
1) Unbounded Solution:
improving
performance
constraint
x1
x2
2) No Feasible Region:
improving
performance
x1
x2
3) Non-Unique Solution:
improving
performance
x1
x2
! x P " ! x Ci
Linear Programming
subject to :
'1.5 2 $ '3$
% 20 60" x ( %60"
& # & #
T
where : x ! [acres cabbages acres tomatoes] .
SIMPLEX Algorithm
subject to : trucking
1.5 c + 2 t ! 3
20 c + 60 t ! 60
fertilizer
1) in standard form, the problem is:
subject to :
(1.5 2 % (3%
& 20 60# x ) &60#
' $ ' $
x " 0
T
where x ! [c t ] .
Linear Programming
subject to : trucking
1.5 c + 2 t + s1 = 3
20 c + 60 t + s 2 = 60
fertilizer
c, t, s1 , s 2 ! 0
or in matrix form:
subject to :
(1.5 2 1 0% (3%
& 20 60 0 1# x = &60#
' $ ' $
x " 0
T
where x ! [c t s1 s 2 ] .
Linear Programming
c t s1 s2 b
objective function
objective function
coefficients
value
Linear Programming
c t s1 s2 b
s1 1.5 2.0 1.0 0.0 3.0 b1/a12 = 3/2
s2 20.0 60.0 0.0 1.0 60.0 b2/a22 = 1
pivo
most negative coefficient,
t
bring "t" into the basis
Linear Programming
c t s1 s2 b
s1 5/6 0.0 1.0 -1/30 1.0
t 1/3 1.0 0.0 1/60 1.0
pivot
c t s1 s2 b
s1 5/6 0.0 1.0 -1/30 1.0
t 1/3 1.0 0.0 1/60 1.0
c t s1 s2 b
c 1.0 0.0 6/5 -1/25 6/5
t 0.0 1.0 -1/3 3/100 3/5
optimal acres of
cabbages & tomatoes
c t s1 s2 b
c 1.0 0.0 6/5 -1/25 6/5
t 0.0 1.0 -1/3 3/100 3/5
shadow prices
Reduced cost
Dual variables
Lagrange Multipliers
Kuhn-Tucker multipliers
Linear Programming
increasing
fertilizer
3 profit
pr
c (acres)
of
it c
2 on
x* to
ur
s
1 trucking
feasible
region
start 1 2
t (acres)
subject to:
Ax ! b
x " 0
we introduce the slack variables and partition x, A and c as
follows:
basic
" xB %
x = $! ! ! '
$ '
$# x N '&
non-basic
A = [B M N ]
" cB %
c = $! ! ! '
$ '
$# c N '&
subject to:
Bx B + Nx N = b
xB, xN ! 0
SIMPLEX Algorithm (Matrix Form)
P( x ) = c TB B -1 [b - Nx N ] + c TN x N
or:
[ ]
P( x ) = c TB B -1b + c TN - c TB B -1 N x N
xB T xN T b
xB I B-1 N B-1b
0 [
- c TN - c TB B -1 N ] c TB B -1b
SIMPLEX Algorithm (Matrix Form)
Chvatal
Edgar & Himmelblau (references in §7.7)
Fletcher
Gill, Murray and Wright
Duality & Linear Programming
min c Tx
x
subject to:
Ax ! b
Lagrange multipliers
[ ]
L( x , ! ) = x T c - x T A T " b T !
which can be re-arranged to yield:
[
L( " , x ) = b T " - x T A T " ! c ]
This Lagrangian looks very similar to the previous one except
that the Lagrange multipliers λ and problem variables x have
switched places.
Duality & Linear Programming
subject to:
AT# " c
# ! 0
&6# &3#
P ( x* ) = c T x* = 900 $ ! + 1500$ ! = 1980
Primal
%5" %5"
min c Tx
x
subject to:
Ax ! b
As we saw earlier, problems with inequality constraints of this
form often present some difficulty in determining an initial
feasible starting point. They usually require a Phase 1 starting
procedure such as the Big ‘M’ method.
subject to:
AT# " c
# ! 0
Problems such as these are usually easy to start since λ =0 is a
feasible point. Thus no Phase 1 starting procedure is required.
min cT x
x
subject to:
active
!M $ !b M $
# N & x ' #b &
" % " N%
inactive
g4 g1
active
g1 - fertilizer
c (acres)
2 x* g2 - trucking
g2 g3 - non-negativity tomatoes
1
feasible
g4 - non-negativity cabbages
region
1 2
t (acres) g3
Optimality Conditions & Linear Programming
Mx * ! b M = 0
Then, notice that at the optimum:
*
L( x , ! ) = P ( x* ) = c T x*
*
At the optimum, we have seen that the shadow prices for the
active inequality constraints must all be non-negative (i.e. λM≥
0). These multiplier values told us how much the optimum
value of the objective function would increase if the associated
constraint was moved into the feasible region, for a
minimization problem.
T T
"l L(x , ! ) = (g (x ) ) = (Mx - b ) = 0
* *
M
* *
M
T
Optimality Conditions & Linear Programming
(" ) [Mx
* T
M
*
] ( ) [Nx
! b M + "*N
T *
]
! bN = 0
" x L(x* , !* ) = 0T
Optimality Conditions & Linear Programming
g2
pr
of
it
g1 ∇x P
co
∇x g1
nt
ou
rs
x1 ∇x g2
feasible
region
x2
Linear Programming & Sensitivity Analysis
increasing
fertilizer
3 profit
c (acres)
pro
fit c
2 ont
our
s
1 trucking
feasible
region
1 2
t (acres)
subject to:
Ax ! b
!*M = (M T ) -1 c
x* = M -1 b M
Linear Programming & Sensitivity Analysis
# M -1 &
% (
[
! b x * = ! b M -1b M ] = %" " " ( inverse of constraint
%$ 0 (' coefficient matrix
# M -1c &
% (
!b l *
= ! b %" " " ( = 0
%$ 0 ('
[ ]
( c P(x* ) = ( c c T x* = (x* ) T
( c x* = ( [M b ]= 0
c
'1
M
&(M T ) -1 c# &(M T ) -1 #
$ ! $ !
( c )* = ( c $ ' ' ' ! = $ ' ' ' !
$ 0 ! $ 0 !
% " % "
Linear Programming & Sensitivity Analysis
subject to:
! g1 ( x ) $ ! a11 x1 + a12 x 2 $
# g ( x )& = #a x + a x & = Ax ' b
# 2 & # 21 1 22 2
&
#" M &% #" M &%
Summary
min cT x
x
subject to :
Ax!b
0 ! x ! x upper
increasing
fertilizer
3 profit
c (acres)
pro
fit c
2 ont
our
s
1 trucking
1 2
t (acres)
Linear Programming Problems
Kirkman has 180 gal. of milk, 150 lbs. of sugar and 60 gal. of
cream available.
Linear Programming Problems
Continued