MP1 19CS2104 Tutorial Problems
MP1 19CS2104 Tutorial Problems
TUTORIAL: 1
PRE-TUTORIAL:
1. Write the algorithm for Linear Programming Graphical Method. Define the following:
a. Objective Function.
b. Decision Variables.
c. Constraints.
d. Non negativity Restrictions.
e. Feasible Solution.
Maximize C=3a+2b
Subject to the constraints
a+2b≤10
3a+b≤15
a,b≥0
Minimize
4p + 5q + 6r
Subject to:
p + q >= 11
p - q <= 5
r-p-q=0
7p >= 35 – 12q
IN TUTORIAL:
1. An Industry started in producing A and B, two products. These two products need two
resources, machine power and man power. For product A, require 13 machine power and 20 man
power. For the product B, require 19 machine power and 29 man power. Industry has 40 hrs of
machine power which is available in the coming working week but only 35hrs of man power.
The cost of machine power is $10 per hour worked and man power is $2 per hour worked. Both
machine and manpower idle times incur no costs. The revenue received for each product
produced (all production is sold) is $20 for A and $30 for B. For a customer, Industry has a
specific contract to produce 10 products of A per week.
Formulate the problem of deciding how much to produce per week as a linear program
and represent the linear program graphically.
Solve the problem using python
2.An Industry makes two items of P and Q by using two devices X and Y. Processing time
requires 50hrs for item P on device X and 30hrs requires on device Y. Processing time requires
24hrs for item Q on device X and 33hrs requires on device Y. At starting of the current week, 30
pieces of A and 90 pieces of B are available. Processing time that is available on device X is
predict to be 40hrs and on device Y is predict to be 35hrs. Demand for P in the current week is
predict to be 75 pieces and for Q is predict to be 95 pieces. Industry policy is to maximize the
combined sum of the pieces of P and the pieces of Q in stock at the end of the week. Formulate
the problem of deciding how much of each item to make in the current week as a linear
program.Solve this linear program graphically.
POST-TUTORIAL:
1. Maximize
Z=4x+3yZ=4x+3y
Subject TO:
x≥0
y≥2
2y≤25–x
4y≥2x–8
y≤2x−5
Solve LP graphically using python
2. A cabinetmaker makes benches and desks. Each bench can be sold for a profit of $30 and each
desk for a profit of $10. The cabinetmaker can afford to spend up to 40 hrs per week working and
takes 6 hrs to make a bench and 3 hrs to make a desk. Customer demand requires that he makes at
least 3 times as many desks as benches. Benches take up 4 times as much storage space as desks
and there is room for at most four benches each week. Formulate this problem as a linear
programming problem and solve it graphically.
TUTORIAL: 2
PRE-TUTORIAL:
1. Write the algorithm to solve the simple simplex method. What is the usage of slack
variables?
Maximize:
Subject to:
2x + 3y ≤ 6
3x + 7y ≤12
Setup the Initial Simplex Tableau.
IN-TUTORIAL:
1). A hotel has requested a manufacturer to produce pillows and blanketsfor their room
service. For materials, the manufacturer has 750 m² of cotton textile and 1,000 m² of silk.
Every pillow needs 2 m² of cotton and 1 m² of silk. Every blanket needs 2 m² of cotton and 5
m² of silk. The price of the pillow is fixed at $5 and the blanket is fixed at $10.What is the
number of pillows and blankets that the manufacturer must give to the hotel so that these
items obtain a maximum sale? Formulate and Solve using Python.
2. Kiran owns a petroleum company, which consists of two refineries.Refinery 1 costs $32,000
per day to operate, and it can produce 455 barrels of high-grade oil, 280 barrels of medium-
grade oil, and 232 barrels of low-grade oil each day. Refinery 2 is newer and more modern. It
costs $40,000 per day to operate, and it can produce 350 barrels of high-grade oil, 438 barrels of
medium-grade oil, and 522 barrels of low-grade oil each day. The company has orders totaling
25,625 barrels of high-grade oil, 24,992 barrels of medium-grade oil, and 29,568 barrels of low-
grade oil. How many days should it run each refinery to minimize its costs and still refine
enough oil to meet its orders? Formulate the problem and solve using Python.
POST-TUTORIAL:
1. Maximize Z=3 x1 + 5 x2
Subject TO:
3 x1 + 2 x2 =18
X1 <= 4
2 x2 <= 12
X1 >=0
X2 >= 0
Maximize: P=40x1+35x2
3x1 +2x2<=60
X1,x2 >=0
TUTORIAL: 3
PRE-TUTORIAL
2. Minimum Z=x1+x2
Subject to:
2x1 + x2 >=4
X1 + 7x2 >=7
IN-TUTORIAL:
1. Minimize: z = x1 + x2 + x3 + x4 + x5
Subject to:
Subject to
p1 + 3p2 + p3 ≤ 5
2p1 – p2 + p3 ≥ 2
4p1 + 3p2 – 2p3 = 5
POST-TUTORIAL:
Subject to:
X1 – x3 <=10
X2 + x3 >=10
Subject to
PRE-TUTORIAL:
1. State the general rules for formulating a dual LP problem from its primal?
2. Minimize C=5x1+2x2
X1+3x2 >=15
X1,x2 >=0
Minimize C = 16 x1 + 45 x2
X1 + 3x2 ≥ 27
X1, x2 ≥ 0
IN-TUTORIAL:
Subject To:
X1,x2 >=0
A B
C 22ml 31ml
D 20ml 38ml
POST-TUTORIAL:
1. Minimize: C= 16x1+8x2+4x2
X1,x2,x3 >=0
Apply dual method and find the optimal solution for minimization problem
2. A producer of Healthy food makes two important and secret ingredients that goes into their
human food, named as a HealthyMan and CommonMan. Each kg of HealhyMan contains 300 g
of vitamins, 400 g of protein, and 100 g of carbs. Each kg of commonMan contains 100 g of
vitamins, 300 g of protein, and 200 g of carbs. Guidelines for minimum nutritional that require a
mixture made from these ingredients contain at least 900 g of vitamins, 2200 g of protein, and
800 g of carbs. HealthyMan costs $2.00 per kg to produce and CommonMan costs $1.25 per kg
to produce. Find the number of kgs of each ingredient that should be produced in order to
minimize cost.
PRE-TUTORIAL:
1)What is sensitive analysis and mention some methods and uses in sensitive analysis and also
write an algorithm to construct a sensitivity analysis for a given lpp.
Maximum =2x1+(3/2)x2
Subject to:
3x1+4x2<=1000
6x1+3x2<=1200
X1<=180
X1,x2>=0
2)There is a paint manufacturing company they make three types of paints of colours red ,blue
and brown they are distributing to two shops they are A and B For these shops they need :For
shop A they need 1 unit of red colour ,1 unit of blue colour ,3 units of brown colour.For shop B
they need 12 units of red colour ,4 units of blue colour ,10 units of brown colourThe paint
manufacturing company can have total availability of providing the paint for shop A is 20 lits
and for shop B is 90 lits the paint manufacturing company can make the profit of 5 Rs on red
paint 5 Rs on blue paint 13 Rs on brown paint Now the paint manufacturing company wishes to
maximize its profit .
Find how many lits of paint will be distributed by paint manufacturing company by using
sensitivity analysis.
IN-TUTORIAL:
1.A company wants to produce 3 type of products x , y, z. The unit profit of these products are
Rs.3 , Rs.5, Rs.4. These products require two types of resources : man power and raw material.
Maximize z=3x1+5x2+4x3
Subject to: x1+ x2 + x3<=4
X1+4x2+7x3<=9
X1,x2,x3 >=0
a) Find the optimal product mix and the corresponding profit of the company.
b) Find range of profit contribution of products X and Z in the objective function such that
current optimal product mix remains unchanged.
c) What shall be the new optimal product mix when profit per unit from product z is Rs.13
instead of Rs.4?
d) Discuss the effect of change in the availability of resources from [4,9] to [9,4]
e) Which resource(s) should be increased (or decreased) to get best marginal increase of the
objective function?
Solve the above question through sensitivity analysis.
POST-TUTORIAL:
1. Solve the given problem using sensitivity analysis and implement using Excel Solver.
Model+=250x1+225x2+300x3(objective function)
Constraints::
Model+= 12x1+10x2+16x3<=120
Model+= 21x1+40x2+20x3<=300
Model+= A<=16
Objective function:
Profit+= 10x1+9x2
Constraints:
Profit+=(7/10)x1+x2<=630
Profit+=(1/2)x1+(5/6)x2<=600
Profit+=x1+(2/3)x2<=700
(1/10)x1+(1/4)x2<=135
TUTORIAL:6
PRE TUTORIAL
The Amulya Milk Company has three plants located throughout a state with production capacity
50, 75 and 25 gallons. Each day the firm must furnish its four retail shops R 1, R2, R3, & R4 with
at least 20, 20, 50, and 60 gallons respectively. The transportation costs (in Rs.) are given below.
Retail Shop
Plant Supply
R1 R2 R3 R4
P1 3 5 7 6 50
P2 2 5 8 2 75
P3 3 6 9 2 25
Demand 20 20 50 60
The economic problem is to distribute the available product to different retail shops in such a
way so that the total transportation cost is minimum.
IN TUTORIAL
Luminous lamps have three factories - F1, F2, and F3 with production capacity 30, 50, and 20
units per week respectively. These units are to be shipped to four warehouses W 1, W2, W3, and
W4 with requirement of 20, 40, 30, and 10 units per week respectively. The transportation costs
(in Rs.) per unit between factories and warehouses are given below.
Warehouse
Factory Supply
W1 W2 W3 W4
F1 1 2 1 4 30
F2 3 3 2 1 50
F3 4 2 5 9 20
Demand 20 40 30 10
POST TUTORIAL
GM Textiles units located at Chennai, Coimbatore and Madurai. GM Textiles produces ready-
made garments at these locations with capacities 6000, 5000 and 4000 units per week at
Chennai, Coimbatore and Madurai respectively. The textile unit distributes its ready-made
garments through four of its wholesale distributors situated at four locations Bangalore,
Hyderabad, Cochin and Goa. The weekly demand of the distributors is 5000, 4000, 2000 and
4000 units for Bangalore, Hyderabad, Cochin and Goa respectively.
The cost of transportation per unit varies between different supply points and destination points.
The transportation costs are given in the network diagram.
The management of GM Textiles would like to determine the number of units to be shipped from
each textile unit to satisfy the demand of each wholesale distributor. The supply, demand and
transportation cost are as follows:
Production Capacities
Demand Requirements
Initial Basic Solution in Transportation problem using Row Minimum method in Linear
Programming.
PRE TUTORIAL
W1 W2 W3
F1 16 20 12 200
F2 14 8 18 160
F3 26 24 16 90
IN TUTORIAL
The Ushodaya departmental store has three plants located throughout a state with production
capacity 80, 60 and 70 kilo grams of rice. Each day the firm must furnish its four retail shops R 1,
R2, R3, & R4 with at least 40, 60, 50, and 60 gallons respectively. The transportation costs (in
Rs.) are given below.
Retail Shop
Store Supply
1 2 3 4
1 3 5 7 6 80
2 2 5 8 2 60
3 3 6 9 2 70
Demand 40 60 50 60
POST TUTORIAL
The distribution manager of a company needs to minimize global transport costs between a set of
three factories (supply points) S1, S2, and S3, and a set of four distributors (demand points) D1,
D2, D3, and D4. The following table shows the transportation cost from each supply point to
every demand point, the supply of the product at the supply points, and the demand of the
product at the demand points
F/D D1 D2 D3 D4 Supply
S1 19 30 50 10 7
S2 70 30 40 60 9
S3 40 8 70 20 18
Demand 5 8 7 14 34
TUTORIAL: 8
8) Initial Basic Solution in Transportation problem using Column Minimum method in Linear
Programming and also check optimality with stepping stones method.
PRE TUTORIAL
Distribution centre
D1 D2 D3 D4 Supply
P1 19 30 50 12 7
Plant P2 70 30 40 60 10
P3 40 10 60 20 18
Requirement 5 8 7 15
The cost of transportation per unit varies between different supply points and destination points.
The transportation costs are given in the table.
U/S Supply
BGR HYD CON
BZA 15 60 35 15
HYD 45 30 60 30
CHE 30 90 20 20
Demand 5 20 40
POST TUTORIAL
Boutique brewery has two warehouses from which it distributes beer to five carefully chosen
bars. At the start of every week, each bar sends an order to the brewery’s head office for so many
crates of beer, which is then dispatched from the appropriate warehouse to the bar. The brewery
would like to have an interactive computer program which they can run week by week to tell
them which warehouse should supply which bar so as to minimize the costs of the whole
operation. For example, suppose that at the start of a given week the brewery has 1000 cases at
warehouse A, and 4000 cases at warehouse B, and that the bars require 500, 900, 1800, 200, and
700 cases respectively. Which warehouse should supply which bar?
From Warehouse to
A B
Bar
1 2 3
2 4 1
3 5 3
From Warehouse to
A B
Bar
4 2 2
5 1 3
TUTORIAL:9
9. Develop a python program to demonstrate the Transportation problem using Modi method
(Initial solution can be of any method) in Linear Programming.
PRE TUTORIAL
A firm has 3 factories - A, E, and K. There are four major warehouses situated at B, C, D, and M.
Average daily product at A, E, K is 30, 40, and 50 units respectively. The average daily
requirement of this product at B, C, D, and M is 35, 28, 32, 25 units respectively. The
transportation cost (in Rs.) per unit of product from each factory to each warehouse is given
below:
Warehouse
Factory B C D M Supply
A 6 8 8 5 30
E 5 11 9 7 40
K 8 9 7 13 50
Demand 35 28 32 25
The problem is to determine a routing plan that minimizes total transportation costs.
IN TUTORIAL
The Sunrise Coffee company has three plants located throughout a state with production capacity
7, 10 and 18 gallons. Each day the firm must furnish its four retail shops D 1, D2, D3, & D4 with at
least 5, 8, 7, and 15 gallons respectively. The transportation costs (in Rs.) are given below.
D1
D4 Supply D3 D4 Supply
D2 D3
Plant 12
7
P1 19 30 50
P2 70 30 40 60 10
P3 40 10 60 20 18
Requirement 5 8 7 15
The economic problem is to distribute the available product to different retail shops in such a
way so that the total transportation cost is minimum.
POST TUTORIAL
The XYZ Sawmill Company’s CEO asks to see next month’s log hauling schedule to his three
sawmills. He wants to make sure he keeps a steady, adequate flow of logs to his sawmills to
capitalize on the good lumber market. Secondary, but still important to him, is to minimize the
cost of transportation. The harvesting group plans to move to three new logging sites. The
distance from each site to each sawmill is in Table. The average haul cost is $2 per mile for both
loaded and empty trucks. The logging supervisor estimated the number of truckloads of logs
coming off each harvest site daily. The number of truckloads varies because terrain and cutting
patterns are unique for each site. Finally, the sawmill managers have estimated the truckloads of
logs their mills need each day. All these estimates are in Table.
Develop a python program to demonstrate the Assignment problem using Hungarian method.
PRE TUTORIAL
The Funny Toys Company has four men available for work on four separate jobs. Only one man
can work on any one job. The cost of assigning each man to each job is given in the following
table. The objective is to assign men to jobs in such a way that the total cost of assignment is
minimum.
Job
Person 1 2 3 4
A 20 25 22 28
B 15 18 23 17
C 19 17 21 24
D 25 23 24 24
IN TUTORIAL
They run on one month (30 days) cycles, we have one cycle to show we can provide value.
There is one robot, 2 engineers and one detailer in the factory. The detailer has some holiday off,
so only has 21 days available.
POST TUTORIAL
Solve a simple problem regarding production scheduling. Imagine that you work for a company
that builds computers. A computer is a fairly complex product, and there are several factories
that assemble them which the company pays a certain amount per unit. The cost of this computer
model on the market is fixed at 500$, different factories assemble the computers at different
speeds and costs. Factory f0 produces 2000 per day at 450$ per unit, factory f1 1500 per day at
420$ per unit and f2 1000 per day at 400$ per unit. We have 1 month to assemble 80 000 units
under the constraint that no factory is to produce more than double the units than any other
factory. The question is what is the optimal production allocation between the factories such
that we maximizethe profit obtained from selling the computers under those constraints?
TUTORIAL: 11
PRE TUTORIAL
The owner of a machine shop us planning to expand by purchasing some new machines
—press and lathes. The owner has estimated that each press purchased will increase
profit by $100 per day and each lathe will increase profit by $150 daily. The number of
machines the owner can purchase is limited by the cost of the machines and the available
floor space in the shop. The machine purchase prices and space requirements are as
follows:
Press 15 $8,000
Lathe 30 4,000
The owner has a budget of $40,000 for purchasing machines and 200 square feet of
available floor space. The owner wants to know how many of each type of machine to
purchase to maximize the daily increase in profit
IN TUTORIAL