You are on page 1of 202

Linear Programming

Cheng-Liang Chen
PSE
LABORATORY
Department of Chemical Engineering
National TAIWAN University
Chen CL 1
Renery Scheduling
The Renery Process
Chen CL 2
Renery Scheduling
Problem Data
Product Yields bbl/bbl crude Product Maximum
Fuel Process Lube Value Demand
Products/Crudes 1 2 3 4 4 $/bbl kbbl/wk
Gasoline 0.6 0.5 0.3 0.4 0.4 45.00 170
Heating Oil 0.2 0.2 0.3 0.3 0.1 30.00 85
Jet Fuel 0.1 0.2 0.3 0.2 0.2 15.00 85
Lube Oil 0.0 0.0 0.0 0.0 0.2 60.00 20
Operating Losses 0.1 0.1 0.1 0.1 0.1
Crude Cost $/bbl 15. 15. 15. 25. 25.
Operating Cost $/bbl 5.0 8.5 7.5 3.0 2.5
Crude Supply kbbl/wk 100 100 100 200
Chen CL 3
Renery Scheduling
Problem Analysis
For 1 kbbl/wk of crude 1, one can produce 0.6 kbbl/wk of
gasoline,
0.2 kbbl/wk of heating oil,
0.1 kbbl/wk of jet fuel,
with production cost of 20 k$ per kbbl/wk.
Values of products produced:
45(0.6) + 30(0.2) + 15(0.1) = 34.5 k$
Prot for 1 kbbl/wk of crude 1: 34.5 (15 + 5) = 14.5 k$
Similarly: prots of 8.0, 4.5, 2.0, 8.5 k$ for crude options 2, 3, 4, 5
The usage preference for crude options are: 1 > 5 > 2 > 3 > 4
Chen CL 4
Renery Scheduling
Problem Analysis
The only constraints that we should satisfy are supply constraints
and maximum demand constraints
Use most protable crude (crude 1) as much as we can:
Using 100 kbbl/wk of crude 1 produces
60 kbbl/wk of gasoline,
20 kbbl/wk of heating oil,
10 kbbl/wk of jet fuel,
0 kbbl/wk of lube oil.
(not exceed maximum demands)
Use next most protable crude (crude 4 in lube process)
Chen CL 5
Renery Scheduling
Problem Analysis
Use next most protable crude (crude 4 in lube process):
Using 100 kbbl/wk of crude 4 produces (accumulated value)
60 + 40 = 100 kbbl/wk of gasoline,
20 + 10 = 30 kbbl/wk of heating oil,
10 + 20 = 30 kbbl/wk of jet fuel,
0 + 20 = 20 (max demand) kbbl/wk of lube oil.
(not exceed maximum demands except lube oil)
Use 3rd most protable crude (crude 2) as much as we can
Chen CL 6
Renery Scheduling
Problem Analysis
Use 3rd most protable crude (crude 2) as much as we can:
Using 100 kbbl/wk of crude 2 produces
60 + 40 + 50 = 150 kbbl/wk of gasoline,
20 + 10 + 20 = 50 kbbl/wk of heating oil,
10 + 20 + 20 = 50 kbbl/wk of jet fuel,
0 + 20 + 0 = 20 (max demand) kbbl/wk of lube oil.
(not exceed maximum demands except lube oil)
Use 4th most protable crude (crude 3) as much as we can
Chen CL 7
Renery Scheduling
Problem Analysis
Use 4th most protable crude (crude 3) as much as we can:
Using 66.67 kbbl/wk of crude 3 produces
60 + 40 + 50 + 20 = 170 (max demand) kbbl/wk of gasoline,
20 + 10 + 20 + 20 = 70 kbbl/wk of heating oil,
10 + 20 + 20 + 20 = 70 kbbl/wk of jet fuel,
0 + 20 + 0 + 0 = 20 (max demand) kbbl/wk of lube oil.
(reaching maximum demand for gasoline and lube oil)
Chen CL 8
Renery Scheduling
Problem Analysis
We cannot use crude 4 in fuel process, because it also produces
gasoline (gasoline has reached maximum demand)
Summary:
Using (100, 100, 66.67, 0, 100) kbbl/wk of crudes 1, 2, 3, 4,5
Chen CL 9
Renery Scheduling
Linear Programming Formulation
Max J =
product sales
..
4

p=1
v
p
Q
p

production cost
..
5

r=1
C
r
x
r
s.t. x
r
S
r
r = 1, 2, 3
x
4
+x
5
S
4
Q
p
= a
p1
x
1
+a
p2
x
2
+a
p3
x
3
+a
p4
x
4
+a
p5
x
5
Q
p
D
p
p = 1, . . . , 4
Q
p
0 p = 1, . . . , 4
x
r
0 r = 1, . . . , 5
Chen CL 10
Renery Scheduling
GAMS Formulation
set C crudes
set P products
data S
c
CSUPPLY(C)
D
p
PDEMAND(P)
v
p
PVALUE(P)
C
c
TCOST(C)
a
pc
YIELDs(P,C)
TCOST(C) sum of CCOST(C) and OCOST(C)
(costs of crude c and operating cost)
PROFIT objective function
PRODUCTION(P) Q
p
equations
X4 total crude 4 usage
X4.UP = CSUPPLY(4-fuel), upper bound
X.UP(C) supply constraints on x
c
Q.UP = PDEMAND(P)
Chen CL 11
Renery Scheduling
GAMS Code
$TITLE Refinery Scheduling
$OFFUPPER
$OFFSYMXREF OFFSYMLIST
OPTION SOLPRINT = OFF;
* Define index sets
SETS C Crudes /1*3, 4-fuel, 4-lube/
P Products /gasoline, heat-oil, jet-fuel, lube-oil/
*Define and initialize the problem data
PARAMETER CSUPPLY(C) Crude oil availabilities in kbbl per wk /
1 100.0, 2 100.0, 3 100.0, 4-fuel 200.0, 4-lube 200.0/
CCOST(C) Crude oil costs in $ per bbl /
1 15.0, 2 15.0, 3 15.0, 4-fuel 25.0, 4-lube 25.0/
PDEMAND(P) Maximum product demands in kbbl per wk /
gasoline 170.0, heat-oil 85.0, jet-fuel 85.0, lube-oil 20.0/
PVALUE(P) Product Values in $ per bbl /
Chen CL 12
gasoline 45.0, heat-oil 30.0, jet-fuel 15.0, lube-oil 60.0/
OCOST(C) Crude operating costs in $ per bbl /
1 5.0, 2 8.5, 3 7.5, 4-fuel 3.0, 4-lube 2.50/
TCOST(C) Total costs: crude plus operating;
TCOST(C) = CCOST(C) + OCOST(C);
TABLE YIELDS(P, C) Yields of products for crudes
1 2 3 4-fuel 4-lube
gasoline 0.6 0.5 0.3 0.4 0.4
heat-oil 0.2 0.2 0.3 0.3 0.1
jet-fuel 0.1 0.2 0.3 0.2 0.2
lube-oil 0.0 0.0 0.0 0.0 0.2;
* Define the optimization variables
VARIABLES X(C) Crude oils used in kbbl per week
Q(P) Amounts of products produced in kbbl
X4 Total amount of crude 4 used in kbbl
PROFIT Total profit from product sales in k$;
POSITIVE VARIABLES X, X4, Q;
* Define constraints and objective function
EQUATIONS OBJFUN Objective function to be maximized
CRUDE4 Total crude 4 usage
PRODUCTION(P) Amounts of products produced;
Chen CL 13
OBJFUN.. PROFIT =E= SUM(P, Q(P)*PVALUE(P)) - SUM(C, TCOST(C)*X(C));
PRODUCTION(P).. Q(P) =E= SUM(C, YIELDS(P,C)*X(C));
CRUDE4.. X4 =E= X("4-fuel") + X("4-lube");
* Define upper and lower bounds
* Upper bounds on amounts of product produced from their maximum demands
Q.UP(P) = PDEMAND(P);
* Upper bounds on crude oil usages from their supplies
X.UP(C) = CSUPPLY(C);
X4.UP = CSUPPLY("4-fuel");
* Define model and solve
MODEL SCHEDULE /ALL/;
SOLVE SCHEDULE USING LP MAXIMIZING PROFIT;
DISPLAY X.L, Q.L, PROFIT.L;
Chen CL 14
Renery Scheduling
GAMS Results
x = [100, 100, 66.667, 0, 100]
T
(kbbl/wk, crude demands)
Q = [170, 70, 70, 20]
T
(kbbl/wk, gas., heating oil, jet fuel, lube oil)
prot = 3400 k$/wk
Chen CL 15
Renery Scheduling
Linear Programming Formulation: Rearranged for MATLAB
Max J =
product sales
..
4

p=1
v
p
Q
p

production cost
..
5

r=1
C
r
x
r
=
product sales
..
4

p=1
v
p
5

r=1
a
pr
x
r
. .
Q
p

production cost
..
5

r=1
C
r
x
r
=
5

r=1
(v
p
a
pr
C
r
) x
r
=
5

r=1
f
r
x
r
Max J =
_
v
t
AC
T
_
x = f
T
x
Chen CL 16
s.t. x
r
S
r
r = 1, 2, 3; x
4
+x
5
S
4
Q
p
D
p
p = 1, . . . , 4

_
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 1
a
11
a
15
.
.
.
.
.
.
.
.
.
a
41
a
45
_

_
. .
A
_

_
x
1
x
2
x
3
x
4
x
5
_

_
. .
x

_
S
1
S
2
S
3
S
4
D
1
D
2
D
3
D
4
_

_
. .
B
Chen CL 17
Renery Scheduling
MATLAB Code
YIELDS = [ 0.6 0.5 0.3 0.4 0.4 ;
0.2 0.2 0.3 0.3 0.1 ;
0.1 0.2 0.3 0.2 0.2 ;
0.0 0.0 0.0 0.0 0.2];
CSUPPLY = [100, 100, 100, 200 ];
PDEMAND = [170, 85, 85, 20 ];
PVALUE = [ 45, 30, 15, 60 ];
CCOST = [ 15, 15, 15, 25, 25];
OCOST = [ 5, 8.5, 7.5, 3, 2.5];
TCOST = CCOST + OCOST ;
f = [- PVALUE*YIELDS + TCOST];
A = [1 0 0 0 0 ;
0 1 0 0 0 ;
0 0 1 0 0 ;
0 0 0 1 1 ; YIELDS ] ;
B = [CSUPPLY, PDEMAND] ;
lb = zeros(5,1); ub = CSUPPLY;
x0 = [0; 0; 0; 0; 0]; %x0=[50;50;50;50;50];
options = optimset(LargeScale,off)
[x,NPROFIT] = linprog(f,A,B,[],[],lb,ub,x0,options);
x, Q = YIELDS*x, PROFIT = - NPROFIT
x =
100.0000
100.0000
66.6667
0.0000
100.0000
Q =
170.0000
70.0000
70.0000
20.0000
PROFIT =
3.4000e+003
Chen CL 18
A Heat Exchange Network Design Problem
Stream FC
p
(kW/K) T
in
(K) T
out
(K)
H1 20 700 410
H2 40 600 310
H3 70 460 310
H4 94 360 310
C1 50 350 650
C2 180 300 400
Utility Temp. (K) Cost ($/KW-yr) Max available (kW)
Fuel 750 120
HP steam 510 90 1000
LP steam 410 70 500
Cooling water 300 325 15
min. temperature approach = 10 K
H1 is not to be allowed to exchange any heat with C1
Chen CL 19
Transshipment LP Model
Heat Contents of Process Streams
Interval T
hot
T
cold
Heat Contents
H1 H2 H3 H4 C1 C2
700 690
0 800 - - - - -
660 650
1 1200 - - - 3000 -
600 590
2 1800 3600 - - 4500 -
510 500
3 1000 2000 - - 2500 -
460 450
4 1000 2000 3500 - 2500 -
410 400
5 - 2000 3500 - 2500 9000
360 350
6 - 2000 3500 4700 - 9000
310 300
Chen CL 20
Heat Exchanger Network Design
Transshipment Model for Heat Flows
Chen CL 21
Condensed Transshipment LP Model
Notations
Assume : any pair of heat/cold streams can exchange heat
R
15
heat residuals
Q
fuel
, Q
HP
, Q
LP
, Q
W
: heating and cooling loads
H
k
= {i| hot stream i supplies heat to interval k}
C
k
= {j| cold stream j demands heat from interval k}
S
k
= {m| hot utility m supplies heat to interval k}
W
k
= {n| cold utility n extracts heat from interval k}
S = set of hot utilities
W = set of cold utilities
Note : R
k
= 0 means pinch point
Chen CL 22
Condensed Transshipment LP Model
Heat Flows in Interval k
Par.s Q
H
ik
heat contents of hot stream i in interval k
Q
C
jk
heat contents of hot stream i in interval k
c
m
, c
n
unit costs of hot stream m and cold stream n
Var.s Q
S
m
, Q
W
n
heat loads of hot (cold) utility m (n)
R
k
heat residual exiting interval k
Chen CL 23
Condensed Transshipment LP Model
LP Formulation
min

mS
c
m
Q
S
m
+

nW
c
n
Q
W
n
s.t. R
k1
+

iH
k
Q
H
ik
+

mS
k
Q
S
m
= R
k
+

jC
k
Q
C
jk
+

nW
k
Q
W
n
Q
S
m
0, Q
W
n
0, k = 1, , K 1
R
k
0, R
0
= R
K
= 0
Chen CL 24
Expanded Transshipment LP Model
Heat Exchange Between Hot and Cold Streams

Chen CL 25
Expanded Transshipment LP Model
Heat Flows Between Hot/Cold Streams in Interval k
H

k
= {i| hot stream i supplies heat to interval k or at a higher interval}
S

k
= {m| hot utility m supplies heat to interval k or at a higher interval}
Q
ijk
= exchange of heat of hot stream i and cold stream j at interval k
Q
mjk
= exchange of heat of hot utility m and cold stream j at interval k
Q
ink
= exchange of heat of hot stream i and cold utility n at interval k
R
ik
= heat residual of hot stream i exiting interval k
R
mk
= heat residual of hot utility m exiting interval k
Chen CL 26
Expanded Transshipment LP Model
LP Formulation
min

mS
c
m
Q
S
m
+

nW
c
n
Q
W
n
s.t. R
i,k1
+Q
H
ik
= R
ik
+

jC
k
Q
ijk
+

nW
k
Q
ink
k K, i H

k
R
m,k1
+Q
S
m
= R
mk
+

jC
k
Q
mjk
k K, m S

iH

k
Q
ijk
+

mS

k
Q
mjk
= Q
C
jk
k K, j C
k

