You are on page 1of 52

Formulation Exercises in LP

Exercises

ABC Pottery Company


XYZ Fertilizer Company
Investment Problem
Investment Problem II
Staffing Problem
Staffing Problem-II
MAX Function
Retailer Problem
Flow Maximization
Flow Maximization-II
Portfolio Design
Project Management
Ballmart(A)

ABC Pottery Company


Product mix problem - ABC Pottery Company
How many bowls and mugs should be produced to maximize profits
given labor and materials constraints?
Resource Availability: 40 hrs of labor per day, 120 lbs of clay
Product resource requirements and unit profit:

Product
Bowl
Mug

Resource Requirements
Labor
Clay
Profit
(hr/unit)
(lb/unit)
($/unit)
1
4
40
2

50

Problem Definition
Resource
Availability:

40 hrs of labor per day


120 lbs of clay

Decision
Variables:

x1 = number of bowls to produce per day


x2 = number of mugs to produce per day

Objective
Function:

Maximize Z = $40x1 + $50x2


Where Z = profit per day

Resource
Constraints:

1x1 + 2x2 40 hours of labor


4x1 + 3x2 120 pounds of clay

Non-Negativity
Constraints:

x1 0; x2 0

LP Formulation

maximize

Z=$40x1 + 50x2

subject to

1x1 + 2x2 40
4x2 + 3x2 120
x1, x2 0

Graphical Solution of a Maximization Model (1 of 12)


Coordinate Axes

maximize Z=$40x1 + 50x2


subject to
1x1 + 2x2 40 hours of labor
4x2 + 3x2 120 pounds of clay
x1, x2 0

Figure2.1Coordinates for graphical analysis

Graphical Solution of a Maximization Model (2 of 12)


Labor Constraint

maximize Z=$40x1 + 50x2


subject to
1x1 + 2x2 40 hours of labor
4x2 + 3x2 120 pounds of clay
x1, x2 0

Figure2.2Graph of the labor constraint line

Graphical Solution of a Maximization Model (3 of 12)


Labor Constraint Area

maximize Z=$40x1 + 50x2


subject to
1x1 + 2x2 40 hours of labor
4x2 + 3x2 120 pounds of clay
x1, x2 0

Figure2.3The labor constraint area

Graphical Solution of a Maximization Model (4 of 12)


Clay Constraint Area

maximize Z=$40x1 + 50x2


subject to
1x1 + 2x2 40 hours of labor
4x2 + 3x2 120 pounds of clay
x1, x2 0

Figure2.4The constraint area for clay

Graphical Solution of a Maximization Model (5 of 12)


Both Constraints

maximize Z=$40x1 + 50x2


subject to
1x1 + 2x2 40 hours of labor
4x2 + 3x2 120 pounds of clay
x1, x2 0

Figure 2.5 Graph of both model Constraints

Graphical Solution of a Maximization Model (6 of 12)


Feasible Solution Area

maximize Z=$40x1 + 50x2


subject to
1x1 + 2x2 40 hours of labor
4x2 + 3x2 120 pounds of clay
x1, x2 0

Figure 2.6

The feasible solution area constraints

XYZ Fertilizer Company

Two brands of fertilizer available - Super-gro, Crop-quick.


Field requires at least 16 pounds of nitrogen and 24 pounds of phosphate.
Super-gro costs $6 per bag, Crop-quick $3 per bag.
Problem : How much of each brand to purchase to minimize total cost of
fertilizer given following data ?
Chemical Contribution
Nitrogen
(lb/bag)

Phosphate
(lb/bag)

Super-gro

Crop-quick

Brand

Problem Definition
Decision varIables
x1 = bags of Super-gro
x2 = bags of Crop-quick
The objective function:
minimize Z = $6x1 + 3x2
where $6x1 = cost of bags of Super-gro
3x2 = cost of bags of Crop-quick
Model constraints:
2x1 + 4x2 16 lb (nitrogen constraint)
4x1 + 3x2 24 lb (phosphate constraint)
x1, x2 0 (non negativity constraint)

Model Formulation and Graph

Complete model formulation:


minimize Z = $6x1 + 3x2
subject to
2x1 + 4x2 16 lb of nitrogen
4x1 + 3x2 24 lb of phosphate
x1, x2 0

Figure 2.14 Constraint lines for fertilizer model

Feasible Solution Area

minimize Z = $6x1 + 3x2


subject to
2x1 + 4x2 16 lb of nitrogen
4x1 + 3x2 24 lb of phosphate
x1, x2 0

Figure2.15Feasible solution area

Optimal Solution Point

minimize Z = $6x1 + 3x2


subject to
2x1 + 4x2 16 lb of nitrogen
4x1 + 3x2 24 lb of phosphate
x1, x2 0

