0% found this document useful (0 votes)
464 views20 pages

Linear Programming

The document describes several linear programming formulations: 1) A product mix problem to maximize revenue from producing two types of sweets given resource constraints. Decision variables are quantities of each sweet. 2) A nurse scheduling problem to minimize nurses needed to meet daily demand requirements over shifts. Decision variables are numbers of nurses assigned to each shift. 3) A production planning problem to minimize costs of regular/overtime production and inventory carrying to meet two weeks' demand. Decision variables include production quantities by type and week. 4) An advertising media selection problem to maximize reach given a budget. Decision variables are numbers of ads in different media. 5) A traveling problem to minimize time for three people to

Uploaded by

Nandan Choudhary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
464 views20 pages

Linear Programming

The document describes several linear programming formulations: 1) A product mix problem to maximize revenue from producing two types of sweets given resource constraints. Decision variables are quantities of each sweet. 2) A nurse scheduling problem to minimize nurses needed to meet daily demand requirements over shifts. Decision variables are numbers of nurses assigned to each shift. 3) A production planning problem to minimize costs of regular/overtime production and inventory carrying to meet two weeks' demand. Decision variables include production quantities by type and week. 4) An advertising media selection problem to maximize reach given a budget. Decision variables are numbers of ads in different media. 5) A traveling problem to minimize time for three people to

Uploaded by

Nandan Choudhary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Linear Programming

Formulation 1 – Product mix problem


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 900 per packet respectively. Find the best product mix to
maximize the revenue.
Let X1 be the number of packets of sweet A made
Let X2 be the number of packets of sweet B made
Maximize 1000X1 + 900X2
3X1 + 3X2 ≤ 21
3X1 + 4X2 ≤ 28
X1, X2 ≥ 0
Notations
Let X1 be the number of packets of sweet A made Decision
Let X2 be the number of packets of sweet B made variable

Maximize 1000X1 + 900X2 Objective function


3X1 + 3X2 ≤ 21 Constraints
3X1 + 4X2 ≤ 28

X1, X2 ≥ 0 Non negativity restriction


Assumptions
1. Proportionality
2. Linearity
3. Deterministic
Formulation 2 – Manpower requirement
The daily requirement of nurses in a private nursing home is given in the
following table
Time of the day Requirement
8 am – 12 noon 12
12 noon – 4 pm 15
4 pm to 8 pm 10
8 pm to 12 midnight 8
12 midnight to 4 am 6
4 am to 8 am 10

The nurses start work at the beginning of the shift (8 am, 12 noon etc) and
work for 8 continuous hours. What is the minimum number of nurses
required to meet the daily demand?
Let X1 to X6 be the number of nurses who start work at 8 am,
12noon, 4 pm, 8 pm, 12 midnight and 4 am respectively

Minimize = X1 + X 2 + X 3 + X 4 + X 5 + X 6

X1 + X2 ≥ 15
X2 + X3 ≥ 10 Requirement of
period 2
X3 + X 4 ≥ 8
12 noon to 4 pm
X4 + X 5 ≥ 6
X5 + X6 ≥ 10
X6 + X1 ≥ 12
X1 , X 2 , X 3 , X 4 , X 5 , X 6 ≥ 0
Formulation 3 – Production Planning
The demands for 2 weeks for a product are 800 and 1000. In a week the
company can produce up to 700 units in regular time at Rs 100/product. It
can employ overtime and product up to an extra 300 units in a week at Rs
120/product. The cost of carrying a product from one week to the next is Rs
15/product/week. How should they produce to meet the demand at
minimum cost?

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 Y2 be the number of products made using overtime in week 2.
Let Z1 be the number of products carried from week 1 to week 2
Formulation 3 – Production Planning
Minimize 100X1 + 100X2 Minimize 100X1 + 100X2 + 120Y1 +
+ 120Y1 + 120Y2 + 15Z1 120Y2 + 15( X1 + Y1 – 800)
subject to Minimize 115X1 + 100X2 + 135Y1 +
X1 + Y1 = 800 + Z1; 120Y2 - 12000
X1 + Y1 - Z1 = 800 subject to
Z1 + X2 + Y2 = 1000 X1 + Y1 ≥ 800
X1 + X2 + Y1+ Y2 ≥ 1800
X1 ≤ 700
X1 ≤ 700
X2 ≤ 700 X2 ≤ 700
Y1 ≤ 300 Y1 ≤ 300
Y2 ≤ 300 Y2 ≤ 300
Formulation 4 – Media selection problem
A company wants to advertise their product in four different media – TV,
newspaper, websites and radio. The reach per advertisement in these four
media are 8000, 5000, 3000 and 2000. The cost per advertisement is Rs 4
lakhs, 3 lakhs, 2 lakhs and 1.5 lakhs. The maximum number of
advertisements that the company wishes to have in each media is 3, 4, 5, 4.
The budget available is 32 lakhs. How many advertisements does the
company decide in each media to maximize reach?

Let X1 be the number of advertisements in TV


Let X2 be the number of advertisements in newspaper
Let X3 be the number of advertisements in websites
Let X4 be the number of advertisements in radio
Formulation 4 – Media Selection Problem
Maximize 8000X1 + 5000X2 + 3000X3 + 2000X4
subject to Reach
4X1 + 3X2 + 2X3 + 1.5X4 ≤ 32
Budget
X1 ≤ 3
X2 ≤ 4
Limits/bounds
X3 ≤ 5
X4 ≤ 4
X1, X2, X3, X4 ≥ 0 Non negativity
Formulation 5 – Bicycle problem
Three friends (A, B and C) start from P towards Q which is 5 km
away. They have one cycle and only one person rides a cycle at
a time. A, B and C walk at speeds 4, 5 and 6 km/hour and can
ride the cycle at 7, 8 and 10 km/hour. How do they travel such
that all three reach Q at the earliest time?
Time taken by A = Minimize u