iH

k
Q
ink
= Q
W
n
k K, n W
k
R
ik
, R
mk
, Q
ijk
, Q
mjk
, Q
ink
, Q
S
m
, Q
W
n
0 R
i0
= R
iK
= 0
Q
ijk
= 0 for i = 1, j = 1, k K (forbidden match)
Q
L
ij

K

k=1
Q
ijk
Q
U
ij
i, j (lower/upper bounds)
Chen CL 27
Expanded Transshipment LP Model
GAMS Code
$offsymxref offsymlist
* filename: TRANS.gms
* LP transhipment model with restricted matches
* Reference: Papoulias, S.A. and I.E. Grossmann, "A Structural Optimization
* Approach in Process Synthesis. II: Heat Recovery Networks", Computers and
* Chemical Engineering, 7, 707 (1983)
* Authors: Nikolaos V. Sahinidis and I.E. Grossmann
option limrow=0, limcol=0, solprint=off;
*================= input data
SETS H hot streams /1*4/
C cold streams /1*2/
S hot utilities /1*3/
W cold utilities /1*1/
K temperature intervals (only an upper bound needed) /1*50/;
PARAMETER FCPH(H) FCp of hot streams
/ 1 20
2 40
3 70
4 94 /;
PARAMETER FCPC(C) FCp of cold streams
Chen CL 28
/ 1 50
2 180 /;
PARAMETER TINH(H) inlet T of hot streams
/ 1 700
2 600
3 460
4 360 /;
PARAMETER TOUTH(H) outlet T of hot streams
/ 1 420
2 310
3 310
4 310 /;
PARAMETER TINC(C) inlet T of cold streams
/ 1 350
2 300 /;
PARAMETER TOUTC(C) outlet T of cold streams
/ 1 650
2 400 /;
PARAMETER TINS(S) hot util temp
/ 1 750
2 510
3 410 /;
PARAMETER TINW(W) cold util temp
/ 1 300 /;
PARAMETER DT minimum T approach ;
DT=10;
PARAMETER CS(S) hot utility cost
/ 1 120
2 90
3 70 /;
Chen CL 29
PARAMETER CW(W) cold utility cost
/ 1 15 /;
PARAMETER AS(S) availability of hot util
/ 1 INF
2 1000
3 500 /;
PARAMETER AW(W) availability of cold util
/ 1 INF /;
*===== bounds for heat exchange (imposed and restricted matches)
PARAMETER QLHC(H,C) Lower bound between hot and cold stream ;
PARAMETER QUHC(H,C) Upper bound between hot and cold stream ;
PARAMETER QLHW(H,W) Lower bound between hot stream and cold utility ;
PARAMETER QUHW(H,W) Upper bound between hot stream and cold utility ;
PARAMETER QLCS(C,S) Lower bound between cold stream and hot utility ;
PARAMETER QUCS(C,S) Upper bound between cold stream and hot utility ;
QLHC(H,C) = 0 ;
QUHC(H,C) = INF ; QUHC(1,1) = 0 ;
QLHW(H,w) = 0 ;
QUHW(H,W) = INF ;
QLCS(C,S) = 0 ;
QUCS(C,S) = INF ;
* these could also be inserted in table format ...
* imposed matches
* table QLHC(H,C)
* 1 2 3 4
* 1
* 2
* 3
Chen CL 30
* 4
* 5 ;
*================= parameter evaluations
*=== temperature intervals
PARAMETERS HK(H,K) nonzero (1) elements define set H(k) - existence
CK(C,K) nonzero (1) elements define set C(k) - existence
SK(S,K) nonzero (1) elements define set S(k) - existence
WK(W,K) nonzero (1) elements define set W(k) - existence
QH(H,K) heat content of hot streams at each interval
QC(C,K) heat content of cold streams at each interval
QHT(H) total heat content of hot stream
QCT(C) total heat content of cold stream
TH(K) interval temperature (hot)
TC(K) interval temperature (cold) ;
PARAMETERS IS(S),IW(W),IH(H),IC(C);
* when these become 1, the corresponding stream inlet T
* has been considered for interval evaluations
HK(H,K)=0; CK(C,K)=0; SK(S,K)=0; WK(W,K)=0; QH(H,K)=0;
QC(C,K)=0; TH(K)=0; TC(K)=0;
PARAMETER KM actual temperature intervals ;
PARAMETERS IEND,AUX;
KM=0;IEND=0;IS(S)=0;IW(W)=0;IH(H)=0;IC(C)=0;AUX=0;
PARAMETERS HMAX,CMIN;
HMAX=SMAX(H,TINH(H)); CMIN=SMIN(C,TINC(C));
IS(S) $(TINS(S) GE HMAX)=1;
Chen CL 31
IW(W) $(TINW(W) LE CMIN)=1;
LOOP (K $ (IEND EQ 0),
AUX=0;
LOOP (S $((IS(S) EQ 0) AND (TINS(S) GT AUX)), AUX=TINS(S));
LOOP (H $((IH(H) EQ 0) AND (TINH(H) GT AUX)), AUX=TINH(H));
LOOP (W $((IW(W) EQ 0) AND (TINW(W) GT AUX)), AUX=TINW(W)+DT);
LOOP (C $((IC(C) EQ 0) AND (TINC(C) GT AUX)), AUX=TINC(C)+DT);
TH(K)=AUX;
TC(K)=TH(K)-DT;
IS(S) $(TINS(S) EQ AUX)=1;
IW(W) $(TINW(W) EQ (AUX-DT))=1;
IH(H) $(TINH(H) EQ AUX)=1;
IC(C) $(TINC(C) EQ (AUX-DT))=1;
IF (((SUM(S,IS(S))+SUM(H,IH(H))+SUM(W,IW(W))+SUM(C,IC(C))) EQ
(CARD(S)+CARD(H)+CARD(W)+CARD(C))), IEND=1;KM=ORD(K)-1
)
);
*=== heat contents of streams
LOOP (K $ (ORD(K) LE KM),
HK(H,K)=1 $((TINH(H) GE TH(K)) AND (TOUTH(H) LT TH(K)));
CK(C,K)=1 $((TINC(C) LE TC(K+1)) AND (TOUTC(C) GT TC(K+1)));
SK(S,K)=1 $(((TINS(S) GE TH(K)) AND (TINS(S) LT TH(K-1))) OR
((TINS(S) GE TH(K)) AND (ORD(K) EQ 1)));
WK(W,K)=1 $(((TINW(W) LE TH(K)) AND (TINW(W) GT TH(K+1))) OR
((TINW(W) LE TH(K)) AND (ORD(K) EQ KM)))
);
LOOP (K,
LOOP (H $(HK(H,K) EQ 1),
Chen CL 32
QH(H,K)=FCPH(H)*(TH(K)-TH(K+1));
IF ((TOUTH(H) GT TH(K+1)), QH(H,K)=FCPH(H)*(TH(K)-TOUTH(H)))
);
LOOP (C $(CK(C,K) EQ 1),
QC(C,K)=FCPC(C)*(TC(K)-TC(K+1));
IF ((TOUTC(C) LT TH(K)), QC(C,K)=FCPC(C)*(TOUTC(C)-TC(K+1)))
)
);
QHT(H) = FCPH(H) * ( TINH(H) - TOUTH(H) ) ;
QCT(C) = FCPC(C) * ( TOUTC(C) - TINC(C) ) ;
* ===================== model
POSITIVE VARIABLES
RH(H,K) heat residual of hot stream H exiting interval K
RS(S,K) heat residual of hot utility S exiting interval K
QHC(H,C,K) heat exchange between hot H and cold C in interval K
QHW(H,W,K) heat exchange between hot H and cold util W in interval K
QSC(S,C,K) heat exchange between hot util S and cold C in interval K
QS(S) heating load for hot utility S
QW(W) cooling load for cold utility S ;
VARIABLE UTILITY total utility-cost ;
EQUATIONS
OBJ1 objective function for minimum utility consumption
HBAL(H,K) hot stream HEAT BALANCES
CBAL(C,K) cold stream HEAT BALANCES
SBAL(S,K) hot utility HEAT BALANCES
WBAL(W,K) cold utility HEAT BALANCES
hcIMPOSE(H,C) imposed match between hot and cold stream
Chen CL 33
hcRESTRICT(H,C) restriction between hot and cold stream
hwIMPOSE(H,W) imposed match between hot stream and cold utility
hwRESTRICT(H,W) restriction between hot stream and cold utility
csIMPOSE(C,S) imposed match between cold stream and hot utility
csRESTRICT(C,S) restriction between cold stream and hot utility ;
OBJ1 .. UTILITY =E= SUM ( S, CS(S)*QS(S) ) + SUM ( W, CW(W)*QW(W) ) ;
HBAL(H,K) $ ( (TINH(H) GE TH(K)) AND (ORD(K) LE KM) ) ..
RH(H,K) - ( RH(H,K-1) $ (HK(H,K-1) EQ 1) )
+ SUM (C $ (CK(C,K) EQ 1), QHC(H,C,K) )
+ SUM (W $ (WK(W,K) EQ 1), QHW(H,W,K) ) =E= QH(H,K);
RH.FX(H,K) $ (ORD(K) EQ KM)= 0;
SBAL(S,K) $ ( (TINS(S) GE TH(K)) AND (ORD(K) LE KM) ) ..
RS(S,K) - ( RS(S,K-1) $ (TINS(S) GE TH(K-1)) )
+ SUM (C $ (CK(C,K) EQ 1), QSC(S,C,K) )
- ( QS(S) $ ( (TINS(S) EQ TH(K)) OR (ORD(K) EQ 1) ) ) =E= 0 ;
RS.FX(S,K) $ (ORD(K) EQ KM)= 0;
CBAL(C,K) $ ( CK(C,K) EQ 1 ) ..
SUM ( H $ (TINH(H) GE TH(K)), QHC(H,C,K) ) +
SUM ( S $ (TINS(S) GE TH(K)), QSC(S,C,K) ) =E= QC(C,K) ;
WBAL(W,K) $ ( WK(W,K) EQ 1 ) ..
SUM ( H $ (TINH(H) GE TH(K)), QHW(H,W,K) ) =E= QW(W) ;
QS.UP(S) $(AS(S) LT INF)=AS(S);
Chen CL 34
QW.UP(W) $(AW(W) LT INF)=AW(W);
hcIMPOSE(H,C) $ (QLHC(H,C) GT 0) ..
QLHC(H,C) =L=
SUM ( K $ ( (ORD(K) LE KM) AND (CK(C,K) EQ 1) ), QHC(H,C,K) ) ;
hcRESTRICT(H,C) $ (QUHC(H,C) LT INF) ..
SUM ( K $ ( (ORD(K) LE KM) AND (CK(C,K) EQ 1) ), QHC(H,C,K) )
=L= QUHC(H,C) ;
hwIMPOSE(H,W) $ (QLHW(H,W) GT 0) ..
QLHW(H,W) =L=
SUM ( K $ ( (ORD(K) LE KM) AND (WK(W,K) EQ 1) ) , QHW(H,W,K) ) ;
hwRESTRICT(H,W) $ (QUHW(H,W) LT INF) ..
SUM ( K $ ( (ORD(K) LE KM) AND (WK(W,K) EQ 1) ) , QHW(H,W,K) )
=L= QUHW(H,W) ;
csIMPOSE(C,S) $ (QLCS(C,S) GT 0) ..
QLCS(C,S) =L=
SUM ( K $ ( (ORD(K) LE KM) AND (CK(C,K) EQ 1) ) , QSC(S,C,K) ) ;
csRESTRICT(C,S) $ (QUCS(C,S) LT INF) ..
SUM ( K $ ( (ORD(K) LE KM) AND (CK(C,K) EQ 1) ) , QSC(S,C,K) )
=L= QUCS(C,S) ;
MODEL TRANS / ALL /;
SOLVE TRANS MINIMIZING UTILITY USING LP;
DISPLAY UTILITY.L, RH.L, RS.L, QHC.L, QHW.L, QSC.L, QS.L, QW.L ;
Chen CL 35
Expanded Transshipment LP Model
Results (H1-C1 is Forbidden)
fuel 3900 kW
high pressure steam 500 kW
cold utility 3800 kW
min utility cost 570, 000 $/year
Chen CL 36
Linear Programming: Simple Examples
Case 1:
unique
solution
Min f = 4x
1
x
2
+ 50
s.t. x
1
x
2
2
x
1
+ 2x
2
8
x
1
, x
2
0
Chen CL 37
Linear Programming: Simple Examples
Case 2:
non-unique
solution
Min f = x
1
+x
2
+ 30
s.t. x
1
x
2
2
x
1
+ 2x
2
8
x
1
, x
2
0
Chen CL 38
Linear Programming: Simple Examples
Case 3:
unbounded
solution
Min f = 4x
1
x
2
+ 50
s.t. x
1
x
2
2
x
1
, x
2
0
Chen CL 39
Linear Programming: Simple Examples
Case 4:
no feasible
solution
Min f = 4x
1
x
2
+ 50
s.t. x
1
x
2
5
x
1
+ 2x
2
8
x
1
, x
2
0
Chen CL 40
MATLAB Plot for Case 1
% LP: Case 1 - Single solution
[x1,x2] = meshgrid(0:0.1:6, 0:0.1:6);
f = -4*x1-2*x2+50;
g1 = x1-x2-2; g2 = x1+2*x2-8;
g3 = -x1; g4 = -x2;
cla reset;
set(gca,XTick,[0,2,4,6],...
YTick,[0,2,4,6],...
XTickLabel,{0,2,4,6},...
YTickLabel,{0,2,4,6},...
FontSize,16,LineWidth,3)
xLabel(\bf x_1,FontSize,16,Color,[0,0,0])
yLabel(\bf x_2,FontSize,16,Color,[0,0,0])
title(\bf LP Case 1: unique solution,...
FontSize,16,Color,[0,0,0])
Min f = 4x
1
x
2
+ 50
s.t. x
1
x
2
2
x
1
+ 2x
2
8
x
1
, x
2
0
Chen CL 41
hold on
cv = [0 0];
fv = [25, 30, 35, 40, 45];
const1 = contour(x1,x2,g1,cv,r,LineWidth,3);
const2 = contour(x1,x2,g2,cv,b,LineWidth,3);
const3 = contour(x1,x2,g3,cv,k,LineWidth,3);
const4 = contour(x1,x2,g4,cv,k,LineWidth,3);
fs = contour(x1,x2,f,fv,k-);
clabel(fs)
text(3.1, 1,\bf\leftarrow g_1:x_1- x_2=2,FontSize,12,Color,[1,0,0])
text(1.3,3.5,\bf\leftarrow g_2:x_1+2x_2=8,FontSize,12,Color,[0,0,1])
text( 1,0.2,\bf g_3,FontSize,12)
text(0.1, 2,\bf g_4,FontSize,12)
plot( 4, 2,g,Marker,o,MarkerSize,6)
text( 1, 2,\it\bf FR, FontSize,14)
text(3.75,2.75,\it\bf Infeasible Region,FontSize,14)
hold off
Min f = 4x
1
x
2
+ 50
s.t. x
1
x
2
2
x
1
+ 2x
2
8
x
1
, x
2
0
Chen CL 42
MATLAB Solution for Case 1
% Linear programming:
% Single solution (Case 1)
%
f = [-4 -1];
A = [ 1 -1 ;
1 2];
B = [ 2; 8];
x0 = [ 1; 1];
lb = zeros(2,1);
options = optimset(LargeScale,off)
[x,fval,exitflag,output,lambda] = ...
linprog(f,A,B,[],[],lb,[],x0,options)
x, fval = fval + 50
Min f = 4x
1
x
2
+ 50
s.t. x
1
x
2
2
x
1
+ 2x
2
8
x
1
, x
2
0
x =
4.0000
2.0000
fval =
32.0000
Chen CL 43
MATLAB Solution for Case 2
% Linear programming:
% Multiple solutions (Case 2)
%
f = [-1 1];
A = [ 1 -1 ;
1 2];
B = [ 2; 8];
lb = zeros(2,1);
x0 = [ 0; 0];
%x0 = [ 0; 4];
options = optimset(LargeScale,off)
[x,fval,exitflag,output,lambda] =...
linprog(f,A,B,[],[],lb,[],x0,options)
x0, x, fval = fval + 30
Min f = x
1
+x
2
+ 30
s.t. x
1
x
2
2
x
1
+ 2x
2
8
x
1
, x
2
0
x0 =
0
0
x =
2
0
fval =
28
x0 =
0
4
x =
3
1
fval =
28
Chen CL 44
A Standard Linear Programming Problem
Min: f(x) = c
1
x
1
+ +c
n
x
n
=
n

