Session 5
Session 5
Session-5
1
14-02-2024
LP Formulation
• Decision Variables:
• Objective Function:
Minimize Z= x1 + x2
• Constraints:
• Magazine ads attract 100 new customers, and Online ads attract 50
new visitors to the physical store per $1000 spent:
100x1+50x2≥500
• Magazine ads attract 500 new customers and Online ads attract 50 new
visitors to the physical store per $1000 spent:
500x1+1000x2≥5000
• Non-negativity constraints:
x1,x2≥0
2
14-02-2024
Production Mix
A shop can make two types of sweets (A and B). They use two resources-
flour and sugar. To make one packet of A, they need 3 kg of flour and 3 kg
of sugar. To make one packet of B, they need 3 kg of flour and 4 kg of
sugar. They have 21 kg of flour and 28 kg of sugar. These sweets are sold
at Rs 1000 and Rs 900 per packet, respectively.
Develop a mathematical model and Find the best product mix to maximize
the revenue.
3
14-02-2024
A Diet Problem
A group of OR students aim to improve their diet. Based on a
nutrition specialist’s recommendation, they want their daily intake
to contain at least 60 g of protein, 75 mg of vitamin C, 800 mg of
calcium, and 2000 calories.
They would like their daily menu to consist of five food types. The
serving size, cost per serving, and nutrition information for each
food type are given.
Food Type Cost ($) Protein (g) Calcium (mg) Vitamin C Calories
(mg)
Almond Butter (100 g) 2.90 15 270 1 600
Brown Rice (200 g) 3.20 5 20 0 215
Orange Juice (250 g) 0.50 2 25 106 110
Salmon (150 g) 4.50 39 23 0 280
Wheat Bread (25 g) 0.30 3 35 0 66
Required ingestion --- 60 800 75 2000
4
14-02-2024
Mathematical Model
• Objective Function:
• Min 2.90𝑥1 +3.20𝑥2 +0.50𝑥3 +4.50𝑥4 +0.30𝑥5
• Constraints:
• Protein: 15𝑥1 + 5𝑥2 +2𝑥3 + 39𝑥4 + 3𝑥5 ≥ 60
• Calcium: 270𝑥1 + 20𝑥2 +25𝑥3 + 23𝑥4 + 35𝑥5 ≥ 800
• Vitamin C: 1𝑥1 + 0𝑥2 +106𝑥3 + 0𝑥4 + 0𝑥5 ≥ 75
• Calories: 600𝑥1 + 215𝑥2 + 110𝑥3 + 280𝑥4 + 66𝑥5 ≥ 2000
• Non-Nagitivity Constraints: 𝑥𝑗 ≥ 0, ∀𝑗
5
14-02-2024
Mathematical Formulation
6
14-02-2024
Initial Formulation
• Objective Function:
Minimize t
• Constraints:
• X1+x2=5 ➔ x2 = 5-x1
• Y1+y2 = 5 ➔ y2 = 5-y1
• Z1+z2 = 5 ➔ z2 = 5-z1
• Time constraints:
• t >= x1/4 + x2/7 ➔ t >= x1/4 + (5-x1) /7
• t>= y1/5 + y2/8 ➔ t >= y1/5 + (5-y1)/8
• t >= z1/6 + z2/10 ➔ t >= z1/6 + (5-z1)/10
• Distance Constraints:
• x1 + x2 + x3 = 5
• Non-negativity Constraints
7
14-02-2024
Final Formulation
• Objective Function:
Minimize t
• Constraints:
• Time constraints:
• t >= x1/4 + (5-x1) /7
• t >= y1/5 + (5-y1)/8
• t >= z1/6 + (5-z1)/10
• Distance Constraints:
• x1 + y1 + z1 = 5
• Non-negativity Constraints
A Scheduling Problem
A hospital is aiming to design a schedule for day-shift nurses
that minimizes the total number of nurses employed. Each
nurse works 3 consecutive day shifts and then has 4 days off.
The minimum number of nurses required for each day of a
week:
Day of week/shift M T w Th F S S
Nurses Required 16 12 18 13 15 9 7
8
14-02-2024
Objective function:
Minimize σ7𝑖=1 𝑥1
Constraints:
• Mon: 𝑥1 + 𝑥6 + 𝑥7 ≥ 16;
• Tue: 𝑥1 + 𝑥2 + 𝑥7 ≥ 12;
• Wed: 𝑥1 + 𝑥2 + 𝑥3 ≥ 18;
• Thu: 𝑥2 + 𝑥3 + 𝑥4 ≥ 13;
• Fri: 𝑥3 + 𝑥4 + 𝑥5 ≥ 15;
• Sat: 𝑥4 + 𝑥5 + 𝑥6 ≥ 9;
• Sun: 𝑥1 + 𝑥6 + 𝑥7 ≥ 7
• At least half of the day-shift nurses have weekends off:
(𝑥1 + 𝑥2 +𝑥3 ) 1
• ≥2 ➔ 𝑥1 + 𝑥2 + 𝑥3 ≥ 𝑥4 + 𝑥5 + 𝑥6 + 𝑥7
(𝑥1 + 𝑥2 +𝑥3 +𝑥4 + 𝑥5 +𝑥6 )
9
14-02-2024
Solution
• This problem has multiple optimal solutions with 𝑧 ∗ = 31. one
of them is given by
10
14-02-2024
A Scheduling Problem
• The daily requirement of nurses in a private nursing home is
given in the following table
Time of the day Requirements
8 am – 12 noon 12
12 noon – 4 pm 15
4 pm – 8 pm 10
8 pm -12 midnight 8
12 midnight – 4 am 6
4 am – 8 am 10
LP Model Formulation
11
14-02-2024
• Let x1, x2, x3, x4, x5, and x6 are number of nurses who start working at
8 am, 12 noon, 4 pm, 8 pm, 12 midnight, and 4 am respectively.
• Objective function
• σ6𝑖=1 𝑥𝑗 = 𝑥1 + 𝑥2 + 𝑥3 + 𝑥4 + 𝑥5 + 𝑥6
• Subject to
• X1+x2 =>15
• X2+x3 =>10
• X3+x4 =>8
• X4+x5 =>6
• X5+x6=>10
• X6+x1=>12
• x1, x2, x3, x4, x5, x6 => 0 (non negativity constraint)
The demand for 2 weeks for product are 800 and 1000. In a
week, the company can produce up to 700 units at 100/product
at the regular time. It can employ overtime and produce up to
an extra 300 units in a week at Rs 120/product. The cost of
carrying a product from week one to next week is Rs
15/product/week. How should they produce to meet the
demand at minimum cost?
12
14-02-2024
Solution
Decision Variables:
• Let x1 be the number of products made using regular time in week 1.
• Let x2 be the number of products made using regular time in week 2.
• Let y1 be the number of products made using overtime in week 1.
• Let y1 be the number of products made using overtime in week 1.
• Let z1 be the number of products carried from week 1 to week 2.
Initial Formulation
• Minimize:
100x1+100x2+120y1+120y2+15z1
• s.t.:
• x1+y1 = 800+z1 or x1+y1-z1=800;
• z1+x2+y2 = 1000;
• x1 <=700
• x2 <=700
• y1 <=300
• y2<=300
• x1,x2,y1,y2,z1 =>0
13
14-02-2024
Minimize 115x1+100x2+135y1+120y2-1200
s.t.:
• Demand Constraints:
x1+y1 => 800;
x1+x2+y1+y2 => 1800; Note: In the second
• Capacity Constraints: formulation, we have 1
x1 <=700 variable less, and the
x2 <=700 constraints are all
y1 <=300 inequalities instead of
y2<=300 equations.
X1,x2,y1,y2 =>0
14
14-02-2024
15
14-02-2024
Solutions
Decision Variable:
x1 is the number of advertisements on TV.
x2 is the number of advertisements in the newspaper.
x3 is the number of advertisements on websites.
x4 is the number of advertisements on the radio.
• Objective function:
Maximize 8000x1+ 5000x2+3000x3+2000x4
• s.t.
Budget Constraint: 4x1+3x2+2x3+1.5x4 <=3200000
• Max. No of advertisement Constraint:
• x1 <= 3
• x2 <= 4
• x3 <= 5
• x4 <= 4
• Non-negativity Constraints: x1, x2, x3, and x4 >= 0
16