Lec 2
Lec 2
Session 2
Questions?
Linear Functions
• Is f = xy + yz a linear function?
• f(x,z) = xy + yz?
• f(y) = xy + yz?
• f(x,y) = xy + yz?
LP or LPP Formulation, in general
• Decision variables
• Objective function
• Constraints
LP Assumptions
• Proportionality
➢ E.g. z = 4x + … .
➢ That is, 1 unit increase in x results in 4 units increase in z.
• Additivity
➢ If the above z is also proportional to y, where 1 unit increase in y
results in 3 units increase in z as well, then
➢ z = 4x + 3y
• Certainty
➢ Coefficients are deterministic
The beginning times for the shifts are 8AM, noon, 4PM,
8PM, midnight and 4AM.
8:00AM – Noon 5
Noon – 4:00PM 6
4:00PM – 8:00PM 10
8:00PM – Midnight 7
Midnight – 4:00AM 4
4:00AM – 8:00AM 6
That is:
min z = x1 + x2 + x3 + x4 + x5 + x6
Constraints
8:00AM – Noon 5
Noon – 4:00PM 6
4:00PM – 8:00PM 10
8:00PM – Midnight 7
Midnight – 4:00AM 4
4:00AM – 8:00AM 6
Constraints
Each shift must have at least the minimum number of
officers
• x6+x1 ≥ 5
• x1+x2 ≥ 6
• x2+x3 ≥ 10
• x3+x4 ≥ 7
• x4+x5 ≥ 4
• x5+x6 ≥ 6
Non-negativity constraints:
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0, x6 ≥ 0
Integer constraints:
x1 , x2 , x3 , x4 , x5 and x6 are integers
LP Formulation
DVs: x1 , x2 , x3 , x4 , x5 , x6
= The number of officers who begin work at 8AM, Noon,
4PM, 8PM, Midnight and 4AM, respectively.
min z = x1 + x2 + x3 + x4 + x5 + x6
s.t.
x6+x1 ≥ 5
x1+x2 ≥ 6
x2+x3 ≥ 10
x3+x4 ≥ 7
x4+x5 ≥ 4
x5+x6 ≥ 6
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, x5 ≥ 0, x6 ≥ 0; all xi int
Example 4: Investment Problem
respectively.
Objective
• Maximize the total after tax returns.
• That is:
max z =
0.043 xA + 0.027 xB + 0.025 xC + 0.022 xD + 0.045 xE
Bond name Bond type Quality Years to Yield to After-tax
maturity maturity yield
A Municipal 2 9 4.3 4.3
B Agency 2 15 5.4 2.7
C Government 1 4 5.0 2.5
D Government 1 3 4.4 2.2
E Municipal 5 2 4.5 4.5
Constraints
1. Government and agency bonds must total at
least $4 million.
xB + xC + x D 4
Bond name Bond type Quality Years to Yield to After-tax
maturity maturity yield
A Municipal 2 9 4.3 4.3
B Agency 2 15 5.4 2.7
C Government 1 4 5.0 2.5
D Government 1 3 4.4 2.2
E Municipal 5 2 4.5 4.5
The average quality of the portfolio
cannot exceed 1.4
2 xA + 2 xB + xC + xD + 5 xE
gives the “total” quality (points).
Average is
(2xA + 2xB + xC + xD + 5xE)/(xA + xB + xC + xD + xE ).
5
Anything else?
xA + xB + x C + xD + xE
10
Non-negativity
xA , xB , xC , xD , xE 0
Example 5
• A product is assembled with 4 units of component A
and 3 units of component B.
RM I RM II A B
I 7 5 6 4
II 4 8 5 8
III 2 7 7 3
Formulate as an LP to maximize the number of
completed assemblies produced each day.
Decision Variables
RM I RM II A B
I 7 5 6 4
II 4 8 5 8
III 2 7 7 3
Constraints
• x1, x2, x3 ≥ 0
Objective Function?
100 units of raw material I (RM I) and 200 units
of raw material II (RM II) are available to the
shop each day.
RM I RM II A B
I 7 5 6 4
II 4 8 5 8
III 2 7 7 3
“A product is
assembled with
4 units of
• Total quantity of A produced component A
= 6x1 + 5x2 + 7x3 and 3 units of
component B”.
Linear?
If you are in his/ her position, what will your aim be?