j=1
c
j
x
j
(f = c
T
x)
s.t. a
11
x
1
+ +a
1n
x
n
= b
1
=
n

j=1
a
1j
x
j
(Ax = b)
a
m1
x
1
+ +a
mn
x
n
= b
m
=
n

j=1
a
mj
x
j
x
j
0, b
j
0; (x 0 b 0)
Chen CL 45
2y
1
+y
2
4 2y
1
y
2
4
2y
1
y
2
4 2y
1
y
2
s
1
= 4, s
1
: surplus variable
2y
1
y
2
4 2y
1
y
2
+s
2
= 4, s
2
: slack variable
2y
1
y
2
= 4, y
2
: unrestricted in sign
2y
1
(y
+
2
y

2
) = 4, y
+
2
, y

2
0
max z min f = z
Chen CL 46
Conversion to Standard LP Form
Max: z = 2y
1
+ 5y
2
s.t. 3y
1
+ 2y
2
12
2y
1
+ 3y
2
6
y
1
0, y
2
: unrestricted in sign

Max: z = 2y
1
+ 5(y
+
2
y

2
)
s.t. 3y
1
+ 2(y
+
2
y

2
) 12
2y
1
+ 3(y
+
2
y

2
) 6
y
1
, y
+
2
, y

2
0
Chen CL 47

Max: z = 2y
1
+ 5(y
+
2
y

2
)
s.t. 3y
1
+ 2(y
+
2
y

2
) +s
1
= 12
2y
1
+ 3(y
+
2
y

2
) s
2
= 6
y
1
, y
+
2
, y

2
, s
1
, s
2
0

Min: f = 2x
1
5x
2
+ 5x
3
s.t. 3x
1
+ 2x
2
2x
3
+x
4
= 12
2x
1
+ 3x
2
3x
3
x
5
= 6
x
i
0
Chen CL 48
Basic Concepts Related to Linear
Programming Problems
All functions are linear
minimize convex (cost) function on a convex set, or
maximize concave (prot) function on a convex set,
global optimum if optimum solution exists
The solution always lies on the boundary of the feasible
region if it exists
(some constraints are active at the optimum)
Chen CL 49
Basic Concepts Related to Linear
Programming Problems
Example: prot maximization problem
Max: z = 400x
1
+ 600x
2
s.t. x
1
+x
2
16
1
28
x
1
+
1
14
x
2
1
1
14
x
1
+
1
24
x
2
1
x
1
, x
2
0
Chen CL 50

Max: z = 400x
1
+ 600x
2
s.t. x
1
+x
2
+x
3
= 16
1
28
x
1
+
1
14
x
2
+x
4
= 1
1
14
x
1
+
1
24
x
2
+x
5
= 1
x
i
0

x
3
= 16 x
1
x
2
x
4
= 1
1
28
x
1

1
14
x
2
x
5
= 1
1
14
x
1

1
24
x
2
z = 400x
1
+ 600x
2
(x
i
0) Innite number of solutions
with dierent z values
Chen CL 51
n = 5 variables, m = 3 constraints (n > m):
innite # of solutions
A solution obtained by setting n m = 2 variables to zero
is called a basic solution
Ten basic solutions (on vertices); ve basic feasible solutions
x
1
x
2
x
3
x
4
x
5
z
1 0 0 16 1 1 0
2 0 16 0
2
7
1
3
infeasible
3 0 14 2 0
5
12
8400
4 0 24 8
5
7
0 infeasible
5 16 0 0
3
7

2
7
infeasible
6 28 0 12 0 1 infeasible
7 14 0 2
1
2
0 5600
8 4 12 0 0
3
14
8800
9 11.2 4.8 0
1
5
0 7360
10
130
17
168
17

26
17
0 0 infeasible
Chen CL 52
MATLAB Code
% ProfMax_V2.m (modified from ProfMax.m)
a1 = 0; a2 = 30;
b1 = 0; b2 = 30;
x1 = [a1 : 0.1 : a2];
y1 = 16-x1;
y2 = 14-14/28*x1;
y3 = 24-24/14*x1;
y4 = 0*x1;
figure(name,axis property)
hold on
plot(x1,y1,b,linewidth,3)
plot(x1,y2,r,linewidth,3)
plot(x1,y3,Color,[0,.5,0],linewidth,3)
set(gca,xlim,[a1 a2],ylim,[b1 b2],linewidth,3,fontsize,14)
xlabel(\bf x_1,fontsize,16)
ylabel(\bf x_2,fontsize,16)
title(\bf Profit maximization problem,fontsize,16)
text(1,15.3,\bf\leftarrow x_1+x_2=16, fontsize,12,Color,[0,0,1])
text(19,5.3,\bf 1/28x_1+1/14x_2=1, fontsize,12,Color,[1,0,0])
text(21,14-14/28*21+0.6,\bf\downarrow,fontsize,12,Color,[1,0,0])
Chen CL 53
text(7,24-24/14*7+0.3,\bf\leftarrow 1/14x_1+1/24x_2=1,...
fontsize,12,Color,[0,.5,0])
text( 3, 5,\bf FR, fontsize,14)
text(15,20,\bf Infeasible Region,fontsize,14)
text( 0, 0.6,\bf 1, fontsize,12,Color,[1, 0, 0])
text( 0, 16,\bf 2, fontsize,12,Color,[0,.5,.5])
text( 0, 13,\bf 3, fontsize,12,Color,[1, 0, 0])
text( 0, 24,\bf 4, fontsize,12,Color,[0,.5,.5])
text( 16, 0.6,\bf 5, fontsize,12,Color,[0,.5,.5])
text( 28, 0.6,\bf 6, fontsize,12,Color,[0,.5,.5])
text(12.5,0.6,\bf 7, fontsize,12,Color,[1, 0, 0])
text(3.5,11.1,\bf 8, fontsize,12,Color,[1, 0, 0])
text( 10, 4,\bf 9, fontsize,12,Color,[1, 0, 0])
text( 8, 10,\bf 10,fontsize,12,Color,[0,.5,.5])
Chen CL 54
LP Terminology
Vertex (Extreme) Point:
Feasible Solution: Solution of constrained equations
satisfying nonnegativity conditions
Basic Solution: A solution of constrained equations obtained
by setting n m variables to zero.
Variables set to zero are called nonbasic
Remaining ones are called basic
Basic Feasible Solution:
A basic solution satisfying nonnegativity conditions on variables
Degenerate Basic Solution:
A solution with a zero-valued basic variable
Chen CL 55
Degenerate Basic Feasible Solution:
Optimum Solution:
A feasible solution with optimum cost function value
Optimum Basic Solution:
A basic feasible solution with optimum cost function value
Convex Polyhedron: If the feasible region for an LP problem
is bounded, it is called Convex Polyhedron
Basis: Columns of coecient matrix A of constrained equations
corresponding to basic variables are said to form a basis for the
mdimensional vector space. Any other mdimensional vector
can be expressed as a linear combination of the basis vectors.
Chen CL 56
Determination of Basic Solutions
Max: z = 4x
1
+ 5x
2
s.t. x
1
+x
2
4
x
1
+x
2
6
x
1
, x
2
0

Max: z = 4x
1
+ 5x
2
s.t. x
1
+x
2
+x
3
= 4
x
1
+x
2
+x
4
= 6
x
1
, x
2
, x
3
, x
4
0
x
1
x
2
x
3
x
4
z
1 0 0 4 6 0 A
2 0 4 0 2 20 B
3 0 6 2 0 E (x)
4 4 0 0 10 F (x)
5 6 0 10 0 24 D
6 1 5 0 0 29 C
Chen CL 57
Optimum Solution for LP Problems
Theorem:
Extreme points and basic feasible solutions
The collection of feasible solutions for an LP problem
constitutes a convex set whose extreme points
correspond to basic feasible solutions.
Chen CL 58
Theorem: basic theorem of linear programming
Let the m n coecient matrix A of constrained
equations have full row rank, rank(A) = m. Then
If there is a feasible solution, there is a basic feasible
solution (vertex), and
If there is an optimum feasible solution, there is an
optimum basic feasible solution.
(one of the vertices of the convex polyhedron representing feasible soln)
Implications: optimum soln must be one of the basic
feasible solns (vertices)
searching among nite basic feasible solns
(at most
n!
m!(nm)!
vertices)
Chen CL 59
Basic Ideas of the Simplex Method
Last Theorem guarantees that one of the basic feasible
solutions is an optimum for the LP problem
Basic ideas of the Simplex method is to proceed
from one basic feasible solution to another in a
way to continually decrease the cost function until
the minimum is reached
A Simplex in ndimensional space is a convex hull
of any (n + 1) points which do not lie on one
hyperplane. A convex hull of (n + 1) points is the
smallest convex set containing all the points
the Simplex represents a convex set
Chen CL 60
Canonical Form
An m n system of simultaneous equations with
rank(A) = m is said to be in canonical form if each
equation has a variable (with unit coecient) that does
NOT appear in any other equation
x
1
+a
1,m+1
x
m+1
+a
1,m+2
x
m+2
+ +a
1,n
x
n
= b
1
x
2
+a
2,m+1
x
m+1
+a
2,m+2
x
m+2
+ +a
2,n
x
n
= b
2
.
.
.
.
.
.
.
.
.
x
m
+a
m,m+1
x
m+1
+a
m,m+2
x
m+2
+ +a
m,n
x
n
= b
m
or I
(m)
x
(m)
+Qx
(nm)
= b
Note: if x
(nm)
= 0 then x
(m)
= b
Chen CL 61
Tableau
x
1
+a
1,m+1
x
m+1
+a
1,m+2
x
m+2
+ +a
1,n
x
n
= b
1
x
2
+a
2,m+1
x
m+1
+a
2,m+2
x
m+2
+ +a
2,n
x
n
= b
2
.
.
.
.
.
.
.
.
.
x
m
+a
m,m+1
x
m+1
+a
m,m+2
x
m+2
+ +a
m,n
x
n
= b
m

Basic x
1
x
2
x
m
x
m+1
x
n
RHS
x
1
1 0 0 a
1,m+1
a
1,m+2
a
1,n
b
1
x
2
0 1 0 a
2,m+1
a
2,m+2
a
2,n
b
2
.
.
.
.
.
.
.
.
.
.
.
.
x
m
0 0 1 a
m,m+1
a
m,m+2
a
m,n
b
m
Chen CL 62
Example: canonical form and basic feasible solution
Min: f = 2x
1
x
2
s.t. 4x
1
+ 3x
2
+x
3
= 12
2x
1
+x
2
+x
4
= 4
x
1
+ 2x
2
+x
5
= 4, x
i
0
Basic x
1
x
2
x
3
x
4
x
5
b basic solution
x
3
4 3 1 0 0 12 x
1
= x
2
= 0
x
4
2 1 0 1 0 4 x
3
= 12, x
4
= 4, x
5
= 4
x
5
1 2 0 0 1 4 f = 0
One possible basic feasible solution
x
1
= x
2
= 0, x
3
= 12, x
4
= 4, x
5
= 4; f = 0
Q: optimum solution ?
We need to try another basic feasible solution!
Chen CL 63
Pivot Step: Interchange of Basic and
Nonbasic Variables
Pivot Step: starting from a basic feasible solution,
nd another one to decrease cost by interchanging a
current basic variable with a non-basic variable
Pivot Row: the row used for elimination process
Pivot Column: the column on which the elimination
is performed
Chen CL 64
Pivot Operation
Interchange of Basic and Nonbasic Variables
Min: f = 2x
1
x
2
s.t. 4x
1
+ 3x
2
+x
3
= 12
2x
1
+x
2
+x
4
= 4
x
1
+ 2x
2
+x
5
= 4, x
i
0
Basic x
1
x
2
x
3
x
4
x
5
b basic solution
x
3
4 3 1 0 0 12 x
1
= x
2
= 0
x
4
2 1 0 1 0 4 x
3
= 12, x
4
= 4, x
5
= 4
x
5
1 2 0 0 1 4 f = 0
x
3
0 1 1 2 0 4 x
2
= x
4
= 0
x
1
1
1
2
0
1
2
0 2 x
3
= 4, x
1
= 2, x
5
= 2
x
5
0
3
2
0
1
2
1 2 f = 4
Chen CL 65
Basic Steps of The Simplex Method
Three basic questions:
Is the current basic feasible solution optimal ?
If not,
How to choose a current nonbasic variable that should
become basic ?
Which variable from the current basic set should
become nonbasic ?
Chen CL 66
Example: steps of the Simplex method
Max: z = 2x
1
+x
2
= f (minf)
s.t. 4x
1
+ 3x
2
12
2x
1
+x
2
4
x
1
+ 2x
2
4 x
1
, x
2
0
z