Time taken by B = Subject to


Time taken by C =

All three reach when the last


person reaches. We minimize X1, X2, X3, u ≥ 0
the maximum of the three times
Formulation 6 – Napkins problem
The requirement of napkins on five consecutive days of dinner is 100, 60, 80, 90, 70.
New napkins cost Rs 60. Napkins sent to laundry at the end of any day can be used from
The second day onwards. The laundry cost is Rs 20/napkin. Find a solution to napkins
problem that minimizes total cost?
Formulation 6 – Napkins problem
Day 1 demand X1 ≥ 100

Day 2 demand – We can buy more than 100 on day 1 and X1 -100 + X2 ≥ 60
Use some of the extra napkins on day 2 X1 + X2 ≥ 160

Day 3 demand – extra napkins from day 2 + X1 + X2 – 160 + X3 + Y1 ≥ 80


new napkins bought on day 3
+ napkins received from laundry on day 3 (sent on day 1) X1 + X2 + X3 + Y1 ≥ 240

Day 4 demand – extra napkins from day 3 + X1 + X2 + X3 + Y1 – 240 + X4 + Y2 ≥ 90


new napkins bought on day 4
X1 + X2 + X3 + Y1 + X4 + Y2 ≥ 330
+ napkins received from laundry on day 4 (sent on day 2)
Formulation 6 – Napkins problem
Day 5 demand – extra napkins X1 + X2 + X3 + Y1 + X4 + Y2 – 330 + X5 + Y3 ≥ 70
from day 4 + new napkins bought on day 5
+ napkins received from laundry on day 5 X1 + X2 + X3 + X4 + X5 + Y1 + Y2 + Y3 ≥ 400
(sent on day 3)

Limit on napkins sent to laundry Y1 ≤ 100, Y2 ≤ 60, Y3 ≤ 80

Objective function Minimize 60 (X1 + X2 + X3 + X4 + X5) + 20 (Y1 + Y2 + Y3)

Non negativity X1, X2, X3, X4, X5, Y1, Y2,Y3 ≥ 0


Formulation 6 – Napkins problem
(General formulation)
Let the number of new napkins bought on day i be X i. Let the number of napkins
sent to laundry at the end of day i be Yi

Minimize c = cost of new napkin


a = laundry cost
d = demand
p = laundry days

Yi  di
Xi, Yi,  0.
Formulation 7 – Maximum flow problem
10
2 Find the maximum flow in the network
The arc capacities are given
20 30 5
30
25
1 4 Let Xij be the flow in arc i-j.
35 Let f be the flow in the network
40 20
3
Variables are X12, X13, X23, X24, X25, X34, X35 and X45
Formulation 7 – Maximum flow problem
10 Maximize f X12 ≤ 20
2 Subject to
X13 ≤ 40
X12 + X13 = f
20 30 5 X23 ≤ 30
-X12 + X23 + X24 + X25 = 0
30 X24 ≤ 30
25 -X13 -X23 + X34 + X35 = 0
1 4 X25 ≤ 10
35 -X24 -X34 + X45 = 0
40 20 X34 ≤ 35
X25 + X35 + X45 = f
3 X35 ≤ 20
Maximize X25 + X35 + X45 X45 ≤ 25
Subject to f, Xij ≥ 0.
-X12 + X23 + X24 + X25 = 0
-X13 -X23 + X34 + X35 = 0
-X24 -X34 + X45 = 0
Formulation 8 – Bin packing
You are given the numbers 8, 6, 9, 28, 17, 24, 7, 21. Make minimum number of groups
such that the sum of the numbers in each group does not exceed 45.

Maximum of 8 groups are possible. We define Yj = 1 if group j is formed


and Xij = 1 if number i goes to group j.

The variables are not continuous and take binary values

Minimize

Minimize Y1 + Y2 + Y3 + Y4 + Y5 + Y6 + Y7 + Y8
Formulation 8 – Bin packing
You are given the numbers 8, 6, 9, 28, 17, 24, 7, 21. Make minimum number of groups
such that the sum of the numbers in each group does not exceed 45.
X11 + X12 + X13 + X14 + X15 + X16 + X17 + X18 = 1

8X11 + 6X21 + 9X31 + 28X41 + 17X51 + 24X61 + 7X71 + 21X81 ≤ 45Y1

There are 64 + 8 = 72
Xij, Yj = 0,1
Variables and 16 constraints
Formulation 8 – Bin packing
You are given the numbers 8, 6, 9, 28, 17, 24, 7, 21. Make minimum number of groups
such that the sum of the numbers in each group does not exceed 45.

A simple solution would be {8, 6, 9}, {28, 17}, {24, 7}, {21}. There are 4 groups. Using this
We can reduce the Yj variables to 4 and allot numbers to 4 groups while minimizing the
number of groups.
The formulation would have 8x4 + 4 = 36 variables and 8+4 = 12 constraints and is
simpler
We can verify whether there is a solution by defining 3 groups. The formulation
would have 8x3 + 3 = 27 variables and 8+3 = 11 constraints.
Sometimes, starting with a solution gives better formulations for some integer (binary)
programming problems

You might also like