Or Introduction and Linear Programming
Or Introduction and Linear Programming
By
Raghuvaran A P
Department of Management Studies
Origin of Operations Research (OR)
• WW – I • WW – II
Operation Research
Linear Programming
Mathematical equations are framed to solve real time problem
• X1 – Boats, Rs. 20
• X2 – Planes, Rs. 50
• Case 1 - boats
• Y = 20 * 4 + 50 * 0 = 80
• Case 2 - planes
• Y = 20 * 0 + 50 * 2 = 100
• Case 3 – 1 plane , 2 boats
• Y = 20 * 2 + 50 * 1 = 90
Structure of Linear Programming
• Objectives
• Profit Maximization Zmax
• Cost Minimization Zmin
• Constraints
• Resource constraints 2X1 + 3X2 <= 600
• Order commitments X1 + X2 >= 100
• Non-negativity Contraints
• Variable value cannot be negative X1, X2 >= 0
Linear Programming – Problem 1
• A person intend to make a profit through papercraft work. For every
paper boat which he makes he earns Rs. 20 and for every paper plane
he crafts he earns Rs. 50. Right now the available paper is in size of 20
x 20 cm paper (i.e. 400 sq cm) and each boat needs paper size of 10 x
10 cm (i.e. 100 sq cm) and each plane needs paper size of 10 x 20 cm
(i.e. 200 sq cm). Formulate a linear programming equation for the
above problem.
Solution for Problem 1
• X1 – No. of Boats produced Profit for X1 is Rs. 20 Paper req
100
• X2 – No. of Planes produced Profit for X2 is Rs. 50 Paper req 200
• Total availability of paper – 400 sq cm
• Objectives
Zmax = 20 X1 + 50 X2
• Constraints
100X1 + 200X2 <= 400
X1, X2 >= 0
Linear Programming – Problem 2
• A company makes two kinds of leather belts. Belt A is a high quality
belt and belt B is of lower quality. The respective profits are Rs 4 and
Rs 3 per belt. The production of each of type A requires twice as
much as a belt of type B, and if all belts were of type B, the company
could make 1,000 belts per day. The supply of leather is sufficient for
only 800 belts per day (both A and B combined). Belt A requires a
fancy buckle and only 400 per day are available. There are only 700
buckles a day available for belt B.
• Formulate this problem as an LP model.
Profit Time Leather Buckle A Buckle B
Solution Belt A – X1
Belt B – X2
4
3
2 min
1 min
1
1
1
-
-
1
Total 1000 min 800 400 700
• Objective
Zmax = 4 * X1 + 3 * X2 Zmax = 4X1 + 3X2
• Constraints
Time: 2*X1 + 1*X2 <= 1000 2X1 + X2 <= 1000
Leather: 1*X1 + 1*X2 <= 800 X1 + X2 <= 800
Buckle A: 1*X1 + 0*X2 <= 400 X1 <= 400
Buckle B: 0*X1 + 1*X2 <= 700 X2 <= 700
X1, X2 >= 0
Rs. 20
Problem A–
x,y,z
Rs. 40 B
– x,y,z
Cost X Y Z
A - X1 20 36 3 20
B - X2 40 6 12 10
Total 108 36 100
Cost X Y Z
A - X1 20 36 3 20
Solution B - X2 40 6 12 10
Total 108 36 100
• Objective
Zmin = 20X1 + 40X2
• Constraints
X: 36X1 + 6X2 >= 108
Y: 3X1 + 12X2 >= 36
Z: 20X1 +10X2 >= 100
X1, X2 >= 0
Problem
Variable Exposure Overall Budget TV Budget Women customers No.s cond1 No.s cond2
X1 – Prime day 4,00,000 40000 40000 3,00,000 >= 3
X2 – Prime time 9,00,000 75000 75000 4,00,000 >= 2
X3 – Radio 5,00,000 30000 2,00,000 5 to 10
X4 - Magazine 2,00,000 15000 1,00,000 5 to 10
Total 8,00,000 5,00,000 20,00,000
Variable Exposure Overall Budget TV Budget Women customers No.s cond1 No.s cond2
Solution
X1 – Prime day
X2 – Prime time
4,00,000
9,00,000
40000
75000
40000
75000
3,00,000
4,00,000
>= 3
>= 2
X3 – Radio 5,00,000 30000 2,00,000 5 to 10
X4 - Magazine 2,00,000 15000 1,00,000 5 to 10
Total 8,00,000 5,00,000 20,00,000
• Objective:
Zmax = 400000X1 + 900000X2 +500000X3 + 200000X4
Constraints:
40000X1 + 75000X2 + 30000X3 + 15000X4 <= 8,00,000
40000X1 + 75000X2 <= 5,00,000
3,00,000X1 + 4,00,000X2 +2,00,000X3 + 1,00,000X4 >= 20,00,000
X1 >= 3, X2 >= 2
5 <= X3, X4 <= 10
X1, X2, X3, X4 >= 0
Problem
Problem
A Company manufactures two different types of Products P1 and P2.
Each product requires processing on milling machine and drilling
machine. But each type of machines has limited hours available per
week. The net profit per unit of products, resource requirements of the
products and availability of resources are summarized in Table
Machine Type Processing time (hours) Machine hours
Product P1 Product P2 available per week
• Objective
Zmax = 250X1 + 400X2
• Constraints
• Milling: 2X1 + 5X2 <= 200
• Drilling: 4X1 + 2X2 <= 240
• X1, X2 >= 0
Converting into equality
• 2X1 + 5X2 = 200
• 4X1 + 2X2 = 240
Solution X2
Graph
Equation
• 2X1 + 5X2 = 200 (1)
• 4X1 + 2X2 = 240 (2)
• In Equation (1) – Milling 120
4X1 + 2X2 = 240
• Sub X1 = 0, X2 = 40 100
• Sub X2 = 0, X1 = 100
80
• In Equation (2) - Drilling 60
• Sub X1 = 0, X2 = 120
40
• 4*0 + 2*X2 = 240 2X1 + 5X2 = 200
20
• 2X2 = 240 -> X2 =240 /2 =
120 0
X1
• Sub X2 = 0, X1 = 60 20 40 60 80 100 120
Solution
• Points ( X1, X2) Zmax = 250 X1 +400 X2
•A ( 0, 40) Za = 250*0 + 400*40 = 16000
•B (50, 20) Zb = 250*50 + 400*20 = 20500
•C (60 , 0 ) Zc = 250*60 + 400*0 = 15000
• 4X1 + 2X2 = 240 -> 1
• 2X1 + 5X2 = 200 -> 2 Quantity of production
recommended for P1 and P2 is
• 4X1 + 2X2 = 240
50 and 20 respectively, so that
• 4X1 + 10X2 = 400 maximum profit f Rs. 20,500
can be achieved.
• 4X1 + 10X2 = 400
• 4X1 + 2X2 = 240
•- - -
• 8X2 = 160 A
• X2 = 160 / 8 = 20 B
• Sub X2 = 20 in equ 1
• 4X1 + 2*20 = 240 -> 4X1 + 40 = 240 C
• 4X1 = 240 -40 -> X1 = 200 / 4 = 50
Rs. 20
Problem A–
x,y,z
Rs. 40 B
– x,y,z
Cost X Y Z
A - X1 20 36 3 20
B - X2 40 6 12 10
Total 108 36 100
Cost Vit X Vit Y Vit Z
A - X1 20 36 3 20
Solution B - X2 40 6 12 10
Total 108 36 100
• Objective
Zmin = 20X1 + 40X2
• Constraints
X: 36X1 + 6X2 >= 108
Y: 3X1 + 12X2 >= 36
Z: 20X1 +10X2 >= 100
X1, X2 >= 0
Solution
36X1 + 6X2 = 108 ->1 X2
• In equ 1 14
12
• Sub X1=0, 6X2=108, X2=108/6 = 18
10
• Sub X2=0, 36X1=108, X1=108/36 = 3 8
• In equ 2 6
4 20X1 +10X2 >= 100
• Sub X1 = 0, 12X2=36, X2 = 36/12 = 3
2
• Sub X2 = 0, 3X1=36, X1=36/3 = 12 3X1 + 12X2 >= 36
0
• In equ 3 X1
2 4 6 8 10 12 14 16 18
• Sub X1 = 0, 10X2=100, X2 = 100/10 = 10
• Sub X2 = 0, 20X1=100, X1 = 100/20 = 5
Solution • 20X1 + 10X2 = 100 -> 2
• Points ( X1, X2) • 3X1+ 12X2 = 36 -> 3
• A ( 0,18) • Mul Equ (2)*12 ,Equ (3)*10
• B ( 2 , 6) • 240X1 + 120X2 = 1200
• C (4,2) • 30X1 + 120X2 = 360 (Sub)
• D (12 ,0) • 210X1 = 840 -> X1 = 4
• 36X1 + 6X2 = 108 -> 1 • Sub X1 = 4, in Equ 2
• 20X1 + 10X2 = 100 -> 2 • 20*4 +10X2 = 100 -> 10X2 = 100 – 80
• Mul Equ (1) * 10 , Equ (2) * 6 • X2 = 20/10 -> X2 = 2
• 360X1 + 60X2 = 1080 • Sub A, B, C & D in Zmin = 20X1 +40X2
• 120X1 + 60X2 = 600 (Sub) • Za = 20*0 + 40*18 = 720
• 240X1 = 480 -> X1 = 2 • Zb = 20*2 + 40*6 = 280
• Sub X1 = 2, in Equ 2 • Zc = 20*4 + 40*2 = 160 Conclusion:
Buying 4 numbers of Product A and
• 20*2 +10X2 = 100 -> 10X2 = 100 – 40 • Zd = 20*12 + 40*0 = 240
2 numbers of Product B is best
• X2 = 60/10 -> X2 = 6 decision at minimal cost of Rs. 160
Linear Programming – Problem 2
• A company makes two kinds of leather belts. Belt A is a high quality
belt and belt B is of lower quality. The respective profits are Rs 4 and
Rs 3 per belt. The production of each of type A requires twice as
much as a belt of type B, and if all belts were of type B, the company
could make 1,000 belts per day. The supply of leather is sufficient for
only 800 belts per day (both A and B combined). Belt A requires a
fancy buckle and only 400 per day are available. There are only 700
buckles a day available for belt B.
• Formulate this problem as an LP model.
Profit Time Leather Buckle A Buckle B
Solution Belt A – X1
Belt B – X2
4
3
2 min
1 min
1
1
1
-
-
1
Total 1000 min 800 400 700
• Objective
Zmax = 4 * X1 + 3 * X2 Zmax = 4X1 + 3X2
• Constraints
Time: 2*X1 + 1*X2 <= 1000 2X1 + X2 <= 1000
Leather: 1*X1 + 1*X2 <= 800 X1 + X2 <= 800
Buckle A: 1*X1 + 0*X2 <= 400 X1 <= 400
Buckle B: 0*X1 + 1*X2 <= 700 X2 <= 700
X1, X2 >= 0
Solution
2X1 + X2 = 1000 -> 1 X2
X1 + X2 = 800 -> 2
X1 = 400 -> 3 1000
X2 = 700 -> 4
• In Equ (1)
900
• Sub X1 = 0, X2 = 1000 800
• Sub X2 = 0, X1 = 500 A B
• In Equ (2)
700
C
• Sub X1 = 0, X2 = 800 600
• Sub X2 = 0, X1 = 800
• X1 = 400 500
• X2 = 700 400
• A ( 0, 700)
• B (100,700) 300
• X1 +X2 = 800, X2 = 700 -> X1 = 100 200 D
• C ( 200, 600)
• 2X1 + X2 = 1000 100
• X1 + X2 = 800 (Subtraction) E
• X1 = 200 -> Sub X1 =200 in X1+ X2 = 800 -> 200 + X2 = 800 -> X2 =
600 100 200 300 400 500 600 700 800 900 X1
• D ( 400, 200)
X1 = 400, 2X1 + X2 = 1000 -> X2 = 200
• E (400,0)
Solution
• A (0,700) Zmax = 4X1 + 3X2
• B (100,700) • Za = 2100
• C (200,600) • Zb = 2500
• D (400,200) • Zc = 2600
• E (400,0) • Zd = 2400
• Ze = 1600
Solution:
X1 = 200, X2 = 600 and Zmax = 2600
The company can produce 600 of Belt B and 200 of Belt A to
achieve the maximum profit of Rs. 2600
Special Cases in Graphical Solution