= 4 along CD
Chen CL 67
In standard LP form:
Min: f = 2x
1
x
2
s.t. 4x
1
+ 3x
2
+ x
3
= 12
2x
1
+ x
2
+ x
4
= 4
x
1
+ 2x
2
+ x
5
= 4
x
i
0
NBs: x
1
= 0 x
2
= 0 (A)
BVs: x
3
= 12 x
4
= 4 x
5
= 4
f = 0 z = 0
Note: f 2x
1
x
2
= 0
Chen CL 68
Basic f x
1
x
2
x
3
x
4
x
5
b b
i
/a
ic
x
3
0 4 3 1 0 0 12
12
4
= 3
x
4
0 2 1 0 1 0 4
4
2
= 2
x
5
0 1 2 0 0 1 4
4
1
= 4
f 1 2 1 0 0 0 0
Cost row has nonzero entries only in nonbasic columns (x
1
, x
2
)
If all nonzero entries are nonnegative optimum soln (?)
Currently, TWO negative entries NOT optimum
Select x
1
to become basic (?) elimination in x
1
column
To keep cost fcn right: f 2x
1
x
2
+ 0x
3
+ 0x
4
+ 0x
5
= 0
If letting x
1
= 0, x
2
= 0 1 then f = 0 1; If x
1
= 0 1, x
2
= 0, f = 0 2
Take ratios of RHS par.s with positive elements in x
1
col.
select x
4
to become nonbasic (smallest ratio)
pivot element is a
21
= 2 Constraint: 2x
1
+ x
2
+ 0x
3
+ x
4
+ 0x
5
= 4;
If x
1
= 0 1, x
2
= 0, x
4
= 4 2; If x
1
= 0 2, x
2
= 0, x
4
= 4 0
Chen CL 69
Basic f x
1
x
2
x
3
x
4
x
5
b b
i
/a
ic
x
3
0 0 1 1 2 0 4
x
1
0 1
1
2
0
1
2
0 2
x
5
0 0
3
2
0
1
2
1 2
f 1 0 0 0 1 0 4
NBs: x
2
= 0 x
4
= 0 (D)
BVs: x
3
= 4 x
1
= 2 x
5
= 2
f = 4 z = 4
All coecients in last row are nonnegative
no further decrease of cost is possible optimum
Cost coecient corresponding to nonbasic variable x
2
is zero
multiple solutions
Chen CL 70
What happens if we do not select a row with the least ratio as
the pivot row ?
If interchange nonbasic var x
1
with basic var x
5
not feasible !
Basic f x
1
x
2
x
3
x
4
x
5
b b
i
/a
ic
x
3
0 4 3 1 0 0 12
12
4
= 3
x
4
0 2 1 0 1 0 4
4
2
= 2
x
5
0 1 2 0 0 1 4
4
1
= 4
f 1 2 1 0 0 0 0
x
3
0 0 5 1 0 4 4 not feasible !
x
4
0 0 3 0 1 2 4 not feasible !
x
1
0 1 2 0 0 1 4
f 1 0 3 0 0 4 8
Chen CL 71
Basic Ideas and Procedures
of the Simplex Method
The method needs an initial basic feasible solution (canonical
form) to initiate the search for the optimum solution
type slack variable
, = type: surplus variable ?? ( articial variable)
The cost function must be expressed in terms of only the NBs
last row in Simplex tableau to eliminate BVs during pivot step
Coecients in last row corresponding to BVs are zero, and
all those corresponding to NBs are nonzero.
If any of the nonzero entries in last row is negative not optimum
Otherwise, an optimum solution has been reached
Chen CL 72
If optimum is not reached interchange a current BV with a NB
A NB with most negative coecient is selected to become
basic ( pivot column)
Take ratios of RHS values with positive elements in pivot column,
identify the row with smallest ratio as the pivot row and the BV
associated with it should become NB
If all entries in pivot column are negative unbounded problem
After identifying pivot column and row
pivot step to obtain a new basic feasible solution
Repeat preceding steps until an answer is obtained
Chen CL 73
Derivation of the Simplex Method
Selection of A Basic Variable to Become Nonbasic
Assume x
c
is a NB tapped to become a BV
cth NB column replace some current basic column
x
c
is to become a basic x
c
0 (after interchange, all
zero elements in cth column except unit element at one location)
x
1
+a
1,m+1
x
m+1
+ +a
1c
x
c
+ +a
1,n
x
n
= b
1
x
2
+a
2,m+1
x
m+1
+ +a
2c
x
c
+ +a
2,n
x
n
= b
2

x
m
+a
m,m+1
x
m+1
+ +a
mc
x
c
+ +a
m,n
x
n
= b
m
Chen CL 74
Pivoting new canonical form (still keep equality constraints):
x
1
+ a
1,m+1
x
m+1
+ +a
1,n
x
n
= b
1
a
1c
x
c
0
x
2
+ a
2,m+1
x
m+1
+ +a
2,n
x
n
= b
2
a
2c
x
c
0

x
m
+ a
m,m+1
x
m+1
+ +a
m,n
x
n
= b
m
a
mc
x
c
0
x
i
= b
i
a
ic
x
c
0 if a
ic
< 0 for all x
c
0
x
i
= b
i
a
ic
x
c
= 0 if a
ic
> 0 and x
c
=
b
i
a
ic

b
r
a
rc
= min
a
ic
> 0
i = 1 m
_
b
i
a
ic
_

maximum allowable x
c
to keep all x
i
0

Select the row index r giving the least ratio of RHS parameter
with positive element in c column
If all a
ic
are non-positive in the cth column, then x
c
can be
increased indenitely unbounded problem !
Chen CL 75
Derivation of the Simplex Method
Selection of A Nonbasic Variable to Become Basic
x
i
= b
i

j=m+1
a
ij
x
j
; i = 1 m
f =
m

i=1
c
i
x
i
+
n

j=m+1
c
j
x
j
=
m

i=1
c
i
_
_
b
i

j=m+1
a
ij
x
j
_
_
+
n

j=m+1
c
j
x
j
=
m

i=1
b
i
c
i
. .
f
0
+
n

j=m+1
_
c
j

i=1
a
ij
c
i
_
. .
c

j
x
j
= f
0
+
n

j=m+1
c

j
x
j
Chen CL 76
Expressing cost function in terms of present NB
c

j
: reduced cost coecients (in last row of Simplex tableau)
For c

j
< 0 increasing x
j
(to become a BV) can decrease f (?)
Choose the NB associated with the most negative c

j
to decrease f
If a c

j
= 0
associated NB can be made basic without aecting f
If all c

j
0 it is not possible to decrease f
current basic feasible solution is optimum
When all c

j
> 0 unique optimum
If at least one c

j
= 0 a possibility of alternate optima
If the NB associated with the negative reduced cost coecient c

j
cannot be made basis (all a
ij
in c

j
column are negative),
then the feasible solution is unbounded
Chen CL 77
Theorem: improvement of basic feasible solution
Given a nondegenerate basic feasible solution with corresponding
cost function f
0
, suppose c

j
< 0 for some j.
Then there is a feasible solution with f < f
0
.
If the jth NB column associated with c

j
can be substituted for
some column in the original basis,
then the new basic feasible solution will have f < f
0
.
If the jth column cannot be substituted to yield a basic feasible
solution, then the feasible region (constraint set) is unbounded
and the cost function can be made arbitrarily small.
Theorem: optimum solution for LP problem
If a basic feasible solution has reduced cost coecients c

j
0 for
all j, then it is optimum
Chen CL 78
Ex: Solution by the Simplex Method
Max: z = 4x
1
+ 5x
2
(minf = 4x
1
5x
2
)
s.t. x
1
+x
2
+x
3
= 4
x
1
+x
2
+x
4
= 6, x
i
0
Basic f x
1
x
2
x
3
x
4
b b
i
/a
ic
x
3
0 1 1 1 0 4
4
1
= 4
x
4
0 1 1 0 1 6
6
1
= 6
f 1 4 5 0 0 0
x
2
0 1 1 1 0 4
x
4
0 2 0 1 1 2
2
2
= 1
f 1 9 0 5 0 20
x
2
0 0 1
1
2
1
2
5
x
1
0 1 0
1
2
1
2
1
f 1 0 0
1
2
9
2
29
Chen CL 79
Ex: Solution by the Simplex Method
Max: z = 400x
1
+ 600x
2
= f
s.t. x
1
+x
2
+x
3
= 16,
1
28
x
1
+
1
14
x
2
+x
4
= 1
1
14
x
1
+
1
24
x
2
+x
5
= 1 x
i
0
Basic f x
1
x
2
x
3
x
4
x
5
b b
i
/a
ic
x
3
0 1 1 1 0 0 16 16
x
4
0 1/28 1/14 0 1 0 1 14
x
5
0 1/24 1/24 0 0 1 1 24
f 1 400 600 0 0 0 0
x
3
0 1/2 0 1 14 0 2 4
x
2
0 1/2 1 0 14 0 14 28
x
5
0 17/336 0 0 7/12 1 5/12 140/17
f 1 100 0 0 8400 0 8400
x
1
0 1 0 2 28 0 4
x
2
0 0 1 1 28 0 12
x
5
0 0 0 17/168 2 1 3/14
f 1 0 0 200 5600 0 8800
Chen CL 80
Ex: LP with Multiple Solutions
Max: z = x
1
+ 0.5x
2
= f (min f)
s.t. 2x
1
+ 3x
2
12
2x
1
+x
2
8 x
1
, x
2
0
Basic f x
1
x
2
x
3
x
4
b b
i
/a
ic
x
3
0 2 3 1 0 12
12
2
= 6
x
4
0 2 1 0 1 8
8
2
= 4
f 1 1
1
2
0 0 0
x
3
0 0 2 1 1 4
4
2
= 2
x
1
0 1
1
2
0
1
2
4
4
1/2
= 8
f 1 0 0 0
1
2
4
x
2
0 0 1
1
2

1
2
2
x
1
0 1 0
1
4
3
4
3
f 1 0 0 0
1
2
4
Chen CL 81
x
(1)
NBs: x
2
= x
4
= 0
BVs: x
1
= 4, x
3
= 4 f = 4
or x
(2)
NBs: x
3
= x
4
= 0
BVs: x
1
= 3, x
2
= 2 f = 4
x = x
(1)
+ (1 )x
(2)
f(x) = 4 (z(x) = 4)
Chen CL 82
Example: Unbounded Problem
Max: z = x
1
2x
2
= f
s.t. 2x
1
x
2
0
2x
1
+ 3x
2
6 x
1
, x
2
0
Basic f x
1
x
2
x
3
x
4
b
x
3
0 2 1 1 0 0
x
4
0 2 3 0 1 6
f 1 1 2 0 0 0
Chen CL 83
Simplex Algorithm: Summary
Step 1: Start with an initial basic feasible solution
Step 2: The cost function must be in terms of only the NBs
Step 3: If all reduced cost coecients for NBs are nonnegative
optimum
Step 4: If all elements in pivot column are negative
unbounded
Step 5: Complete the pivot step
Step 6: Identify basic and nonbasic variables, and their values.
Identify cost function value and go to Step 3
Chen CL 84
Two-Phase Simplex Method
An initial canonical form (basic feasible point) is needed to initialize
Simplex
To obtain standard LP problem as a canonical form:
type: + slack variable (canonical form)
= type: + articial variable (no physical meaning)
type: surplus + articial variable
Articial variables ( AVs) augment the convex polyhedron of the
original problem. Initial basic feasible solution corresponds to an
extreme point (vertex) located in the new expanded space
Extreme pt in expanded space extreme pt in original space
all AVs will be nonbasic (zero value)
further movements are only among extreme pts of original space
Chen CL 85
Articial cost Function
Min: w = x
n+1
+ +x
n+m
=

AV s
x
n+i
s.t. x
n+1
+a
11
x
1
+ +a
1n
x
n
= b
1
x
n+2
+a
21
x
1
+ +a
2n
x
n
= b
2
.
.
.
x
n+m
+a
m1
x
1
+ +a
mn
x
n
= b
m
w =
m

i=1
_
_
b
i

j=1
a
ij
x
j
_
_
=
m

i=1
b
i

j=1
m

i=1
a
ij
. .
c

j
x
j
= c

1
x
1
+ + c

n
x
n
+
m

i=1
b
i
Chen CL 86
Phase I:
to minimize w, original cost function is treated as a constraint
and the elimination step also executed for it
w is a sum of AVs, its minimum value is zero
( AVs become nonbasic at the end of Phase I)
if w

= 0 iterations continued for minimizing f


if w

= 0 no feasible solution exists for original problem


Phase II: same as before
Chen CL 87
Use AVs for Type Constraints
Max: z = y
1
+ 2y
2
= f
s.t. 3y
1
+ 2y
2
12
2y
1
+ 3y
2
6
y
1
0, y
2
: free in sign

y
2
= y
+
2
y

2
x
2
x
3
;
x
4
: slack;
x
5
: surplus;
x
6
: AV
Chen CL 88
Min: w = x
6
= 6 2x
1
3x
2
+ 3x
3
+x
5
s.t. 3x
1
+ 2x
2
2x
3
+x
4
= 12
2x
1
+ 3x
2
3x
3
x
5
+x
6
= 6
f x
1
2x
2
+ 2x
3
= 0, x
i
0
Basic f w x
1
x
2
x
3
x
4
x
5
x
6
b b
i
/a
ic
x
4
0 0 3 2 2 1 0 0 12
12
2
= 6
x
6
0 0 2 3 3 0 1 1 6
6
3
= 2
f 1 0 1 2 2 0 0 0 0
w 0 1 2 3 3 0 1 0 6
x
4
0 0
5
3
0 0 1
2
3

