APS 502 LP Models
APS 502 LP Models
APS 502 LP Models
Banana 1 51 2
Chocolate 12 22 2
Diet Problem: Cost of Food Items
Food Item $/serving
Banana .10
Chocolate .15
Nutritional Requirements
Suppose it is decided by a dietician that you need at
least 35 grams of fat, at least 130 grams of
carbohydrate, and at least 76 grams of protein daily.
What is the least cost combination of the food items so
that the nutritional requirements are satisfied?
This problem can be formulated as a linear program.
Problem structure
The problem has the following structure
(1) there is an objective i.e. minimize cost of food items
used
(2) there are constraints i.e. food items must satisfy
nutritional requirements
Both of these constructs can be modelled
mathematically through linear expressions in which
case the problem is a linear program.
Problem Structure
xpb , xb , xc ≥ 0
Diet Problem Linear Program
Putting together all of the parts the linear program
can now be written as follows:
am1 x1 + am 2 x2 + + amn xn bm
x1 , x2 , , xn 0
Embedded Assumptions
Proportionality
Divisibility
Additivity
Certainty
Proportionality
Proportionality means that the contribution towards
the objective function and constraints of decisions are
directly proportional to its values e.g. there are no
economies of scale such as quantity based discounts.
All bonds have face value of a $100 and the coupons are annual
(with one coupon per year).
For example, one unit of Bond 2 costs $99 now and the holder will
receive $3.5 after 1 year and then $3.5 plus the face value of $100 at
the end of the second year which is the maturity of Bond 2.
Decision Variables
Let the xi = amount of bond i purchased.
x1
Then, x = x2 is the bond portfolio.
x3
Bond Portfolio Optimization
(1) The objective is to minimize the cost of a
portfolio
subject to u x = R
n
i =1 i i
x =1
n
i =1 i
xi 0, i = 1, ,n
The objective is to minimize the risk of portfolio subject to
meeting an expected goal R and ensuring the budget is
exhausted.
However the model is non-linear because of quadratic term
in objective function and there are n(n-1)/2 covariance
terms to estimate.
Application: Portfolio Optimization
Konno and Yamazaki (1991) use the absolute deviation
of the portfolio return instead of standard deviation,
and construct Mean-Absolute Deviation (MAD) model.
1 T
i =1 ( ri − ui ) xi ( rit − ui ) xi
n n
minimize E =
T t =1 i =1
n
subject to ux =R
i =1 i i
n
i =1 i
x =1
xi 0, i = 1, ,n
subject to ( r − u ) x
n
i =1 it i i = st − yt , t = 1, ,T
ux =R
n
i =1 i i
x =1
n
i =1 i
xi 0, i = 1, ,n
st 0, yt 0, t = 1, ,T
Solving LP by MATLAB
The function linprog in MATLAB can be used to solve
the following standard LP:
minimize f T x
subject to Ax b inequality constraint
Aeqx = beq equality constraint
lb x ub lower and upper bound
x=
15.0000
0.0000
0.0000
fval =
- 45.0000
Example 2
f = −3, −5, −3 ' ;
minimize − 3 x1 − 5 x2 − 3 x3 1, −1,1 15
A= ; b = 30 ;
subject to x1 − x2 + x3 15 Matlab 2,3, 6
2 x1 + 3 x2 + 6 x3 30 code Aeq = ; beq = ;
0 x1 lb = 0, 0, 0 ' ;
0 x2
[x, fval ] =
0 x3
linprog(f , A, b, Aeq, beq, lb);
x=
0.0000
10.0000
0.0000
fval =
- 50.0000