Figure2.16The optimal solution point

Investment Problem
Mr. Prabandh Shikhar is looking at a 3 year planning
horizon for investing Rs.100000. He has two options:
a)
Invest in a savings account at 5% rate of interest
with maturity period of 1 year
b)
Invest in a security Y at 12% rate of interest with
maturity period of 2 years
Assume that the withdrawals can only be made at the end
of maturity period. What should be his investment strategy
that would maximize the total return at the end of 3 years?

Decision Variables
xi= Money invested in the savings account
at the beginning of i th year
yi= Money invested in the security Y at the
beginning of i th year

Decision Problem
1st Year

2nd Year

3rd Year

Start
x1

x2

x3

y1

y2

y3

End of 3rd Year

Constraints
1st Year

2nd Year

3rd Year

End of 3rd Year

Start
x1

x2

x3

Money Received

y1

y2

y3

=1.05x3+ 1.12y2

x1+ y1=100000

x2+ y2=1.05x1

x3+ y3=1.05x2 + 1.12y1

Formulation
Max Z=1.05x3+ 1.12y2
Subjected to
x1 + y1
-1.05x1

=100000
+ x2 + y 2

-1.12y1 -1.05x2
x1, y1 , x2, y2 , x3, y3 >= 0

=0
+ x3+ y3 = 0

Optimal Investment Plan


1st Year

2nd Year

3rd Year

End of 3rd Year

Start

Plan 1

x1 =100000

x2 =0

x3 =0

y1 =0

y2 = 105000

y3 =0

OR
Plan 2

Money Received

=117600

x1 =0

x2 =0

x3 =112000

y1 =100000

y2 = 0

y3 =0

Investment Problem -II


Mr. Prabandh Shikhar is looking at a 5 year planning horizon for investing
Rs.1000000. He has four options:
Invest in a savings account X at 5% rate of interest with maturity period of
1 year
Invest in a security Y at 12% rate of interest with maturity period of 2 years
Invest in a security Z at 18% rate of interest with maturity period of 3 years
Invest in a security W at 24% rate of interest with maturity period of 4 years
Assume that the withdrawals can only be made at the end of maturity
period. What should be his investment strategy that would maximize the
total return at the end of 5 years?

Staffing Problem
Daily requirements in the HR department of a company are as follows:
Day

Mon

Tue

Wed

Thu

Fri

Sat

Sun

Requirement

A person works for 5 consecutive days and takes 2 days off. Assuming
that a cyclical schedule is to be made find the minimum number of people
that will meet the daily requirements.

Decision Variables
xi= Number of people who begin work on
i th day

Formulation
Min Z= x1 + x2 + x3 + x4 + x5 + x6 + x7
Subjected to
x1
+ x4 + x5 + x6 + x7 >=5
x1 + x2

+ x5 + x6 + x7 >=3

x1 + x2 + x3

+ x6 + x7 >=2

x1 + x2 + x3 + x4
x1 + x2 + x3 + x4 + x5

+ x7 >=4
>=5

x 2 + x3 + x4 + x5 + x6
x3 + x4 + x5 + x6 + x7

>=2
>=2

x1 , x2 , x3 ,x4 ,x5 , x6 ,x7 >= 0

Optimal Solution
x1 =3
x4 =2
x2 ,x3 , x5 , x6 , x7 =0

Staffing Problem -II


Daily requirements in the HR department of a company are as follows:

Monday

Tuesday

Wednesday Thursday

Friday

Saturday

Sunday

Shift 1

14

13

15

16

19

18

11

Shift 2

22

28

19

20

26

28

18

Shift 3

11

10

15

12

19

12

A person works for 5 consecutive days and takes 2 days off. Assuming
that a cyclical schedule is to be made find the minimum number of people
that will meet the daily requirements.

Decision Variables
xi= Number of people who begin work on
i th day

Formulation (Shift-1)
Min Z= x1 + x2 + x3 + x4 + x5 + x6 + x7
Subjected to
x1
+ x4 + x5 + x6 + x7 >=14
x1 + x2

+ x5 + x6 + x7 >=13

x1 + x2 + x3

+ x6 + x7 >=15

x1 + x2 + x3 + x4
x1 + x2 + x3 + x4 + x5

+ x7 >=16
>=19

x 2 + x3 + x4 + x5 + x6
x3 + x4 + x5 + x6 + x7

>=18
>=11

x1 , x2 , x3 ,x4 ,x5 , x6 ,x7 >= 0

Optimal Solution (Shift-1)


x1 =7
x3 =3
x5 =4
x6 =7
x7 =1
x2 ,x4 =0

Optimal Solution (All Shifts)


Shift 1

Shift 2

Shift 3

Monday

Tuesday

Wednesday