2
3
8
8
2/3
= 12
x
2
0 0
2
3
1 1 0
1
3
1
3
2
f 1 0
1
3
0 0 0
2
3
2
3
4
w 0 1 0 0 0 0 0 1 0 Phase I END
x
5
0 0
5
2
0 0
3
2
1 1 12
x
2
0 0
3
2
1 1
1
2
0 0 6
f 1 0 2 0 0 1 0 0 12 Phase II END
Chen CL 89
Use of AVs for Equality Constraints
Max: z = x
1
+ 4x
2
= f
s.t. x
1
+ 2x
2
5
2x
1
+x
2
= 4
x
1
x
2
0 (infeasible)
Chen CL 90
Min: f = x
1
4x
2
s.t. x
1
+ 2x
2
+ x
3
= 5
2x
1
+ x
2
+ x
5
= 4
x
1
x
2
x
4
+ x
6
= 3
x
i
0
Basic f w x
1
x
2
x
3
x
4
x
5
x
6
b b
i
/a
ic
x
3
0 0 1 2 1 0 0 0 5
5
1
= 5
x
5
0 0 2 1 0 0 1 0 4
4
2
= 2
x
6
0 0 1 1 0 1 0 1 3
3
1
= 3
f 1 0 1 4 0 0 0 0 0
w 0 1 3 0 0 1 1 0 7
x
3
0 0 0
3
2
1 0
1
2
0 3
x
1
0 0 1
1
2
0 0
1
2
0 2
x
6
0 0 0
3
2
0 1
1
2
1 1
f 1 0 0
7
2
0 0
1
2
0 2
w 0 1 0
3
2
0 1
3
2
0 1 Phase I END
Chen CL 91
Use of AVs: Unbounded Problems
Min: f = 3x
1
+ 2x
2
s.t. x
1
x
2
0
x
1
+x
2
2 x
1
, x
2
0
Chen CL 92
Min: f = 3x
1
+ 2x
2
s.t. x
1
+ x
2
+ x
3
= 0
x
1
+ x
2
x
4
+ x
5
= 2
Basic f w x
1
x
2
x
3
x
4
x
5
b b
i
/a
ic
x
3
0 0 1 1 1 0 0 0
x
5
0 0 1 1 0 1 1 2
2
1
= 2
f 1 0 3 2 0 0 0 0
w 0 1 1 1 0 1 0 2
x
3
0 0 0 2 1 1 1 2
x
1
0 0 1 1 0 1 1 2
f 1 0 0 5 0 3 3 6
w 0 1 0 0 0 0 1 0 Phase I,II END
Chen CL 93
Initial tableau: BVs are x
3
= 0, x
5
= 2
degenerate basic feasible soln (A)
c

1
= c

2
= 1, if select x
2
as pivot column
new BVs are x
2
= 0, x
5
= 2 (A again !)
If select x
1
as pivot column
w = 0, f = 6 at end of Phase I
reduced cost coecient in x
4
column is negative, and
all elements in the pivot column are negative
no possibility of any further pivot steps
unbounded
Chen CL 94
Implication of Degenerate Basic Feasible Solution
Max: z = x
1
+4x
2
s.t. x
1
+2x
2
5
2x
1
+x
2
4
2x
1
+x
2
4
x
1
x
2
1

Min: f = x
1
4x
2
s.t. x
1
+2x
2
+x
3
= 5
2x
1
+x
2
+x
4
= 4
2x
1
+x
2
x
5
+x
7
= 4
x
1
x
2
x
6
+x
8
= 1
x
i
0
Chen CL 95
Basic f w x
1
x
2
x
3
x
4
x
5
x
6
x
7
x
8
b b
i
/a
ic
x
3
0 0 1 2 1 0 0 0 0 0 5
5
1
= 5
x
4
0 0 2 1 0 1 0 0 0 0 4
4
2
= 2
x
7
0 0 2 1 0 0 1 0 1 0 4
4
2
= 2
x
8
0 0 1 1 0 0 0 1 0 1 1
1
1
= 1
f 1 0 1 4 0 0 0 0 0 0 0
w 0 1 3 0 0 0 1 1 0 0 5
x
3
0 0 0 3 1 0 0 1 0 1 4
4
3
x
4
0 0 0 3 0 1 0 2 0 2 2
2
3
x
7
0 0 0 3 0 0 1 2 1 2 2
2
3
x
1
0 0 1 1 0 0 0 1 0 1 1
f 1 0 0 5 0 0 0 1 0 1 1
w 0 1 0 3 0 0 1 2 0 3 2
Chen CL 96
Basic f w x
1
x
2
x
3
x
4
x
5
x
6
x
7
x
8
b b
i
/a
ic
x
3
0 0 0 0 1 0 1 1 1 1 2
2
1
x
4
0 0 0 0 0 1 1 0 1
2
3
0
0
1
x
2
0 0 0 1 0 0
1
3
2
3
1
3
1
3
2
3

x
1
0 0 1 0 0 0
1
3

1
3
1
3
1
5
3

f 1 0 0 0 0 0
5
3
7
3
5
3
1
13
3
w 0 1 0 0 0 0 0 0 1 3 0 P-I END
x
3
0 0 0 0 1 1 0 1 0 1 2
x
5
0 0 0 0 0 1 1 0 1 0 0
x
2
0 0 0 1 0
1
3
0
2
3
0
2
3
2
3
x
1
0 0 1 0 0
1
3
0
1
3
0
1
3
5
3
f 1 0 0 0 0
5
3
0
7
3
0
7
3
13
3
P-II END
Chen CL 97
Implication of Degenerate Basic Feasible Solution
x
3
, x
4
: slack; x
5
, x
6
: surplus; x
7
, x
8
: articial
3rd tableau: basic variable x
4
has zero value
degenerate basic feasible solution
x
5
should become basic x
5
is pivot column
The element in pivot column (x
5
) and the degenerate variable row
(x
4
, the 2nd row) is positive (1)
the (2nd) row must always be the pivot row (min ratio is zero)
2nd row is pivot row (x
4
will become a NB)
new basic feasible solution will be degenerate (nal tableau)
Chen CL 98
Implication of Degenerate Basic Feasible Solution
The only way the new feasible solution can be nondegenerate is
when the element in pivot column and the degenerate variable row
is negative
The nal solution:
NBs: x
4
= x
6
= x
7
= x
8
= 0
BVs: x
1
=
5
3
, x
2
=
2
3
, x
3
= 2, x
5
= 0
f =
13
3
z =
13
3
Chen CL 99
Alternate Simplex Method:
The Big-M Method
For , = type constraints, augment f with AVs having Big coe.s
Max: z = y
1
+ 2y
2
s.t. 3y
1
+ 2y
2
12
2y
1
+ 3y
2
6
y
1
0, y
2
: unrestricted in sign
Max: z = x
1
+ 2x
2
2x
3
s.t. 3x
1
+ 2x
2
2x
3
+x
4
= 12
3x
1
+ 3x
2
3x
3
x
5
+x
6
= 6, x
i
0
Min: f = x
1
2x
2
+ 2x
3
+Mx
6
(M = 10?)
= x
1
2x
2
+ 2x
3
+ 10(6 2x
1
3x
2
+ 3x
3
+x
5
)
= 60 21x
1
32x
2
+ 32x
3
+ 10x
5
Chen CL 100
Basic f x
1
x
2
x
3
x
4
x
5
x
6
b b
i
/a
ic
x
4
0 3 2 2 1 0 0 12
12
2
= 6
x
6
0 2 3 3 0 1 1 6
6
3
= 2
f 1 21 32 32 0 10 0 60
x
4
0
5
3
0 0 1
2
3

2
3
8
8
2/3
= 12
x
2
0
2
3
1 1 0
1
3
1
3
2
f 1
1
3
0 0 0
2
3
32
3
4
x
5
0
5
2
0 0
3
2
1 1 12
x
2
0
3
2
1 1
1
2
0 0 6
f 1 2 0 0 1 0 10 12
Chen CL 101
Simplex Method in Matrix Form
Min: f = c
T
x
s.t. Ax b
x 0

Min: f = c
T
x
s.t. Ax +x
s
= b
x 0, x
s
0

Chen CL 102

_
_
0 A I
1 c
T
0
_
_
_

_
f
x
x
s
_

_
=
_
_
b
0
_
_

Basic f x x
s
RHS
x
s
0 A I b
f 1 c
T
0 0
Chen CL 103
b =
_
A I
_
_
_
x
x
s
_
_
=
_
B N
_
_
_
x
B
x
N
_
_
= Bx
B
+N x
N
..
=0
= Bx
B
x
B
= B
1
b
f = c
T
B
x
B
+c
T
N
x
N
= c
T
B
x
B
= c
T
B
B
1
b
Chen CL 104
_
_
0 B
1 c
T
B
_
_
_
_
f
x
B
_
_
=
_
_
b
0
_
_

_
_
f
x
B
_
_
=
_
_
0 B
1 c
T
B
_
_
1
_
_
b
0
_
_
=
_
_
c
T
B
B
1
1
B
1
0
_
_
_
_
b
0
_
_
=
_
_
c
T
B
B
1
b
B
1
b
_
_
Chen CL 105
_
_
0 A I
1 c
T
0
_
_
_

_
f
x
x
s
_

_
=
_
_
b
0
_
_
_
_

_
_
c
T
B
B
1
1
B
1
0
_
_
_
_

_
_
1 c
T
c
T
B
B
1
A c
T
B
B
1
0 B
1
A B
1
_
_
_

_
f
x
x
s
_

_
=
_
_
c
T
B
B
1
b
B
1
b
_
_
Basic f x x
s
RHS
x
B
0 B
1
A B
1
B
1
b
f 1 c
T
c
T
B
B
1
A c
T
B
B
1
c
B
B
1
b
Chen CL 106
Example
Min: f =
_
6 4 0 0 0
_
_

_
x
1
x
2
x
3
x
4
x
5
_

_
s.t.
_

_
9 4 1 0 0
5 8 0 1 0
1 1 0 0 1
_

_
_

_
x
1
x
2
x
3
x
4
x
5
_

_
=
_

_
360
400
55
_

_
Chen CL 107
If select x
B
=
_

_
x
1
x
2
x
3
_

_
c
B
=
_

_
6
4
0
_

_
B =
_

_
9 4 1
5 8 0
1 1 0
_

_
b =
_

_
360
400
55
_

_
Chen CL 108
B
1
=
_

_
0
1
3
8
3
0
1
3

5
3
1
5
3

52
3
_

_
x
B
= B
1
b =
_

_
0
1
3
8
3
0
1
3

5
3
1
5
3

52
3
_

_
_

_
360
400
55
_

_
=
_

_
40
3
125
3
220
3
_

_
f = c
T
B
x
B
=
_
6 4 0
_
_

_
40
3
125
3
220
3
_

_
=
740
3
Chen CL 109
Entering Variable and Leaving Variable
b = Bx
B
+Nx
N
x
B
= B
1
b B
1
Nx
N
= B
1
b

jN
B
1
a
j
x
j
a
j
: jth column of A

= [A I]
f = c
B
x
B
+c
N
x
N
= c
B
_
B
1
b B
1
Nx
N
_
+c
N
x
N
= c
B
B
1
b +
_
_
_
c
N
c
B
B
1
N
. .
d
N
_
_
_
x
N
= c
B
B
1
b +

jN
_
_
_
c
j
c
B
B
1
a
j
. .
d
j
_
_
_
x
j
Chen CL 110
if c
j
d
j
0 j N optimum solution
select x
j
with most negative d
j
c
j
as the entering variable, x
E
x
j
= x
E
: NB(= 0) B(x
j
> 0)
x
B
= B
1
b B
1
a
E
x
E
_

_
x
B1
x
B2
.
.
.
x
Bm
_

_
=
_

_
b
k
1
b
k
2
.
.
.
b
k
m
_

_
a
1E
a
2E
.
.
.
a
mE
_

_
x
E
select x
i
with minimum
b
k
i
a
iE
, a
iE
> 0 as leaving variable
x
i
= x
V
: B (x
i
> 0) NB(x
i
= 0)
Chen CL 111
Procedures
Initialization:
Initial canonical form
Improvement:
Compute c
j
d
j
, select x
E
with most negative c
j
d
j
Select x
V
with least ratio min
_
b
k
i
a
iE
, a
iE
> 0
_
Replace a
V
of x
V
with a
E
of x
E
nd the new B
new
Optimality Check:
compute new c
j
d
j
by using B
new
stop if c
j
d
j
0 j N
x

B
= B
1
new
b, f

= c
B
x

B
Chen CL 112
Revised Simplex: Example
Min: f =
_
6 4 0 0 0
_
_

_
x
1
x
2
x
3
x
4
x
5
_

_
s.t.
_

_
9 4 1 0 0
5 8 0 1 0
1 1 0 0 1
_

_
_

_
x
1
x
2
x
3
x
4
x
5
_

_
=
_

_
360
400
55
_

_
Chen CL 113
x
B
=
_

_
x
3
x
4
x
5
_

_
x
N
=
_
_
x
1
x
2
_
_
c
B
=
_

_
0
0
0
_

_
c
N
=
_
_
6
4
_
_
B =
_

_
1 0 0
0 1 0
0 0 1
_

_
B
1
=
_

_
1 0 0
0 1 0
0 0 1
_

_
Chen CL 114
x
N
=
_
_
x
1
x
2
_
_
c
T
N
c
T
B
B
1
N =
_
6 4
_

_
0 0 0
_
_

_
1 0 0
0 1 0
0 0 1
_

_
_

_
9 4
5 8
1 1
_

_
=
_
6 4
_

_
0 0
_
=
_
6 4
_
6 < 4 select x
1
as x
E
Chen CL 115
x
B
=
_

_
x
3
x
4
x
5
_

_
= B
1
b B
1
a
E
x
E
(a
E
= a
1
)
=
_

_
1 0 0
0 1 0
0 0 1
_

_
_

_
360
400
55
_

_
1 0 0
0 1 0
0 0 1
_

_
_

_
9
5
1
_

_
x
E
=
_

_
360 9x
E
400 5x
E
55 x
E
_

_
if x
E
= min
_
360
9
= 40,
400
5
= 80,
55
1
= 55
_
= 40
x
3
= 0 (= x
V
, become a NB)
Chen CL 116
x
B
=
_

_
x
1
x
4
x
5
_

_
x
N
=
_
_
x
2
x
3
_
_
c
B
=
_

_
6
0
0
_

_
c
N
=
_
_
4
0
_
_
B =
_

_
9 0 0
5 1 0
1 0 1
_

_
B
1
=
_

_
1
9
0 0

5
9
1 0

1
9
0 1
_

_
Chen CL 117
x
N
=
_
_
x
2
x
3
_
_
c
T
N
c
T
B
B
1
N =
_
4 0
_

_
6 0 0
_
_

_
1
9
0 0

5
9
1 0

1
9
0 1
_

_
_

_
4 1
8 0
1 0
_

_
=
_
4 0
_

8
3

2
3
_
=
_

4
3
2
3
_

4
3
< select x
2
as x
E
Chen CL 118
x
B
=
_

_
x
1
x
4
x
5
_

_
= B
1
b B
1
a
E
x
E
=
_

_
1
9
0 0

5
9
1 0

1
9
0 1
_

_
_

_
360
400
55
_

_
1
9
0 0

5
9
1 0

1
9
0 1
_

_
_

_
4
8
1
_

_
x
E
=
_

_
40
4
9
x
E
200
52
9
x
E
15
5
9
x
E
_

