Modeling
Modeling
Fall 2024
3/68
4/68
Assumptions of Linear Programming
Proportionality
Additivity
Divisibility
Certainty
5/68
Proportionality Assumption
The contribution of each activity to the objective
function is proportional to the level of the activity.
The contribution of each activity to the left-hand side of
each functional constraint is proportional to the level of
the activity.
In other words:
◼ The objective function term for activity j is of the form 𝑐𝑗 𝑥𝑗
◼ The constraint terms for activity j are of the form 𝑎𝑖𝑗 𝑥𝑗
◼ No exponents other than 1!
6/68
Proportionality Assumption
Z=3𝑥𝑗
7/68
Start-Up Costs Violate Proportionality
3𝑥𝑗 − 1 𝑖𝑓 𝑥𝑗 > 0
Z=൝
0 𝑖𝑓 𝑥𝑗 = 0
8/68
Increasing Marginal Profits Violate Proportionality
1.5
Z=3𝑥𝑗
9/68
Decreasing Marginal Profits Violate Proportionality
10/68
Quantity Discounts Violate Proportionality
11/68
Is Proportionality a Reasonable Assumption?
Often real-life problems violate proportionality in
one or more of these ways.
But it’s often reasonable to assume proportionality
even if it’s violated.
There are ways of handling some forms of non-
proportionality.
Otherwise, use mixed-integer programming or
non-linear programming
12/68
Additivity Assumption
Every function (objective function or left-hand
side of constraints) is the sum of the individual
contributions of the respective activities.
In other words:
◼ The variables in the objective functions and
constraints are added together,
◼ never multiplied.
◼ For example, no terms like 5𝑥1 𝑥2 .
13/68
Non-Additive Objective Function
Suppose the objective function for the Wyndor
Glass problem were:
Z = 𝑥1 + 5𝑥1 𝑥2
14/68
Divisibility Assumption
The decision variables are allowed to take on any values
that satisfy the functional and non-negativity constraints.
In other words:
The values of the decision variables may be fractional.
15/68
Certainty Assumption
The value assigned to each parameter is a known
constant.
In other words:
◼ All of the parameters 𝑐𝑗 , 𝑏𝑖 , and 𝑎𝑖𝑗 are known with
certainty.
16/68
LP Problems
Diet Problem
Workforce scheduling Problems
Blending Problems
Production process problems
Inventory models
Budget Planning problems
17/68
Diet Problem
My diet requires that all the food I eat come from one of the four
“basic food groups” (chocolate cake, ice cream, soda, and
cheesecake). At present, the following four foods are available for
consumption: brownies, chocolate ice cream, cola, and pineapple
cheesecake. Each brownie costs 50¢, each scoop of chocolate ice
cream costs 20¢, each bottle of cola costs 30¢, and each piece of
pineapple cheesecake costs 80¢. Each day, I must ingest at least
500 calories, 60 oz of chocolate, 100 oz of sugar, and 80 oz of fat.
The nutritional content per unit of each food is shown in Table
below. Formulate a linear programming model that can be used to
satisfy my daily nutritional requirements at minimum cost.
18/68
Diet Problem
Brownie 400 30 20 20
Chocolate ice
200 20 20 40
cream
Cola 150 0 40 10
Pineapple
500 0 40 50
cheesecake
19/68
Elements of Optimization Problem
Decision Variables:
◼ x1 = number of brownies eaten daily
◼ x2 = number of scoops of chocolate ice cream eaten
daily (scoop)
◼ x3 = bottles of cola drunk daily
◼ x4 = pieces of pineapple cheesecake eaten daily
Objective Function
◼ Minimize the total cost of my diet
◼ What is the total cost?
◼ Total cos is a function of decision variables
Constraints 20/68
Data
Type of Chocolate Sugar(oz) Fat(oz)
Calories Cost
Food (oz)
Brownie 400 30 20 20 50
Chocolate
200 20 20 40 2
ice cream
Cola 150 0 40 10 3
Pineapple
500 0 40 50 8
cheesecake
Required
500 60 100 80
Amount
21/68
Objective Function
22/68
Constraints
Minimum required calories, chocolate, sugar and fat
amount:
◼ Minimum calories:
400x1 + 200x2 + 150x3+ 500x4 ≥500
◼ Minimum chocolate :
30x1 + 20x2 ≥ 60
◼ Minimum sugar :
20x1 + 20x2 + 40x3+ 40x4 ≥100
◼ Minimum fat:
20x1 + 40x2 + 10x3+ 50x4 ≥80
◼ Nonnegativity
xj ≥0
23/68
Mathematical Model
Min Z= 0.5x1+ 0.2x2+ 0.3x3+ 0.8x4
400x1 + 200x2 + 150x3+ 500x4 ≥500
30x1 + 20x2 ≥ 60
20x1 + 20x2 + 40x3+ 40x4≥100
20x1 + 40x2 + 60x3+ 50x4≥80
xj ≥0 (j=1, 2, 3, 4)
or
4
min 𝑍 = 𝑐𝑗 𝑥𝑗
𝑗=1
4
𝑎𝑖𝑗 𝑥𝑗 ≥ 𝑏𝑖 𝑓𝑜𝑟 𝑖 = 1,2,3,4
𝑗=1
xj ≥0 (j=1, 2, 3, 4)
24/68
Work-Scheduling Problem
A post office requires different numbers of full-time employees on different days of the
week. The number of full-time employees required on each day is given in Table below.
Union rules state that each full-time employee must work five consecutive days and then
receive two days off. For example, an employee who works Monday to Friday must be
off on Saturday and Sunday. The post office wants to meet its daily requirements using
only fulltime employees. Formulate an LP that the post office can use to minimize the
number of full-time employees who must be hired.
25/68
min 𝑧 = 𝑥1 + 𝑥2 + 𝑥3 + 𝑥4 + 𝑥5 + 𝑥6 + 𝑥7
𝑠. 𝑡. 𝑥1 ≥ 17
𝑥2 ≥ 13
𝑥3 ≥ 15
𝑥4 ≥ 19
𝑥5 ≥ 14
𝑥6 ≥ 16
𝑥7 ≥ 11
𝑥𝑖 ≥ 0 (𝑖 = 1,2, … , 7)
26/68
27/68
Budget Planning Problem
Star Oil Company is considering five different investment opportunities.
The cash out- flows and net present values (in millions of dollars) are
given in Table below. Star Oil has $40 million available for investment
now (time 0); it estimates that one year from now (time 1) $20 million
will be available for investment. Star Oil may purchase any fraction of
each investment. In this case, the cash outflows and NPV are adjusted
accordingly. Star Oil wants to maximize the NPV that can be obtained by
investing in investments 1–5. Formulate an LP that will help achieve this
goal. Assume that any funds left over at time 0 cannot be used at time 1.
Investments
1 2 3 4 5
Year 0 11 53 5 5 29
Year 1 3 6 5 1 34
NPV 13 16 16 14 39
28/68
Budget Planning Problem
Decision variables:
𝑥𝑖 = 𝑓𝑟𝑎𝑐𝑡𝑖𝑜𝑛 𝑜𝑓 𝑖𝑛𝑣𝑒𝑠𝑡𝑚𝑒𝑛𝑡 𝑖 𝑝𝑢𝑟𝑐ℎ𝑎𝑠𝑒𝑑 𝑏𝑦 𝑆𝑡𝑎𝑟 𝑂𝑖𝑙
29/68
Budget Planning Problem
Constraints:
◼ Star cannot invest more than $40 million at time 0.
◼ Star cannot invest more than $20 million at time 1.
◼ Star cannot purchase more than 100% of investment i
30/68
Blending Problems
Sunco Oil manufactures three types of gasoline (gas 1, gas 2, and gas 3). Each
type is produced by blending three types of crude oil (crude 1, crude 2, and crude
3). Sunco can purchase up to 5,000 barrels of each type of crude oil daily. The
sales price per barrel of gasoline and the purchase price per barrel of crude oil are
given in Table below. The three types of gasoline differ in their octane rating and
sulfur content, and they must satisfy required standards:
◼ Gas 1 must have an average octane rating of at least 10 and contain at most 1% sulfur
◼ Gas 2 must have an average octane rating of at least 8 and contain at most 2% sulfur
◼ Gas 3 must have an average octane rating of at least 6 and contain at most 1% sulfur
It costs $4 to transform one barrel of oil into one barrel of gasoline, and Sunco’s
refinery can produce up to 14,000 barrels of gasoline daily.
Sunco’s customers require : gas 1-3,000 barrels per day; gas 2-2,000 barrels per
day; gas 3-1,000 barrels per day (at most)
Sunco also has the option of advertising to stimulate demand for its products. Each
dollar spent daily in advertising a particular type of gas increases the daily demand
for that type of gas by 10 barrels.
Formulate an LP that will enable Sunco to maximize daily profits
31/68
Blending Problems
Crude Octane sulfur(%) Purchase Price
($/barrel)
1 12 0.5 45
2 6 2 35
3 8 3 25
32/68
Blending Problems
Decisions to make?
◼ How much money should be spent in advertising each
type of gas
◼ How to blend each type of gasoline from the three
types of crude oil available.
◼ yi= dollars spent daily on advertising gas i (i =1, 2, 3)
◼ xij = barrels of crude oil i used daily to produce gas j
(i= 1, 2, 3; j =1, 2, 3)
33/68
Blending Problems
Objective Function:
◼ Maximizing daily net profit
◼ Daily profit = daily revenue from gas sales
- daily cost of purchasing crude oil
- daily advertising costs
- daily production costs
34/68
Blending Problems
Daily revenue from gas sales
= 70 𝑥11 + 𝑥21 + 𝑥31 + 60 𝑥12 + 𝑥22 + 𝑥32 + 50(𝑥13 + 𝑥23 + 𝑥33 )
Daily cost of purchasing crude oil:
= 45 𝑥11 + 𝑥12 + 𝑥13 + 35 𝑥21 + 𝑥22 + 𝑥23 + 25 𝑥31 + 𝑥32 + 𝑥33
Daily advertising costs :
= 𝑦1 +𝑦2 + 𝑦3
Daily production costs:
= 4(𝑥11 + 𝑥12 + 𝑥13 + 𝑥12 + 𝑥22 + 𝑥23 + 𝑥31 + 𝑥32 + 𝑥33 )
Objective: Maximize
𝑍 = 2𝑥11 + 11𝑥12 + 𝑥13 + 31𝑥12 + 21𝑥22 + 11𝑥23 + 41𝑥31
+31𝑥32 + 21𝑥33 − 𝑦1 − 𝑦2 − 𝑦3
35/68
Blending Problems
Constraint 1: Gas 1 produced daily should equal its daily demand.
𝑥11 + 𝑥21 + 𝑥31 − 10𝑦1 = 3000
Constraint 2 :Gas 2 produced daily should equal its daily demand.
𝑥12 + 𝑥22 + 𝑥32 − 10𝑦2 = 2000
Constraint 3 :Gas 3 produced daily should equal its daily demand.
𝑥13 + 𝑥23 + 𝑥33 − 10𝑦3 = 1000
Constraint 4 :At most 5,000 barrels of crude 1 can be purchased daily.
𝑥11 + 𝑥12 + 𝑥13 ≤ 5000
Constraint 5 :At most 5,000 barrels of crude 2 can be purchased daily.
𝑥21 + 𝑥22 + 𝑥23 ≤ 5000
Constraint 6 :At most 5,000 barrels of crude 3 can be purchased daily.
𝑥31 + 𝑥32 + 𝑥33 ≤ 5000
Constraint 7: At most 14,000 barrels of gasoline can be produced daily.
𝑥11 + 𝑥12 + 𝑥13 + 𝑥12 + 𝑥22 + 𝑥23 + 𝑥31 + 𝑥32 + 𝑥33 ≤ 14
36/68
Blending Problems
Constraint 8 : Crude oil blended to make gas 1 must have an average
octane level of at least 10.
12𝑥11 + 6𝑥21 + 8𝑥31
Total octane value in gas 1= ≥ 10 (! 𝑛𝑜𝑡 𝑙𝑖𝑛𝑒𝑎𝑟)
𝑥11 + 𝑥21 + 𝑥31
12𝑥11 + 6𝑥21 + 8𝑥31 ≥ 10(𝑥11 + 𝑥21 + 𝑥31 )
2𝑥11 − 4𝑥21 − 2𝑥31 ≥ 0
Constraint 9 : Crude oil blended to make gas 2 must have an average
octane level of at least 8.
4𝑥12 − 2𝑥22 ≥ 0
Constraint 10 : Crude oil blended to make gas 3 must have an
average octane level of at least 6.
6𝑥13 + 2𝑥23 ≥ 0
37/68
Blending Problems
Constraint 11: Crude oil blended to make gas 1 must contain at most
1% sulfur.
0.005𝑥11 + 0.02𝑥21 + 0.03𝑥31
Total sulfur in gas 1 mixture = ≤ 0.01
𝑥11 + 𝑥21 + 𝑥31
−0.005𝑥11 + 0.01𝑥21 + 0.02𝑥31 ≤ 0
Constraint 12: Crude oil blended to make gas 2 must contain at most
2% sulfur.
−0.015𝑥12 + 0.01𝑥32 ≤ 0
Constraint 13: Crude oil blended to make gas 3 must contain at most
1% sulfur.
−0.005𝑥11 + 0.01𝑥23 + 0.02𝑥33 ≤ 0
38/68
39/68
Production Process Models
Rylon Corporation manufactures Brute and Chanelle perfumes. The raw
material needed to manufacture each type of perfume can be purchased
for $3 per pound. Processing 1 lb of raw material requires 1 hour of
laboratory time. Each pound of processed raw material yields 3 oz of
Regular Brute Perfume and 4 oz of Regular Chanelle Perfume. Regular
Brute can be sold for $7/oz and Regular Chanelle for $6/oz. Rylon also
has the option of further processing Regular Brute and Regular Chanelle
to produce Luxury Brute, sold at $18/oz, and Luxury Chanelle, sold at
$14/oz. Each ounce of Regular Brute processed further requires an
additional 3 hours of laboratory time and $4 processing cost and yields 1
oz of Luxury Brute. Each ounce of Regular Chanelle processed further
requires an additional 2 hours of laboratory time and $4 processing cost
and yields 1 oz of Luxury Chanelle. Each year, Rylon has 6,000 hours of
laboratory time available and can purchase up to 4,000 lb of raw material.
Formulate an LP that can be used to determine how Rylon can maximize
profits. Assume that the cost of the laboratory hours is a fixed cost.
40/68
Solution
Decision variables:
◼ X1 :number of ounces of Regular Brute sold annually
◼ X2 :number of ounces of Luxury Brute sold annually
◼ X3 :number of ounces of Regular Chanelle sold annually
◼ X4 :number of ounces of Luxury Chanelle sold annually
◼ X5 :number of pounds of raw material purchased annually
Objective Function: Maximize the profit:
◼ Profit = revenues from perfume sales - processing costs - costs of
purchasing raw material =7x1 +18x2 +6x3 +14x4 -(4x2 +4x4)-3x5
◼ Max Z = 7x1 +14x2 +6x3 +10x4-3x5
41/68
Solution
Constraints:
◼ Constraint 1: No more than 4,000 lb of raw material can be
purchased annually.
◼ x5≤ 4,000
◼ Constraint 2: No more than 6,000 hours of laboratory time can
be used each year.
◼ Total lab time used annually = time used annually to process raw
material+ time used annually to process Luxury Brute + time
used annually to process Luxury Chanelle
◼ =x5 +3x2 +2x4
42/68
Solution
LP Model:
Max Z = 7x1 +14x2 +6x3 +10x4-3x5
x5≤ 4,000
3x2 + 2x4 + x5≤ 6,000
xi ≥ 0 for (i = 1, 2, 3, 4, 5)
44/68
Multi-period Decision Problems: An Inventory
Model
One of the most important uses of optimization is in multi-period
planning.
Partition time into a number of periods.
Usually distinguished by Inventory or Carry-Over variables.
Suppose there is a "planning horizon" 𝑇 = 1, 2 … 𝑇 .
Also suppose there is a known demand 𝑑𝑡 𝑓𝑜𝑟 𝑒𝑣𝑒𝑟𝑦 𝑡 ∈ 𝑇
Define... :
◼ 𝑃𝑡 : Production level in period 𝑡, ∀𝑡 ∈ 𝑇
◼ 𝐼𝑡 : Inventory level in period 𝑡, ∀𝑡 ∈ 𝑇
45/68
Multi-period Decision Problems
46/68
Example: Shoes Manufacturing
Complex production process involving many pieces:
◼ Demands
◼ Variable workforce size
◼ Overtime possibilities
◼ Inventory requirements
Goal:
◼ Plan production of shoes for next several months
◼ Meet forecast demands on time
◼ Hire and/or lay off workers
◼ Make overtime decisions
◼ Objective: minimize total cost
47/68
Example: Shoes Manufacturing
Planning horizon T = {1, 2, . . . |T|}. (|T| = 4).
Meet demand 𝑑𝑡 for shoes in period 𝑡 ∈ 𝑇
◼ d = (3000, 5000, 2000, 1000)
Initial Shoe Inventory:: 𝐼0 = 500
Have 𝑊0 = 100 workers currently employed.
Workers paid α = 1500/𝑚𝑜𝑡𝑛ℎ for working H = 160 hours
They can work overtime (max of O = 20 hours/worker) and get paid $ 𝛽 =
13/hour.
It take a = 4 hours of labor and 𝛿 = $15 in raw material costs to produce a
shoe
Hire-Fire costs η = $1600 to hire a worker and ζ = 2000 to fire a
worker.
ι =$3 holding cost incurred for each pair of shoes held at the end of the
month.
48/68
Mathematical Model
Objective :Minimize all costs: labor (regular + overtime),
production, inventory, hiring and firing
Decision Variables:
◼ 𝑥𝑡 : # of shoes to produce during month t
◼ 𝐼𝑡 : Ending inventory in month t, 𝑡 ∈ 𝑇 ∪ 0 .
◼ 𝑤𝑡 :# of workers available in month t, 𝑡 ∈ 𝑇 ∪ 0 .
◼ 𝑜𝑡 :# of overtime hours used in month t
◼ ℎ𝑡 :# workers hired at the beginning of month t
◼ 𝑓𝑡 :# workers fired at the beginning of month t
49/68
Mathematical Model
Objective Function:
Raw Material Costs: = 𝛿𝑥𝑡
𝑡∈𝑇
50/68
Mathematical Model- Constraints
Const1: Limit on Monthly Production:
◼ Not given explicitly
◼ Determined by number of workers available and overtime decisions
𝑎𝑥t ≤ 𝐻𝑤t + 𝑜t 𝑓𝑜𝑟 ∀𝑡 ∈ 𝑇
Const 2: Upper limit on overtime hours/month:
◼ Depends on how many workers you have
𝑜t ≤ 𝑂𝑤t 𝑓𝑜𝑟 ∀𝑡 ∈ 𝑇
Const 3: Demand must be met on time
◼ Equivalent to having nonnegative ending inventory each month (no
backlogging)
𝐼t ≥ 0 ∀𝑡 ∈ 𝑇 𝑖ç𝑖𝑛
◼ This assumes we have balance between production, demand, and
inventory
51/68
Mathematical Model- Constraints
Const 4: Balance Equations
◼ Shoes
𝐼t−1 + 𝑥t = 𝑑t + 𝐼t 𝑓𝑜𝑟 ∀𝑡 ∈ 𝑇
◼ People
𝑤t = 𝑤t−1 + ℎt − 𝑓t 𝑓𝑜𝑟 ∀𝑡 ∈ 𝑇
52/68
Model
53/68
Example: Shoes Manufacturing - Backlogging
Suppose you don't have to meet forecast demands in every
period.
Meeting demand is often too stringent a requirement for
the real-world.
Demand does not have to be met on time, but it must be
met eventually
There is a shortage cost θ=$20 per unit per month
backlogged
How should the minimum cost compare with cost of
earlier model?
54/68
Modelling Backlogging
Think of inventory being allowed to go negative.
Picture still makes sense, since if inventory is negative, you need
to " make up" for it during one of the next periods.
You can set last period demand 𝐼∣𝑇∣ ≥ 0 to ensure that all demand
is eventually met.
Cost function 𝐹(𝐼𝑡 ):
𝜄𝐼𝑡 𝑖𝑓 𝐼𝑡 ≥ 0
𝐹(𝐼𝑡 ) = ቊ
−𝜃𝐼𝑡 𝑖𝑓 𝐼𝑡 < 0
Is 𝐹(𝐼𝑡 ) a linear function of 𝐼𝑡 ?
55/68
Nonlinear => Linear Transformation
To model the case where we are minimizing a convex piecewise
linear function (like F(.) or . ), we can introduce a variable for
each piece:
Write constraints 𝐼𝑡 = 𝐿𝑡 − 𝑆𝑡 ∀𝑡 ∈ 𝑇
◼ Think of this as (Leftover - Shortage)
Objective gets terms:
𝐹(𝐼𝑡 ) = ι𝐿𝑡 + 𝜃𝑆𝑡
𝑡∈𝑇
This trick only works if we are minimizing costs. Then at most one
of 𝐿𝑡 𝑎𝑛𝑑 𝑆𝑡 will ever be positive in an optimal solution.
56/68
Modeling Absolute Value - Objective
Is 𝑓(𝑥) =∣ 𝑥 ∣ linear?
Is 𝑓(𝑥) =∣ 𝑥 ∣ convex?
Trick: Define auxiliary variables (𝑥+ 𝑣𝑒𝑥− ):
◼ Add constraint 𝑥 = 𝑥+ − 𝑥−
◼ Replace ∣ 𝑥 ∣ with 𝑥+ + 𝑥− in objective.
When will this trick work?
◼ When we are minimizing the absolute value of an
expression.
57/68
Modeling Absolute Value - Constraints
We would like to model ∣ 𝑎𝑇 𝑥 ∣≤ 𝑏 :
The Trick:
◼ Replace ∣ 𝑎 𝑇 𝑥 ∣≤ 𝑏 with with two inequalities
◼ 𝑎 𝑇 𝑥 ≤ 𝑏 and −𝑎 𝑇 𝑥 ≤ 𝑏
58/68
Shoes Manufacturing
59/68
Shoes Manufacturing - Backlogging
60/68
Multi-period Work Scheduling Problem
CSL is a chain of computer service stores. The number of hours of skilled repair
time that CSL requires during the next five months is as follows:
t Jan Feb March April May
61/68
Multi-period Work Scheduling Problem
Decisions to make?
◼ The number of technicians who should be trained during month t (t = 1, 2, 3,
4, 5).
◼ 𝑥𝑡 = number of technicians trained during month t
Objective Function:
◼ Minimizing total labor cost during the next five months
◼ Total labor cost = cost of paying trainees + cost of paying experienced
technicians
◼ We need number of experienced technicians at the beginning of month t
◼ 𝑦𝑡 = number of experienced technicians at the beginning of month t
62/68
Multi-period Work Scheduling Problem
Constraints:
◼ Number of available technician hours during month t ≥ Number of technician
hours required during month t
◼ Because each trainee requires 50 hours of experienced technician time, and
each skilled technician is available for 160 hours per month:
Number of available technician hours during month t = 160𝑦𝑡 − 50𝑥𝑡
160𝑦𝑡 − 50𝑥𝑡 ≥ 𝑑𝑡 𝑓𝑜𝑟 𝑡 = 1,2,3,4,5
◼ The number of skilled technicians available at the beginning of any month is
determined by the number of skilled technicians available during the previous
month and the number of technicians trained during the previous month:
◼ Experienced technicians available at beginning of month t = Experienced
technicians available at beginning of month (t -1) + technicians trained during
month (t -1) - experienced technicians who quit during month (t -1)
◼ 𝑦1 = 50
◼ 𝑦𝑡 = 𝑦𝑡−1 + 𝑥𝑡−1 − 0.05𝑦𝑡−1 = 0.95𝑦𝑡−1 + 𝑥𝑡−1 𝑓𝑜𝑟 𝑡 = 2,3,4,5
63/68