Thursday

Friday

Saturday

11

Sunday

Staffing Problem-III
The total requirements are shown in the table below.

Day

Mon

Tue

Wed

Thu

Fri

Sat

Sun

Requirements

22

28

23

26

22

17

16

Assume that you can hire two kinds of workers : regular and temporary.
1) Regular worker can either :
Work for 3 days at a stretch then take a day off and then work for 2 continuous days and
take a day off.
OR

Work for 5 days at a stretch and take 2 days off.


Regular worker gets paid for all the seven days a week (at a rate of Rs.200 /day)
including the off days.
2) A temporary worker has to work for 5 days at a stretch and take 2 days off.The total
number of temporary workers working on a given day should not be more than 30%.
A temporary worker gets paid only on the days he/she is working.The rates for the
various days are given as :

Day

Mon

Tue

Wed

Thu

Fri

Sat

Sun

Rate(Rs./day)

120

130

140

150

160

170

180

X1

X1

X1

X1

X1

X2

X2

X2

X2

X2

X3

X3

X3

X3

X3

X4

X4

X4

X4

X5

X5

X5

X6

X6

X4
X5

X5

X6

X6

X6

X7

X7

X7

Y1

Y1

Y1

Y2

Y2

Y2

Y3

Y3

Y3

Y4

Y4

Y4

Y5

Y5

Y5

Y6

Y6

Y3
Y4

Y4
Y5

Y6
Y7

Z1

Z1
Z2

Y2

Y6

(X1+ X4 + X5 + X6+ X7 +

Y1
Y2
Y3

Y7

Z1

Z1

Z1

Z2

Z2

Z2

Z2

Z3

Z3

Z3

Z3

Z3

Z4

Z4

Z4

Z4

Z5

Z5

Z5

Z6

Z6

Z5

Z5

Z6

Z6

Z6

Z7

Z7

Z7

Z7

22

28

23

26

Y7

(Z1+ Z4 + Z5 + Z6+ Z7 )
< = 0.3 (X1+ X4 + X5 + X6+ X7 +

Z7
22

Y1+ Y3 + Y4 + Y6+ Y7 +
Z1+ Z4 + Z5 + Z6+ Z7 ) >= 22

Y7

Z4

Req

X7
Y1

Y5
Y6

Y7

X7

Constraints DAY 1

17

16

Y1+ Y3 + Y4 + Y6+ Y7 +
Z1+ Z4 + Z5 + Z6+ Z7 )
Similarly for Day 2,3,7

Objective Function
Minimize Z=
200*7 (X1+ X2 +X3 + X4 + X5 + X6+ X7 + Y1+ Y2 +Y3 + Y4 + Y5 + Y6+ Y7 ) +
120* (Z1+ Z4 + Z5 + Z6+ Z7 ) + 130* (Z1+ Z2 + Z5 + Z6+ Z7 ) +
140* (Z1+ Z2 + Z3 + Z6+ Z7 ) + 150* (Z1+ Z2 + Z3 + Z4+ Z7 ) +
160* (Z1+ Z2 + Z3 + Z4+ Z5 ) + 170* (Z2+ Z3 + Z4+ Z5+ Z6 ) +
180* (Z3 + Z4+ Z5+ Z6 + Z7)

Max Function
Write an LP Formulation for a Max Function
shown below :
Z=Max [ a1 , a2, a3, a4, a5, .. an ]

Formulation
Z >= a1
Z >= a2
Z >= a3
:
Z >= an
Min Z

Retailing Problem
Mr. X, who operates in Indore, needs to determine his procurement and
sales plan for rice for the next 4 months. He has 25 tonnes of rice to
begin with. He has a warehouse that can stock maximum 100 tonnes
of rice. He has access to the following information:
Month

Sales Price in
Indore(Rs. per
tonne)

Purchase price in
Chattisgarh (Rs. per
tonne)

4000

4000

5000

3200

4000

2900

4000

3000

Decision Variables
pi= Quantity of rice purchased at the
beginning of month i
si= Quantity of rice sold during month i

Formulation
Let bi be the beginning stock for each month
b1
b2
b3
b4

+ p1
+ p2
+ p3
+ p4

- s1
- s2
- s3
- s4

= b2
= b3
= b4
= b5

b1
b2
b3
b4

+ p1<= 100
+ p2 <= 100
+ p3 <= 100
+ p4 <= 100

b1= 25 , b5=0 ,Non negativity


Max Z = 4000s1-4000 p1+ 5000s2-3200 p2 +4000s3-2900 p3 +
4000s4-3000 p4

Maximize Outflow
Cap=3
Cap=5

Cap=1

Cap=2
A

Cap=Inf.

Start

Outflow
Cap=7

Cap=3
Cap=5