_
if x
E
= min
_
40
4/9
= 90,
200
52/9
,
15
5/9
= 27
_
= 27
x
5
= 0 (= x
V
, become a NB)
Chen CL 119
x
B
=
_

_
x
1
x
4
x
2
_

_
x
N
=
_
_
x
3
x
5
_
_
c
B
=
_

_
6
0
4
_

_
c
N
=
_
_
0
0
_
_
B =
_

_
9 0 4
5 1 8
1 0 1
_

_
B
1
=
_

_
1
5
0
4
5
3
5
1
32
5

1
5
0
9
5
_

_
Chen CL 120
x
N
=
_
_
x
3
x
5
_
_
c
T
N
c
T
B
B
1
N =
_
0 0
_

_
6 0 4
_
_

_
1
5
0
4
5
3
5
1
32
5

1
5
0
9
5
_

_
_

_
1 0
0 0
0 1
_

_
=
_
0 0
_

2
5

12
5
_
=
_
2
5
12
5
_
Chen CL 121
x

B
= B
1
b =
_

_
1
5
0
4
5
3
5
1
32
5

1
5
0
9
5
_

_
_

_
360
400
55
_

_
=
_

_
28
44
27
_

_
=
_

_
x

1
x

4
x

2
_

_
(x

3
= x

5
= 0)
f

= c
T
B
x

B
=
_
6 0 4
_
_

_
28
44
27
_

_
= 276
Chen CL 122
Quadratic Programming
Min: f = c
T
x +
1
2
x
T
Qx
s.t. Ax b x 0
Min: f = c
T
x +
1
2
x
T
Qx
s.t. Ax + s = b x 0
L = c
T
x +
1
2
x
T
Qx +
T
(Ax +s b)
T
x
KKC: L = c +Qx +A
T
= 0

_
_
Q A
T
I 0
A 0 0 I
_
_
_

_
x

s
_

_
=
_
_
c
b
_
_
Chen CL 123
Add Articial Variables, v, on these equality constraints,
Use two-phase method to solve the problem:
Min: w =
n

i=1
v
i
s.t.
_
_
Q A
T
I 0 I
A 0 0 I 0
_
_
_

_
x

s
v
_

_
=
_
_
c
b
_
_
Chen CL 124
QP: Example
Min: f = 3x
1
x
1
x
2
+x
2
1
+ 2x
2
2
s.t. 3x
1
+x
2
5
x
1
, x
2
0

Min: z =
_
3 0
_
_
_
x
1
x
2
_
_
+
1
2
_
x
1
x
2
_
_
_
2 1
1 4
_
_
_
_
x
1
x
2
_
_
s.t.
_
3 1
_
_
_
x
1
x
2
_
_

_
5
_
_
_
x
1
x
2
_
_

_
_
0
0
_
_
Chen CL 125
Min: w = v
1
+v
2
s.t.
_

_
2 1 3 1 0 0 1 0
1 4 1 0 1 0 0 1
3 1 0 0 0 1 0 0
_

_
_

_
x
1
x
2

2
s
v
1
v
2
_

_
=
_

_
3
0
5
_

_
w = v
1
+v
2
= (summation of rst 2 rows)
= x
1
3x
2
4 +
1
+
2
+ 3
Chen CL 126
Basic w x
1
x
2

1

2
s v
1
v
2
b b
i
/a
ic
v
1
0 2 1 3 1 0 0 1 0 3
3
2
v
2
0 1 4 1 0 1 0 0 1 0 0
s 0 3 1 0 0 0 1 0 0 5
5
3
w 1 1 3 4 1 1 0 0 0 3 (-3,-4 ?)
x
1
0 1
1
2
3
2

1
2
0 0
1
2
0
3
2

v
2
0 0
7
2
5
2

1
2
1 0
1
2
1
3
2
3/2
7/2
s 0 0
5
2

9
2
3
2
0 1
3
2
0
1
2
1/2
5/2
w 1 0
7
2

5
2
1
2
1 0
1
2
0
3
2
x
1
0 1 0
3
5

1
5
0
1
5
1
5
0
8
5
8/5
3/5
v
2
0 0 0
44
5

13
5
1
7
5
13
5
1
4
5
4/5
44/5
x
2
0 0 1
9
5
3
5
0
2
5

3
5
0
1
5

w 1 0 0
44
5
13
5
1
7
5

8
5
0
4
5
x
1
0 1 0 0
1
44
3
44
13
44
1
44

3
44
17
11
0 0 0 1
13
44

5
44

7
44
13
44
5
44
1
11
x
2
0 0 1 0
3
44

9
44
5
44

3
44
9
44
4
11
w 1 0 0 0 0 0 0 1 1 0
x

1
= 17/11, x

2
= 4/11,

= 1/11 f

= 308/121
Chen CL 127
Duality: Start from Lagrangian and
The Kuhn-Tucker Conditions (Min,)
Min: f(x)
s.t. g
j
(x) 0 j = 1, , m
h
k
(x) = 0 k = 1, , ; x 0
L(x, ) = f(x)+
m

j=1

j
g
j
(x) +

k=1

m+k
h
k
(x)
KTC: g
j
(x

) 0 j = 1, , m (x

is feasible)
h
k
(x

) = 0 k = 1, ,

j
g
j
(x

) = 0 j = 1, , m

x
f(x

) +
m

j=1

x
g
j
(x

) +

k=1

m+k

x
h
k
(x

) = 0

j
0;

m+k
unrestricted in sign
Chen CL 128
Saddle Point Theorem (Min,)
L(x

, ) L(x

) L(x,

)
Proof:
Min: f(x) (x 0)
s.t. g
j
(x) 0 j = 1, , m (skip h now)
L(x, ) = f(x)+
m

j=1

j
g
j
(x)
NC on x:
_
L
x
i
_
x

=
_
f
x
i
_
x

j
_
g
j
x
i
_
x

= 0
x 0
_
L
x
i
_
x

0 x

i
_
L
x
i
_
x

= 0
(if x

i
> 0
_
L
x
i
_
x

= 0)
(if x

i
= 0
_
L
x
i
_
x

> 0)
L(x

) L(x,

)
Chen CL 129
0 df(x

) =

i
_
f
x
i
_
x

dx
i
(min prob)
=

i
_
_

j
_
g
j
x
i
_
x

_
_
dx
i
=

i
_
g
j
x
i
_
x

dx
i
=

j
dg
j
(x

)
. .
0

j
0 j
NC:

j
0
_
L

j
_
x

= g
j
0

j
_
L

j
_
x

= 0
L(x

, ) L(x

)
L(x

, ) L(x

) L(x,

)
Chen CL 130
Saddle Point and Properties (Min,)

x
L(x

) = 0

L(x

) = 0

x
L(x,

) 0

L(x

, ) 0
Chen CL 131
The Max-Min Problem (Min,)
L(x

, ) L(x

) L(x,

)
(x

) denes a saddle pt of the Lagrangian


If dene the Lagrangian in terms of alone
L() = min
x
L(x, ) = L(x

, )
since L() is a maximum w.r.t. at the optimum
max

L() = max

min
x
L(x, ) gives (x

)
similary min
x
L(x) = min
x
max

L(x, ) gives (x

)
Chen CL 132
The Primal and Dual Problems (Min,)
Min: f(x)
s.t. g
j
(x) 0 j = 1, , m
h
k
(x) = 0 k = 1, ,
L(x, ) = f(x)+
m

j=1

j
g
j
(x) +

k=1

m+k
h
k
Primal min
x
max

L(x, ) = min
x
L(x) x 0
Dual max

min
x
L(x, ) = max

L() 0
Chen CL 133
Duality (Min,)
Min: f(x)
s.t. g
j
(x) 0 j = 1, , m
L(x, ) = f(x)+
m

j=1

j
g
j
(x)
L(x

, ) L(x

)
. .
=f(x

)
L(x,

)
max

min
x
L(x, )
. .
L(x

,)()
x

min
x
max

L(x, )
. .
L(x,

)f(x)
x

() f(x

) f(x)
Chen CL 134
Duality in Linear Programming (Min,)
Min: f
p
(x) = c
T
x +f
0
s.t. Ax b x 0
L(x, ) = c
T
x+
T
(Ax b) +f
0
=
T
b +x
T
(c +A
T
)+f
0
Note:
x
L(x, ) = c +A
T
0
_
A
T
c
_
NC on x


x
L(x

, ) = c +A
T
= 0
c
T
x +
T
Ax = 0
L() = b
T
+f
0
z
d
()
Max: z
d
() = b
T
+f
0
s.t. A
T
c 0
Note: f(x

) = L(

)
Chen CL 135
Notes:
x : primal variable; : dual variable
Engineering problems have the feature that the number of
constraints is usually far greater than the number of design
variables, yet it is the number of constraints which determines
the eciency of the LP solution
if n << m then dual linear problem should be more ecient
If evaluating
x
L(

), then any component which is nonzero


must correspond to a primal variable which is zero in order to
satisfy c
T
x+
T
Ax = 0
Chen CL 136
A Linear Programming Example (Min,)
Min: f
p
(x) = 4x
1
x
2
+ 50
s.t. g
1
(x) = x
1
x
2
2
g
2
(x) = x
1
+ 2x
2
8
g
3
(x) = x
1
+x
2
10
g
4
(x) = 5x
1
+x
2
5
c =
_
_
4
1
_
_
A =
_

_
1 1
1 2
1 1
5 1
_

_
b =
_

_
2
8
10
5
_

_
Chen CL 137
Dual Problem:
Max: L() = 2
1
8
2
10
3
5
4
+ 50
s.t. g
1
() =
1
+
2
+
3
5
4
4
g
2
() =
1
+ 2
2
+
3
+
4
1

i
0

=
_
7
3
5
3
0 0

T
L(

) = 32

x
L(x

) =
_
_
4
1
_
_
+
_
_
1 1 1 5
1 2 1 1
_
_
_

_
7/3
5/3
0
0
_

_
=
_
_
0
0
_
_

1
,

2
= 0 x

1
x

2
= 2 x

1
+ 2x

2
= 8
x

=
_
_
4
2
_
_
f
p
(x

) = 32
Chen CL 138
Duality for Linear Programming
Another Approach
Primal Min: f
p
(x) = c
T
x +f
0
s.t. Ax b x 0
Dual Max: z
d
() = b
T
+f
0
s.t. A
T
c 0
Suppose x
0
,
0
are feasible solutions (for primal, dual)
x

, are optimal solutions (for primal, dual)


(1) Ax
0
b x
0
T
A
0
b
T

0
A
T

0
c
0
T
Ax
0
c
T
x
0
b
T

0
c
T
x
0
(Weak Duality Property)
b
T

= c
T
x

(Strong Duality Property)


Chen CL 139
(2) Ax

+ u

= b x

T
A

+u

= b
T

A
T

= c

T
Ax

T
x

= c
T
x

+ v

T
x

= b
T

+c
T
x

. .
0
u

+ v

T
x

= 0
u

= 0,
v

T
x

= 0 (Complementary Slackness Cond.)


u

i
= 0, i = 1, , m
v

j
x

j
= 0, j = 1, , n
Chen CL 140
Duality in Quadratic Programming
Min: f(x) =
1
2
x
T
Qx +c
T
x
s.t. Ax b
L(x, ) =
1
2
x
T
Qx +c
T
x +
T
(Ax b)
NC on x
x
L(x, ) = Qx +c +A
T
= 0
x = Q
1
(c +A
T
)
Max: L() =
1
2

T
D d
T

1
2
c
T
Q
1
c
. .
ignored
D = AQ
1
A
T
d = b +AQ
1
c
Convert original QP problem with m inequality constraints and n
design variables to the dual QP problem with only simple
non-negative constraints ( 0)
Chen CL 141
Duality in Separable Programming (I)
Min: f(x) =
n

i=1
_
a
i
x
i
+
1
2
b
i
x
2
i
_
(separable obj)
s.t. g
j
(x) =
n

i=1
c
ji
x
i
j = 1, , m
L
i
() = min
x
i
_
_
a
i
x
i
+
1
2
b
i
x
2
i
+
m

j=1

j
c
ji
x
i
_
_

x
i
L
i
() = a
i
+b
i
x
i
+
m

j=1

j
c
ji
= 0
x
i
=
a
i

m
j=1

j
c
ji
b
i
(x

i
x
i
x
u
i
; x
i
= x

i
if b
i
= 0)
Max: L
i
() with quadratic obj and linear constraints
Chen CL 142
Duality in Separable Programming (II)
Min: f(x) =
n

i=1
_
a
i
x
i
+
1
2
b
i
x
2
i
_
(separable obj)
s.t. g
j
(x) =
n

i=1
_
c
ji
x
i
+
1
2
d
ji
x
2
i
_
j = 1, , m
L
i
() = min
x
i
_
_
a
i
x
i
+
1
2
b
i
x
2
i
+
m

j=1

j
_
c
ji
x
i
+
1
2
d
ji
x
2
i
_
_
_

x
i
L
i
() = a
i
+b
i
x
i
+
m

j=1

j
(c
ji
+d
ji
x
i
) = 0
x
i
=
a
i

m
j=1

j
c
ji
b
i
+

m
j=1

j
d
ji
(x

i
x
i
x
u
i
; x
i
= x

i
if denominator = 0)
Max: L
i
() with quadratic obj and quadratic constraints
Chen CL 143
Duality in Linear Programming
(A Simpler Approach Again)
Primal Min: f
p
= c
1
x
1
+ +c
n
x
n
=
n

j=1
c
j
x
j
= c
T
x
s.t. a
11
x
1
+ +a
1n
x
n
b
1
(Ax b)
a
m1
x
1
+ +a
mn
x
n
b
m

Dual Max: z
d
= b
1
y
1
b
m
y
m
=
m

i=1
b
i
y
i
= b
T
y
s.t. a
11
y
1
+ +a
m1
y
m
c
1
(A
T
y c)
a
1n
y
1
+ +a
mn
y
m
c
n
Chen CL 144
Example: Dual of an LP Problem
Min: f
p
= 5x
1
+ 2x
2
s.t. 2x
1
+x
2
9
x
1
2x
2
2
3x
1
+ 2x
2
3
x
1
, x
2
0

Max: z
d
= 9y
1
2y
2
3y
3
s.t. 2y
1
+y
2
3y
3
5
y
1
2y
2
+ 2y
3
2
y
1
, y
2
, y
3
0
Chen CL 145
Treatment of Equality Constraints
Min: f
p
= x
1
4x
2
s.t. x
1
+ 2x
2
5
2x
1
+x
2
= 4
x
1
x
2
1, x
1
, x
2
0

Min: f
p
= x
1
4x
2
s.t. x
1
+ 2x
2
5
2x
1
+x
2
4
2x
1
x
2
4
x
1
+x
2
1, x
1
, x
2
0
Max: z
d
= 5y
1
4y
2
+ 4y
3
+y
4
s.t. y
1
+ 2y
2
2y
3
y
4
1
2y
1
+y
2
y
3
+y
4
4, y
1
, y
2
, y
3
, y
4
0
Chen CL 146
y
5
y
2
y
3
, unrestricted in sign
Equality primal constraint unrestricted dual variable
Unrestricted primal variable equality dual constraint
Theorem:
the dual of the dual problem is the primal problem
Chen CL 147
Primal Solution from Dual Solution
Theorem: Relation between primal and dual
Let x and y be in the constraint set (feasible points) of primal and
dual problems, respectively. Then the following relations hold:
z
d
(y) f
p
(x)
If z
d
= f
p
, then x and y are solutions for primal and dual
problems
If primal is unbounded, the corresponding dual is infeasible, and
vice versa
If primal is feasible and dual is infeasible, then primal is
unbounded and vice versa
Chen CL 148
a
11
y
1
+ +a
m1
y
m
c
1
x
1

a
1n
y
1
+ +a
mn
y
m
c
n
x
n

x
1
(a
11
y
1
+ +a
m1
y
m
) + +
x
n
(a
1n
y
1
+ +a
mn
y
m
) c
1
x
1
c
n
x
n

y
1
b
1
..
(a
11
x
1
+ +a
1n
x
n
) + +
y
m
(a
m1
x
1
+ +a
mn
x
n
)
. .
b
m
c
1
x
1
c
n
x
n

b
1
y
1
b
m
y
m
. .
z
d
: dual prot fcn
c
1
x
1
+ +c
n
x
n
. .
f
p
: primal cost fcn
z
d
f
p
x and y with f
p
= z
d
minimize f
p
while maximizing z
d
maximum dual prot fcn is also the minimum primal cost fcn
Chen CL 149
Theorem: Primal and dual solutions
Let both primal and dual have feasible points. Then both have
solution in x and y respectively and z
d
(y) = f
p
(x)
Theorem: Solution of primal from dual
If the ith dual constraint is a strict inequality at optimum, then the
corresponding ith primal variable is NB, i.e., it vanishes. Also,
if the ith dual variable is basic, then the ith primal constraint is
satised at equality.
If
m

i=1
a
ij
y
i
> c
j
then x
j
= 0
If y
i
> 0 then
n

j=1
a
ij
x
j
= b
i
Chen CL 150
Primal and Dual Solutions: Example
Minx: f
p
= 5x
1
+ 2x
2
(f

p
= 18)
s.t. 2x
1
+x
2
9
x
1
2x
2
2
3x
1
+ 2x
2
3, x
1
, x
2
0
Basic f
p
x
1
x
2
x
3
x
4
x
5
b b
i
/a
ic
x
2
0 0 1 0.2 0.4 0 1
x
1
0 1 0 0.4 0.2 0 4
x
5
0 0 0 0.8 1.4 1 13
f
p
1 0 0 1.6 1.8 0 18
Chen CL 151
Dual: Max: z
d
= 9y
1
2y
2
3y
3
s.t. 2y
1
+y
2
3y
3
5
y
1
2y
2
+ 2y
3
2

Max: z
d
= 9y
1
2y
2
3y
3
s.t. 2y
1
+y
2
3y
3
y
4
+y
6
= 5
y
1
+ 2y
2
2y
3
+y
5
= 2
y
4
: surplus, y
5
: slack, y
6
: articial
Chen CL 152
Basic z
d
w y
1
y
2
y
3
y
4
y
5
y
6
b b
i
/a
ic
y
6
0 0 2 1 3 1 0 1 5
5
2
y
5
0 0 1 2 2 0 1 0 2
z
d
1 0 9 2 3 0 0 0 0
w 0 1 2 1 3 1 0 0 5
y
1
0 0 1 0.5 1.5 0.5 0 0.5 2.5
2.5
0.5
y
5
0 0 0 2.5 3.5 0.5 1 0.5 4.5
4.5
2.5
z
d
1 0 0 2.5 16.5 4.5 0 4.5 22.5
w 0 1 0 0 0 0 0 1 0 I END
y
1
0 0 1 0 0.8 0.4 0.2 0.4 1.6
y
2
0 0 0 1 1.4 0.2 0.4 0.2 1.8
z
d
1 0 0 0 13 4 1 4 18 II END
BVs: y
1
= 1.6, y
2
= 1.8
NBs: y
3
= 0, y
4
= 0, y
5
= 0
Max: z

d
= 18 (= f

p
)
Chen CL 153
Note: y
1
, y
2
: basic 1st, 2nd primal constraints are active
2x
1
+x
2
= 9
x
1
2x
2
= 2
x
1
= 4, x
2
= 1
f
p
= 5x
1
+ 2x
2
= 18
Chen CL 154
Use of Dual Tableau to Recover Primal
Solution
Primal and Dual tables of previous example:
Basic f
p
x
1
x
2
x
3
x
4
x
5
b b
i
/a
ic
x
2
0 0 1 0.2 0.4 0 1
x
1
0 1 0 0.4 0.2 0 4
x
5
0 0 0 0.8 1.4 1 13
f
p
1 0 0 1.6 1.8 0 18
Basic z
d
w y
1
y
2
y
3
y
4
y
5
y
6
b b
i
/a
ic
y
1
0 0 1 0 0.8 0.4 0.2 0.4 1.6
y
2
0 0 0 1 1.4 0.2 0.4 0.2 1.8
z
d
1 0 0 0 13 4 1 4 18 II END
Chen CL 155
Some notes:
Elements in row of dual tableau match elements in last column
of primal tableau
Reduced cost coecients in nal primal tableau match the dual
variables
To recover primal variables from nal dual tableau, we use
reduced cost coecients in columns corresponding to slack or
surplus variables
Reduced cost coecient in column y
4
is precisely x
1
and that in
column y
5
is precisely x
2
Reduced prot coecients corresponding to slack and surplus
variables in nal dual tableau give values of primal variables
Chen CL 156
Theorem: recovery of primal solution from dual tableau
Let dual of the standard primal (min c
T
x s.t. Ax b) be solved
by standard Simplex method. Then value of ith primal variable
equals the reduced cost coecient of the slack or surplus variable
associated with the ith dual constraint in the nal dual tableau.
In addition, if a dual variable is nonbasic, then its reduced prot
coecient equals the value of slack or surplus variable for the
corresponding primal constraint.
Chen CL 157
Use of Final Primal Tableau to Recover
Dual Solution: Example
Min: f
p
= x
1
4x
2
s.t. x
1
+ 2x
2
5
2x
1
+x
2
= 4
x
1
x
2
1
x
1
, x
2
0
Min: f
p
= x
1
4x
2
s.t. x
1
+ 2x
2
+ x
3
= 5
2x
1
+ x
2
+ x
4
= 4
2x
1
+ x
2
x
5
+ x
7
= 4
x
1
x
2
x
6
+ x
8
= 1
Chen CL 158
Basic f
p
x
1
x
2
x
3
x
4
x
5
x
6
x
7
x
8
b b
i
/a
ic
x
3
0 0 0 1 1 0 1 0 1 2
x
5
0 0 0 0 1 1 0 1 0 0
x
2
0 0 1 0
1
3
0
2
3
0
2
3
2
3
x
1
0 1 0 0
1
3
0
1
3
0
1
3
5
3
f
p
1 0 0 0
5
3
0
7
3
0
7
3
13
3
slack: x
3
, x
4
surplus: x
5
, x
6
artif.: x
8
, x
7
BVs: x
1
=
5
3
, x
2
=
2
3
, x
3
= 2, x
5
= 0
NBs: x
4
= x
6
= x
7
= x
8
= 0
Min: f

p
=
13
3
Chen CL 159
y
1
= 0, for 1st constraint (reduced cost coe of x
3
, slack var.)
y
2
=
5
3
, for 2nd constraint (reduced cost coe of x
4
, slack var.)
y
3
= 0, for 3rd constraint (reduced cost coe of x
5
, surplus var.)
y
4
=
7
3
, for 4th constraint (reduced cost coe of x
6
, surplus var.)
dual variable for equality constraint 2x
1
+x
2
= 4 is y
2
y
3
=
5
3
y
4
=
7
3
is the dual variable for the 4th constraint written as
x
1
+x
2
1 and NOT for x
1
x
2
1
Chen CL 160
Use of Final Primal Tableau to Recover
Dual Solution: Example (2)
Min: f
p
= x
1
4x
2
s.t. x
1
+ 2x
2
5
2x
1
+x
2
= 4
x
1
x
2
1
x
1
, x
2
0
Min: f
p
= x
1
4x
2
s.t. x
1
+ 2x
2
+ x
3
= 5
2x
1
+ x
2
+ x
5
= 4
x
1
x
2
x
4
+ x
6
= 1
Chen CL 161
Basic f
p
w x
1
x
2
x
3
x
4
x
5
x
6
b b
i
/a
ic
x
3
0 0 1 2 1 0 0 0 5
5
1
x
5
0 0 2 1 0 0 1 0 4
4
2
x
6
0 0 1 1 0 1 0 1 1
1
1
f
p
1 0 1 4 0 0 0 0 0
w 0 1 3 0 0 1 0 0 5
x
3
0 0 0 3 1 1 0 1 4
4
3
x
5
0 0 0 3 0 2 1 2 2
2
3
x
1
0 0 1 1 0 1 0 1 1
f
p
1 0 0 5 0 1 0 1 1
w 0 1 0 3 0 2 0 3 2
x
3
0 0 0 0 1 1 1 1 2
x
2
0 0 0 1 0
2
3
1
3

2
3
2
3
x
1
0 0 1 0 0
1
3
1
3
1
3
5
3
f
p
1 0 0 0 0
7
3
5
3

7
3
13
3
w 0 1 0 0 0 0 1 1 0 Phase I,II END
Chen CL 162
slack: x
3
surplus: x
4
artif.: x
5
, x
6
BVs: x
1
=
5
3
, x
2
=
2
3
, x
3
= 2
NBs: x
4
= x
5
= x
6
= 0
Min: f

p
=
13
3
(same result)
y
1
= 0, for 1st constraint (reduced cost coe of x
3
, slack var.)
y
2
=
5
3
, for 2nd constraint (reduced cost coe of x
5
, artif var.)
y
3
=
7
3
, for 3rd constraint (reduced cost coe of x
4
, surplus var.)
Same result we do not have to replace an equality constraint by
two inequalities in standard Simplex method
Reduced cost coecient corresponding to the articial variable
associated with the equality constraint gives the value of dual
variable for the constraint
Chen CL 163
Dual Variables as Lagrange Multipliers
Theorem: Dual Variables as Lagrange Multipliers
Let x and y be optimal solutions for the primal and dual problems
mentioned above. Then dual variable y are also Lagrange
multipliers for primal constraints.
Proof:
y, v : Lagrange multipliers
L =
n

j=1
c
j
x
j
+
m

i=1
y
i
_
_
n

j=1
a
ij
x
j
b
i
_
_
+
n

j=1
v
j
x
j
= c
T
x +y
T
(Ax b) +v
T
x (a)
Chen CL 164
NC: c
j
+
m

i=1
y
i
a
ij
+v
j
= 0 j = 1 n (b)
y
i
_
_
n

j=1
a
ij
x
j
b
i
_
_
= 0 i = 1 m (c)
v
j
x
j
= 0 x
j
0 j = 1 n (d)
y
i
0 i = 1 m (e)
v
j
0 j = 1 n (f)
(b) c
j
+
m

i=1
y
i
a
ij
= v
j

i=1
y
i
a
ij
c
j
(g)
y
j
s are feasible soln for dual constraints
Chen CL 165
(g) v
j
> 0, x
j
= 0,
m

i=1
a
ij
y
i
c
j
(h)
v
j
= 0, x
j
> 0,
m

i=1
a
ij
y
i
= c
j
(i)
(c)
n

j=1
x
j
m

i=1
a
ij
y
i
=
m

i=1
y
i
b
i
(j)
(h, i, j)
m

i=1
y
i
(b
i
)
. .
z
d
=
n

j=1
x
j
_

i=1
a
ij
y
i
_
. .
c
j

j=1
c
j
x
j
. .
f
p
(k)
x and y are feasible points for primal and dual problems, and
primal and dual functions have the same values
optimum solutions for the respective problems
the Lagrange multipliers y solve the dual problem
Chen CL 166
Post-Optimality Analysis
Sensitivity Analysis:
the study of discrete parameter changes
Changes in the cost function coecients, c
j
Changes in the resource limits, b
i
Changes in the constraint coecients, a
ij
The eect of including additional constraints
The eect of including additional variables
Chen CL 167
Changes in Resource Limits
Theorem: Lagrange Multiplier Values
In the nal tableau, the Lagrange multiplier for the ith constraint
equals the reduced cost coecient in the slack or articial
variable column associated with the ith constraint
For a minimization problem with type or equality constraints
e
i
: RHS parameter, y
i
: Lagrange multiplier

z
e
i
= y
i
0
Chen CL 168
Recovery of Lagrange Multipliers from Final Tableau
Max: z = 5x
1
2x
2
(= f)
s.t. 2x
1
+x
2
9
x
1
2x
2
2
3x
1
+ 2x
2
3
x
1
, x
2
0

BV: x
1
= 4, x
2
= 1, x
5
= 13
NB: x
3
= 0, x
4
= 0
z

= 18
Chen CL 169
Basic z x
1
x
2
x
3
x
4
x
5
b b
i
/a
ic
x
3
0 2 1 1 0 0 9
9
2
x
4
0 1 2 0 1 0 2
6
3
x
5
0 3 2 0 0 1 3
z 1 5 2 0 0 0 0
x
3
0 0 5 1 2 0 5
5
5
x
1
0 1 2 0 1 0 2
x
5
0 0 4 0 3 1 9
z 1 0 8 0 5 0 10
x
2
0 0 1 0.2 0.4 0 1
x
1
0 1 0 0.4 0.2 0 4
x
5
0 0 0 0.8 1.4 1 13
z 1 0 0 1.6 1.8 0 18
c

1
c

2
c

3
c

4
c

5
Chen CL 170
1st constraint y
1
= 1.6 (c

3
in slack variable col x
3
)
2nd constraint y
2
= 1.8 (c

4
in slack variable col x
4
)
3rd constraint y
3
= 0 (c

5
in slack variable col x
5
)