Cap=5
D

End

Maximize Outflow -II


Leakage =10% of the
incoming flow

Cap=3
Cap=5

Cap=1

Cap=2
A

Start

Cap=Inf.

Outflow
Cap=7

Cap=3

Cap=5

Cap=5
D

Leakage =8% of the


incoming flow

End

Leakage =5% of the


flow

D.Vs
Leakage =10% of the
incoming flow

Cap=3
Cap=5
xAB

xIN

Cap=2

xBC ,xCB
xAC

Start

xBE

xAD

Cap=Inf.

xCF

Cap=7

Cap=3

xCD ,xDC

Cap=5

Cap=1
xEF

Outflow
F

xOUT

End

xDF

Cap=5
D

Leakage =8% of the


incoming flow

Leakage =5% of the


flow

Formulation
xAB +xCB =xBE + xBC

xBE *0.9 = xEF

xBC, xCB <=2

xEF<= 1

Cap=5

xAB, xAD <=5

Cap=2

xBC ,xCB
xAC

Start

xBE

xAB

xIN

Cap=3

xBE<= 3

xIN =xAB + xAC +xAD

xAD

Cap=Inf.

xAC +xBC + xDC = xCF +xCB +xCD


xCF<=7

xCF

Cap=7

Cap=3

xCD ,xDC

Cap=5

Leakage =10% of the


incoming flow

xDC, xCD <= 3

xEF

Outflow
xOUT

End

0.95xCF + xEF +xDF= xOUT

xDF

Cap=5
D

(xAD +xCD)0.92 =xDC + xDF


xDF <=5

Cap=1

Leakage =8% of the


incoming flow

Leakage =5% of the


flow

Z=Max xOUT

Portfolio Design
A mortgage team wants to finance Rs. 100,000,000 to various loans .Any
uninvested money goes to savings account with 2.5% return.
Loan/Investment

Return (%)

Risk(%)

Type I Mortgages

Type II Mortgages

12

Personal

15

Commercial

Govt. Securities

Allocate the money so as to :


1.
Maximize average return per rupee for one year
2.
Average risk should not be more than 5(excluding the savings)
3.
20% minimum investment in commercial

Formulation
D.V.s : xi is the amount to be invested in ith loan
Z= 9x1 + 12x2 + 15x3 + 8x4 + 6x5 + 2.5x6
x1 + x2 + x3 + x4 + x5 + x6 + x7<=100000000
(3x1 + 6x2 + 8x3 + 2x4 + x5)/(x1 + x2 + x3 + x4 + x5 ) <= 5
x4 >= 0.2(x1 + x2 + x3 + x4 + x5 )

Project Management
5

3
5

E
D
5

G
2

Formulation
TF>= TE+ 2
5
TH>= TF+ 5

TC>= TB+ 4
3
5

TB>= TA+ 5

D
5
TD>= TB+ 4

TH>= TG+ 2

TE>= TC+ 3
TE>= TD+ 5

G
2

TG>= TE+ 2

2
1
TI>= TH+ 1
TFINISH>= TI+ 2
Min TFINISH

Ballmart (A)
D
4

F
5

Outlets

Factories
C

2
7
E

3 A
10

Factories
Coordinates
Factor
y

Production
Cost
(Rs. per
Unit)

60.66

18.89

4.22

5000

60.87

60.69

3.14

5000

67.24

48.41

3.56

5000

93.69

95.64

3.73

5000

27.96

23.52

4.99

5000

83.27

78.97

4.80

5000

Production
Capacity (Units
per year)

Outlets
Coordinates
Outlets

Sales Price
(Rs. Per
Unit)

56.77

42.28

8.89

3000

78.35

7.07

8.20

2000

57.64

17.82

9.20

1000

63.02

87.19

8.50

2000

41.14

73.40

9.29

1000

2.06

84.33

8.99

1500

49.20

35.37

8.34

500

20.72

3.14

9.93

2000

9.28

69.88

8.14

1200

10

58.44

11.23

8.05

2100

Demand (Units per


year)

Distance Matrix
1

10

281.23

226.40

5.13

2335.05

1676.13

3858.15

201.44

921.41

2619.85

31.80

177.83

1590.67

924.23

353.26

275.29

2008.42

388.57

2461.70

1372.72

1226.31

73.55

916.28

513.93

760.73

652.80

2769.24

247.59

2106.35

1910.02

729.91

2105.16

4040.30

3678.11

506.21

1628.32

4262.19

2805.84

6940.28

3894.51

4184.23

591.16

1405.13

456.66

2641.38

1330.85

2184.35

295.97

233.73

1249.08

540.09

1024.08

2597.21

2198.28

238.73

902.92

3311.61

1530.66

4830.96

2778.32

2602.88

You might also like