z
e
1
= 1.6
z
e
2
= 1.8
z
e
3
= 0
If e
1
: 910 z : 1818 + (1.6) (1) = 19.6 (F)
Chen CL 171
Recovery of Lagrange Multipliers from Final Tableau
Max: z = x
1
+ 4x
2
(= f)
s.t. x
1
+ 2x
2
5
2x
1
+x
2
= 4
x
1
x
2
1
x
1
, x
2
0

Max: z = x
1
+ 4x
2
s.t. x
1
+ 2x
2
+ x
3
= 5
2x
1
+ x
2
+ x
5
= 4
x
1
x
2
x
4
+ x
6
= 1
x
i
0
Chen CL 172
?? ??
BV: x
1
=
5
3
, x
2
=
2
3
, x
3
= 2
NB: x
4
= 0, x
5
= 0, x
6
= 0
z

=
13
3
Chen CL 173
Basic z w x
1
x
2
x
3
x
4
x
5
x
6
b b
i
/a
ic
x
3
0 0 1 2 1 0 0 0 5
5
1
x
5
0 0 2 1 0 0 1 0 4
4
2
x
6
0 0 1 1 0 1 0 1 1
1
1
z 1 0 1 4 0 0 0 0 0
w 0 1 3 0 0 1 0 0 5
x
3
0 0 0 3 1 1 0 1 4
4
3
x
5
0 0 0 3 0 2 1 2 2
2
3
x
1
0 0 1 1 0 1 0 1 1
z 1 0 0 5 0 1 0 1 1
w 0 1 0 3 0 2 0 3 2
x
3
0 0 0 0 1 1 1 1 2
x
2
0 0 0 1 0
2
3
1
3

2
3
2
3
x
1
0 0 1 0 0
1
3
1
3
1
3
5
3
z 1 0 0 0 0
7
3
5
3

7
3
13
3
w 0 1 0 0 0 0 1 1 0 I,II END
Chen CL 174
1st constraint ( 5) y
1
= 0 (c

3
in slack var col x
3
)
2nd constraint ( = 4) y
2
=
5
3
(c

5
in art var col x
5
)
3rd constraint ( 1) y
3
=
7
3
(c

6
in art var col x
6
)
or 3rd constraint ( 1) y
3
=
7
3

z
e
1
= 0
z
e
2
=
5
3
z
e
3
=
7
3
If e
2
: 5 4 z :
13
3

13
3
+ (
5
3
) (1) = 6
If e
3
: 1 2 z :
13
3

13
3
+ (
7
3
) (1) = 2
Chen CL 175
Ranging Right-hand Side Parameters
When RHS of a constraint is changed
constrained boundary moves parallel to itself
changing feasible region
(iso-cost lines do not change)
If the changes are within a certain range, the sets of basic and
nonbasic variables do not change
Limits on changes in resources
Let
k
be possible change in RHS b
k
of kth constraint. If
k
satises the following inequalities, then no more iterations of the
Simplex method are required to obtain solution for the altered
problem
max
i
_

i
a
ij
; a

ij
> 0
_

i
min
i
_

i
a
ij
; a

ij
< 0
_
i = 1 m
Chen CL 176
b

i
: RHS parameter for ith constraint in nal tableau
a

ij
: parameters in jth column of nal tableau;
the jth column corresponds to x
j
which is the slack variable for
a type constraint,
or the articial variable for an equality constraint, or type
constraint

k
: possible change in RHS of kth constraint;
the slack or the articial variable for kth constraint determines
index j of the column whose elements are used in the above
inequalities
Note: new RHS parameters b
i
due to a change of
k
in b
k
b
i
= b

i
+
k
a

ij
i = 1 m
Chen CL 177
Ranges for Resource Limits: type
Max: z = 5x
1
2x
2
(= f)
s.t. 2x
1
+x
2
9
x
1
2x
2
2
3x
1
+ 2x
2
3, x
1
, x
2
0

Max: z = 5x
1
2x
2
s.t. 2x
1
+ x
2
+ x
3
= 9
x
1
2x
2
+ x
4
= 2
3x
1
+ 2x
2
+ x
5
= 3, x
i
0
Chen CL 178
Chen CL 179
Basic z x
1
x
2
x
3
x
4
x
5
b b
i
/a
ic
x
2
0 0 1 0.2 0.4 0 1
x
1
0 1 0 0.4 0.2 0 4
x
5
0 0 0 0.8 1.4 1 13
z 1 0 0 1.6 1.8 0 18
For 1st constraint, x
3
is the slack variable
j for
1
is x
3
(the third column)
No negative element in 3rd column
no upper limit on
1
Chen CL 180
max
_

1
0.2
,
4
0.4
,
13
0.8
_

1

5
1

4 b
1

max
_

4
0.2
,
13
1.4
_

2
min
_

1
0.4
_
9.286
2
2.5
7.286 b
2
4.5
max
_

13
1
_

3

13
3

10 b
1

Chen CL 181
New values for design variables if 2x
1
+x
2
910 (
1
= 1)
x
2
= b
1
= b

1
+
1
a

13
= 1 + (1)(0.2) = 1.2
x
1
= b
2
= b

2
+
1
a

23
= 4 + (1)(0.4) = 4.4
x
5
= b
3
= b

3
+
1
a

33
= 13 + (1)(0.8) = 13.8 (F)
Note: other variables remain nonbasic (= 0)
Chen CL 182
New values for design variables if x
1
2x
2
23 (
2
= 1)
x
2
= b
1
= b

1
+
2
a

14
= 1 + (1)(0.4) = 0.6
x
1
= b
2
= b

2
+
2
a

24
= 4 + (1)(0.2) = 4.2
x
5
= b
3
= b

3
+
2
a

34
= 13 + (1)(1.4) = 14.4 (G)
Chen CL 183
New values for design variables if
1
= 1 and
2
= 1:
x
2
= b
1
= b

1
+
1
a

13
+
2
a

14
= 1 + (1)(0.2) + (1)(0.4) = 0.8
x
1
= b
2
= b

2
+
1
a

23
+
2
a

24
= 4 + (1)(0.4) + (1)(0.2) = 4.6
x
5
= b
3
= b

3
+
1
a

33
+
2
a

34
= 13 + (1)(0.8) + (1)(1.4) = 15.2 (H)
Chen CL 184
Ranges for Resource Limits: =, type
Max: z = x
1
+ 4x
2
s.t. x
1
+ 2x
2
5
2x
1
+x
2
= 4
x
1
x
2
1, x
1
, x
2
0
Chen CL 185
Basic z x
1
x
2
x
3
x
4
x
5
x
6
b b
i
/a
ic
x
3
0 0 0 1 1 1 1 2
x
2
0 0 1 0
2
3
1
3

2
3
2
3
x
1
0 1 0 0
1
3
1
3
1
3
5
3
z 1 0 0 0
7
3
5
3

7
3
13
3
x
3
: slack (1st constraint), x
4
: surplus (3rd)
x
5
, x
6
: articial variables (2nd and 3rd constraints)
Chen CL 186
2
1
(j = 3)
3 b
1

max
_

2/3
1/3
,
5/3
1/3
_

2
min
_

2
1
_
(j = 5)
2 b
2
6
max
_

2
1
,
5/3
1/3
_

3
min
_

2/3
2/3
_
(j = 6)
1 b
3
2
Chen CL 187
New solution if 2x
1
+x
2
= 45
x
3
= b
1
= b

1
+
2
a

15
= 2 + (1)(1) = 1
x
2
= b
2
= b

2
+
2
a

25
=
2
3
+ (1)(
1
3
) = 1
x
1
= b
3
= b

3
+
2
a

35
=
5
3
+ (1)(
1
3
) = 2
Chen CL 188
New solution if x
1
x
2
12
x
3
= b
1
= b

1
+
3
a

16
= 2 + (1)(1) = 3
x
2
= b
2
= b

2
+
3
a

26
=
2
3
+ (1)(
2
3
) = 0
x
1
= b
3
= b

3
+
3
a

36
=
5
3
+ (1)(
1
3
) = 2 (C)
Chen CL 189
Ranging cost Coecients
c
k
c
k
+ c
k
: admissible range on c
k
such that the optimum
design variables are not changed
Limits on change c
k
depend on whether or not x
k
is a basic
variable at optimum
Note: feasible region for the problem does not change
Chen CL 190
Theorem: range for cost coecient of NBs
Let c
k
be such that x
k
is not a basic variable.
If c
k
c
k
+ c
k
, c

k
c
k
,
then the optimum solution (design variables and cost function)
does not change
(c

k
is the cost coecient corresponding to x
k
in nal tableau)
Chen CL 191
Theorem: range for cost coecient of BVs
Let c
k
be such that x

k
is a basic variable and x

k
= b

r
.
Then the range on change c
k
in c
k
for which the optimum design
variables do not change is given as
max
j
_
c

j
a

rj
; a

rj
< 0
_
c
k
min
j
_
c

j
a

rj
; a

rj
> 0
_
The new cost function is f

+ c
k
x

k
a

rj
: element in rth row and jth column of nal tableau.
Index r is determined by the row that determines x

k
Index j corresponds to each of the nonbasic columns excluding
articial columns
if no a

rj
> 0 no upper limit,
if no a

rj
< 0 no lower limit
c

j
: reduced cost coecient
Chen CL 192
Ranges for Resource Limits: type
Max: z = 5x
1
2x
2
(= f)
s.t. 2x
1
+x
2
9
x
1
2x
2
2
3x
1
+ 2x
2
3, x
1
, x
2
0
Basic z x
1
x
2
x
3
x
4
x
5
b b
i
/a
ic
x
2
0 0 1 0.2 0.4 0 1
x
1
0 1 0 0.4 0.2 0 4
x
5
0 0 0 0.8 1.4 1 13
z 1 0 0 1.6 1.8 0 18
c

1
c

2
c

3
c

4
c

5
Chen CL 193
Max: z = 5x
1
2x
2
(c
1
= 5, c
2
= 2)
2nd row determines BV x
1
r = 2
3rd, 4th columns are NBs j = 3, 4
c
1
min
_
1.6
0.4
,
1.8
0.2
_
= 4
c
1
1
z

new
= z

+ c
1
x

1
(c
1
= 54)
= 18 + (1)(4) = 14
Chen CL 194
1rd row determines BV x
2
r = 1
3rd, 4th columns are NBs j = 3, 4
max
_
1.8
0.4
_
= 4.5 c
2
min
_
1.6
0.2
_
= 8
2.5 c
2
10
z

new
= z

+ c
2
x

2
(c
2
= 23)
= 18 + (1)(1) = 17
Chen CL 195
Ranges for Resource Limits: =, type
Max: z = x
1
+ 4x
2
s.t. x
1
+ 2x
2
5
2x
1
+x
2
= 4
x
1
x
2
1, x
1
, x
2
0
Basic z x
1
x
2
x
3
x
4
x
5
x
6
b b
i
/a
ic
x
3
0 0 0 1 1 1 1 2
x
2
0 0 1 0
2
3
1
3

2
3
2
3
x
1
0 1 0 0
1
3
1
3
1
3
5
3
z 1 0 0 0
7
3
5
3

7
3
13
3
c

1
c

2
c

3
c

4
c

5
c

6
Chen CL 196
3rd row determines x
1
as a basic (r = 3, j = 4)
max
_
7/3
1/3
_
= 7 c
1

8 c
1

z

new
= z

+ c
1
x

1
(c
1
= 12)
=
13
3
+ (1)(
5
3
) = 6
2nd row determines x
2
as a basic (r = 2, j = 4)
c
2
3.5
c
2
0.5
z

new
= z

+ c
2
x

2
(c
2
= 43)
=
13
3
+ (1)(
2
3
) =
11
3
Chen CL 197
Changes in the Coecient Matrix
a
ij
a
ij
+ a
ij
feasible region changes
Q: nd z

new
with minor computations
Case 1: when the change is associated with a nonbasic variable
Case 2: when the change is associated with a basic variable
Theorem: change associated with a NB
Let j in a
ij
be such that x
j
is not a BV, and k be the column index for the
slack or articial variable associated with the ith row.
Dene a vector
c
B
=
_
c
B1
c
B2
c
Bm
_
T
where c
Bi
= c
j
if x

j
= b

i
, i = 1 m (index i corresponds to ith row that
determines optimum value of variable x
j
). Also dene a scalar
R =
m

r=1
c
Br
a

rk
Chen CL 198
With this notation, if a
ij
satises the following inequalities

ij
_

j
R

j
R


_

_
when R
_

_
<
>

_
0
then the optimum solution (design variables and cost function) do not change
when a
ij
a
ij
+ a
ij
.
Also, if R = 0, then the solution does not change for any value of a
ij
Note: re-solve the problem if the inequalities are not satised
Chen CL 199
Theorem: change associated with a BV
Let j in a
ij
be such that x
j
is a BV and let x

j
= b

t
(t is the row index
determining optimum value of x
j
). Let index k and scalar R be dened as in
previous Theorem. Let a
ij
satisfy the following inequalities:
max
r=t
_
b

r
A
r
, A
r
< 0
_
a
ij
min
r=t
_
b

r
A
r
, A
r
> 0
_
with A
r
= b

t
a

rk
b

r
a

tk
, r = 1 m; r = t, and
max
q
_

q
B
q
, B
q
> 0
_
a
ij
min
r=t
_

q
B
q
, B
q
< 0
_
with B
q
= c

q
a

tk
+a

iq
R for all q not in the basis, and
1 +a

tk
a
ij
> 0
The upper and lower limits on a
ij
do not exist if the corresponding
denominators do not exist. If a
ij
satises the above inequalities, then the
optimum solution of the changed problem can be obtained without any further
iterations of the Simplex method.
Chen CL 200
Homework
1. Solve the LP problems and verify the solutions graphically
(1) Max: z = x
1
+ 4x
2
s.t. x
1
+ 2x
2
5
x
1
+x
2
= 4
x
1
x
2
3
x
1
, x
2
0
(2) Max: z = 4x
1
+ 2x
2
s.t. 2x
1
+x
2
4
x
1
+ 2x
2
2
x
1
, x
2
0
Chen CL 201
2. A manufacturer sells products A and B. Prot from A is $10/kg
and from B 8$/kg. Available raw materials for the products are:
100 kg of C and 80 kg of D. To produce 1 kg of A, 0.4 kg of C
and 0.6 kg of D are needed. To produce 1 kg of B, 0.5 kg of C
and 0.5 kg of D are needed. The market for the products is 70 kg
for A and 110 kg for B.
(a) How much A and B should be produced to maximize prot ?
(b) What are the eects of the following changes ?
i. Supply of material C increases to 120 kg.
ii. Supply of material D increases to 100 kg.
iii. Market for product A decreases to 60 kg.
iv. Prot for A reduces to $8/kg.
Verify your solutions graphically.

You might also like