@KLWKS - Bot MP TUTORIAL 1-6
@KLWKS - Bot MP TUTORIAL 1-6
Learning outcomes:
1.1 PRE-TUTORIAL
)Decison Vaviables: The Vaviables which e take in LPP pvoblem to take the Decision
The Graphical Method for soling bnear Proqvamming Acblems (L) Can only be usd
wben the problem invlues buo decisicn yable5- This method is pavticwarly
efective for visalisig theaiole region, cornsbrants and the cbjectve functicn
h n eLma k s h
Mathematical Proguig TUTORIAL J JORMOLAON O LPP
1.2 IN-TUTORIAL
pnts (1 mit) ne 2n' ol silk d lurot cotlon Ev jcket leod- I j' ototton d
pants and jacketsthat the ntacuuer mst give to the otel so that thes ites obtan
: x u sal? Fmulate tle poblem g :theatical od e o LPP fur the
objcctive function?
Solution:
)Decision Variables: Let and x, dencte the nunbey of pants ond number of
jackets vespectively
i) objective Funchion:
Profit on X, pants =S0x,
Profit on Z jackets= t0
Let z= SOx + t0xy which is the objscbiae
funclion
Manz= S0x, t tox
i) Consbraints:
We make the follouoirng table fom given data
Iten
n
Pents
L a k s i Jackets Availabiliby
1000
Silk
750
15
50 40
Pice
I000
i) Non-negptke Resbictions:
Snz Sox, +9ox
Subject to 8x, tXSlooo
Consbraints 10
Decision
Vaviables
Mathennatical Progranminz IUTORAL I FOR\IULAUON OT LPP
2. Atransport compun ln tho Npes of tncks. Tvpe Aand Type B Type Ahas e1 yetrd
capacity of 2 0 datlot-ehigvtdcaparity of 0n' while Type Bhas rergatda
pacity of 30andw-etugeated capacity of M Agocer evds to lirck ton tle
traisport of 3000of ebgeated stock and 0ot oeigeratel stock Te t p
kilometer of aTvpe A is $3)and $I0 for Type B How manv trucks of each tvpe hond he
grocer rent to alieve the minimun total cost Formulate the problem sng matheulalical
modeling of LPP and dene the objective fuxtion
Solution:
ypeA and Xa be the trcks of
) Decision Vaviables : Let x be the tucks of
Type B
Ö) ohjecive funcion:
Cost per kilcmeter of x, ype-A Tucks = 30
Cost pex kilbmete of Tupe-B Trocks =40
objective funchion
Let z-3o x, + tox,, which is the
Min z=3ox,+ 40a
Type-A Type-B
3000
Yef 30
non-vef
ii) Conditions:
i) Non-'eqative Resbiclions:
Min Z-30x +40
Subject to constaints:
dox +3o >B00o
11
Mathematical Programming TUTORIAL I FOR\MULAION ) LPP
3. A hotel las requested a mamrctuer to produce pillows ad blaukets fon then 00LMV
For materials, the manutactuuer has 75b' of cotton textile ad 1000m' of silk Evey pillow
es 22 of cotton and Im' of silk. Eery blauket necds 2)' of cottonad 'of silk
The price of the pillow is fixed at $5 dthe blnke is fixed at $10 WLt i the nunbe of
Dillows and blankets that the mutacuer ust gie to te lotclso that theeiteU obtan
a axinnumsale? Fornnulate and Solve sing Python.
Solution:
K o n e
L r u
a k s t l e h
12
Mathenatical Programming TUTORIAL I FORMULATION OF LPP
1 Au Industrv makes two ites of P and Q ly using two devies Xand Y Prosg ti
requies 5) lirs on item P on device Xand 30 bus evquies on dlevice Y Pronsng t
requires 21lns fon item Qondevice Xad 33 hrs reyuires on device Y A stautng of tlu
current wek. 30 piso ! d90 pics of B are available ProossilIg tinet t alble
on device X pedict to be 0 hrs and on device Y is pdict to be 35 hrs. DeLd for P'
in the curent woek is predict to be 75 pieces and for Q is predict to be 93 piees Itustrv
policy is to naximize the combined sunof the pieces of P and the picces of Q in stock at the
end of the week Fornulate the problen of deciding how much of cach item to uake n the
curent wek as alinear prugran1. Obtain the solution Ising graphical method.
Solution.
P
X:P
33 35
Max XPy
Sox t y < to
30x+33y 35
2<30
Y<90
o
275
30 x |so0x + 7a0y = lao0
y>95
ISoo XtI6Soy 17so
99oy 550
X=0
A ’ ) ’/
B’ (o-6,0s)’1-t(mas)
14
\lathematical Progrmning TUTORLAL L FORMULATION OL P
3r 7y 12
Solution:
Max P=+lay
3x+7y <ta
3x+7y 1a
3xO
5y >6
y-1-a)
15
16
hL
o au
k eru
aa-8 value
ofmaxirnum B(a)
has point The
&|C’
8a-8(ax) B’
A’1a ave values Max
C’3,)
(o) A
6
FOR\ULATON
LPI' OF TUTORUALI Prograning \lathematical
latlhenatical Proganuing TUTORAL I FOR\1GLATON OF LPP
.3 POST-TUTORIAL
Engineering Thdosbies :
Engineering Industies use lineav programming to sove design and monufackunng
Problems and to get the maximom output fom agiven condition
lonufactuing Indusbies:
Trdusbies 0se lineav progranmito maximi ze the profit of
Manufactoing
cost
the Companies and to veduce the manufpetoing
Energy Indusbies
to optinize their produchion output
Energy cermponicssose linear progranming
Transpotatiog trdusties:
proqgramning is also used in transportatien industbies to find the pal
Line
bransportobion
to minirnize the costcf
17
Mathematical Progtaning TUTORLAL I FOR\MULATION OF LPP
3 AconaN oWns two flour nulls viz A dB. whh hve btlerent produton cjpauti
for lhigh. ehum ad low-qualhty flour The oup b Cntercd a ontD o spplv
flou to ahn everv month with at least 8. 12 and 2Lqutals ol bigh. nebum al o
qualitveivel Itcosts the company Rs 2000 and R 1300 er dayto uD A t B
respetivel On adav. Mill Aproduces 6. 2aud Iquntah of higb. eeliunn ad ow- yuabtv
tBou \hill Bpodes 2. 4and 12 quintas of lbig. uwund low-uadity tlouy epwnely
How may days peT Month should each mill be operated in oder to meet the contact orde
most cc0nomicallv? Formmulate the LPP.
Solution
Step1:Decision Variables
Xbe thenocf doys NAis operatud permonth
y be the novof days MillB is operated per month
Step B: Ohjective function
Total cost of oper ting (lilA, ill8
Mino00x +|500y
Sbep3:Subject to constrcints
High Quality Fbor: 6xtoy>8
Medium yolty ax+y>la
Btep LPP
Minz000x +ISo0y
Sobject to:
6x+ ay >
41ay >a9
here X20, Yo
18
latenatical 'ogming TUTORIAL I FORNULATION 0F LIP
Female custoreekpasUre'
lso000 X+ L20,000t ty000~ +So, o00 Ea >jog,000
Mathemat ical Progaming TUTORIAL. I FORMULATION OF LPP
Hagazine adget
Step 4: LPP
iax z = oo,000x+6,00, 000yts9000Z t,00, 000Ea
Subject to :
20
latbenatical Pogunming TUORIAL I FORMOLATION OF LP
Storoge
Step 4: Pp
Maxt3ox+loy
Sokject to:
s+3y <to’l
21
3*-y09 Y>3
4xty<4’z
AMathenatical Programmng TUTORIAL I FORMULATION OF LPP
Pts ave
4 (a.), (o) Io
A-(»9),8-(0),c-to9)
(oo) 30(0)t/o(o) =o
3
3o(o) +io4)- 40
Z=40
Date of Evaluation:
22
Tutorial 2
Learning outcomes:
" Understanding the key terms: feasible solution, feasible regjon and optinal solutim.
Understanding the limitatious of graphical metho and introduce the Sinplex alyorithn.
" Understand that an LPP consists of more unber of constraints as compared to mumber of
decision variables.
" Understanding the computational procedure can be considerably reduced by convertáng the
LPP into a form called as Dä¬= and then solving it.
a k s i
2.1 PRE-TUTOR0AL
1. Which type ofLP.P. can be solved using Simplex method?
A) Dinear
11) Decision Vaviables
iúi) Egpality Constraints
iv) Feasible Stontirg foint
v)Bounded easibe Region
vi) Nenpegative Consbaints
23
Mathematical Progamng TUTORIAL 2 SOLVING LPP
i) Feasible Regicn means also knoun as the feasi ble setj is the setof all
Poseible Cormbinations cf values for decisian vaviobles that satishy ol
of proolems Consbaints
i) Feasible Solulin meons isa specificsel of values for decision vajables
that satisfies all the constaints cf thé lineav prograramnirg problem, it
is a point
ii) optimatSolotion reans bhe best possible solution within the feasible vegion,
as detmined by the ohj function.
primal?
3. State the general rules for formulating a dual LPP from its
DRrimal Pcblem
ii Duad Variables
i) Dual PF
i) Dual Consbthts
y Dual Cehsbaints computed variables
vi) ConpkteDial ceprcblem
24
Alenaical 'hong |UTORIAL 2 SOL\IVG LP
2.2 IN-TUTORIAL
|Consde He tollow lem ptogamg polblem
P
12y
3r+7y <12
Solution:
25
\lathcuatical Progtanmg TUTORIAL 2 SOLVIVG LPP
B S1 Sa Ratio
Ce
$1
51 5/4
L k s h l l 4 i
*(0)+ax la
S1= 6/7
sa-p
26
\latheacal ogamuy
K o n e
L rauk s h L E
a ld
a i
u w a s e e o t
27
2 ) 20
Solutiom
A
3 1
3. State the dual for the following LPP and hence solve LPP.
K o u e m
Solution:
A-[
The Dual function:
Max z lay,tya
dy,t 34as a
28
5y,+ 79a 50
where y,.Ya>0"
Matbematical Progtanwing TUTORIAL 2 SOVIVG LPP
Bv Ce 51 Ratio
al 3
Sa
-1a toS
-o /3
-3
Aj -f3
-
-7 3
3
4-3
*)
29
sloud the dot tomc h ocition ad o which outlts should hey sed them?
B
C2ml 31nl
D 20 ml 38 ml
KAD: AtoD = aO
9 RoomC
8c.B toc-31
2 Room D
XgpBtoo 38
of,
Mio z (5wt ox+ ly t l3
Min 2 aXAc + 20XAot 3) Xect 38 xBO
Consbaints
XAC t XBC 12
wty a
XAc tXAp> 15
Yect Xeo, 20
AC f XAtBctXeo >30
Xgo0
Dual
U,= hc t XAD
31
|ORIAL! SOL\IVG LIP
aty 38
W a, , Vao
Grophical method s not opplicable
Simplex method is applicable
I3 |5 -30
B-V Sol Rotio
U Va W
S1
31
S3
38 32
13 30
Entering yoicbte W
Leovingaiable : S3
32
\Lhmalcal Pogruuw TUTOKAL! SOLVING L
2.3 POST-TUTORIAL
12
Solution
K o uL
e m
a
33
S1 Sa S3
S1 3 o
14
S3
-3
S1 -|
S3 6
34
Mathenatical Programmi1g TUTORIAL 2. SOLVING LPP
XA=6
S1= 6
K o n e
L r u
a k s u a
L i d
l c
t a t o
35
\Mathematical P'hogamg
Sube o 3
12
Solution
Primal Aoblem
Min C- l6x,+8x)+473
Subject to:
Dual froblern:
Max C= 6y,+ |
Subject to
1
36
thematical Progtatn TUTORIAL 2 SOLVING LPP
umplex telhod
4
3V Bv s1 53 Rotio
S1 I6 I6/3
4 3
S3
G 16
BV 8V Sa S3 Soln Ratio
3)s
1
16
4
Sa S3 SoI Ratio
4 O4 6"2
sa
31-a
-I6 -S
37
Mathenatical l'omm TUTORIAL 2 SOLVIN, LPD
Xo4
4i:31-a
t o t s
F i t i t t o t L t
L a k s h u a t a d 1
K o n e r u
38
Alathematical Proganning TUTORIAL 2 SOLVING LI'"
3 A poducer of Healthv toodl kes two inpotant adscoet ingredients tHut go into tho
humanfood, nacd s alealthv ul tdCouuo) \Wa. Each kg of Healbhn \mol
300g of vitamins, 00g of potein.ad00 of cal Each kg of conmo nota 01
A of vitais, 3000 g of potem. and 200 of b Gidchues for ipm ioa Ha!
rquire auixture made hon these ingredent cota t east 900 g of viams 2100 !
protein, ad800 g of cubs. Helth an cUss $2 pe ky to produce ant Coon Mal l
$I 25 per kg to produce. Fudthe nunber of kgs of ch ingredient that shonldl e ponh
in order to mininize cost Obtain its Dual ad solve
Solution
Pimal:
Min c ax+ l-a5x
Subject to :
3oox,t lo0x >900
to0x, +3o0x> aaoo
(00x,+ aooxa> 8o0
Dual:
Max bC= 900y, taaooYatgoOY3
Subject to:
39
1LitheLtl'o
Simplex tethod:
300 300
o Soln Ratio
CBV BV S1
51 300 400
-
300 (-a5 I35/300
A400 300
60 a900 300
CBV Bv Sa Soln Xatio
S1 Soo00 Scol300
O"Oo4
-So0 -1300
40
Mathemtical 'oglamm: TUTORAL 2 SOLVING LPP
L s h t
u :l
h :i
Date of Evaluation:
42
Tutorial 3
Transportation problem
Date of the Session:
Learning outcomes:
Understanding the problem of transporting/shipping the comnodities from the
the destinations with the least possible industry to
cost while satisfving the supply and demand
imits.
3.1 PRE-TUTORIAL
1. List out different types of transportation nethods.
’Northwest Coner
’ least Cost
’Rauw Mioimum
’Counn Minimym
’ Vogel's Apprgfmation
I h o u e r i
43
Mathematical Programnming TUTORlAL 3. TRANSPORTATION PROBLEM
2. rule?
List out the steps iuvolved i solving the Tvuspurt ation problent tsing Nortlh-West cormer
’ Sehyp problem
’ Thitialize variables
’Repeat Alocaticn
-’Calcolote Total Cast
Optimalit
3. List out the steps involved in solving the Transpojation problem using Row Minimum
method.
’Roblen setup
’ Ioiialization e rLna k s h u a
’ Alocation
’ Iteraty
TotolCast
44
Mtheuuatil Poamu TUTORLAL3 HAVSTORI\UOV'OBLLA
3.2 IN-TUTORIAL
1 Lumos lus hae the .toues
hasp0tatiou costs (in Rs) Der wit ewceu tato j ad wchol|s> e IO heiow
Solve anspotat ion problem usg NIT coe e
Factory WuehouN"
WI W2 W3 W Supplv
1 30
F2 3 3 50
F3 4 2 20
Demand 20 40 30 10
Solution:
4
3O
to Lo
4
o
36 loo
I K o u
45
TRANSPORTAION PROBLEM
TUTORIAL 3
Mathenlaical Pogramnumg
state th po
depauueutal stoeLs thee plants octed thuoughout sht fom l
2 1e hodaya k1lo s of ee E h dayt ehop
Ton pactv 0, G0 and 70 rspectivel The Liliortliol1
50 md 60 gallons
ops RI. R2. R3. RI withat les 0 60 u Ros \ W I
uol
Soe DallNDotat)ou Dobleu
(ost (0l R ) le gNCH beon
Retibhop Supply
Stoe 23
7 80
3
G0
2 2
6 9 70
3 3
40 60 50 G0
Demand
Solution:
3
l20
3 6
K o n e
46
\lathenatical Progamng TUTORIAL 3 TRANSORTATION PROBLEM
I K o u L e r t
47
Mathenatical Iroamning TUTORIAL 3. TRANSPORTATION PROBLEM
3.3 POST-TUTORIAL
Solution:
35
d
60
IGOO
45
X 3o
65
48
Mathemnatical Progrumnlg TTORAL 3 TRANSPORTATION PROBLEM
L i l t d t l o t
L a k s h t i a l :
K o n e r u
49
50
Boot3ao+9564 =
x8+ox7+I0xatx|o
t60xa I9%5+8
34 a
Ao
60 3
to
Solution:
34 14 8
Demand
5
18 20 70 10 S3
9 60 10 30 70 S?
7 10 30 19 SI
Supplv DI D3 D2 DI F/D
Progalng Leu ehon \Muml
pobemlli;T Dausotao Solke Douldelahd the plouct
t he o
Lbl follow Tlhe DI pont)
D3 D2DI
PROBLEM
TRANSTO:TADOV TUTORIAL3
\litheuaiclP'ogg
Mathcmail Phomg TUTORLAL J TIRANSPORTATION PIOBLL1
c a t u l
L s u l : t h a d e
Date of Evaluation:
52
Tutorial 4
Learning outcomes:
" ithe optimal solution is integers, then problen is
solved, Otherwise, add Gomory's constraint
(cut) is added to optimal solution Now new problem is solved using dual simplex method The
method terminates as soon as optimal solution
becomeintegers.
4.1
PRE-TUTORIAL
1. Enumerate the steps involved in
Gomory's cutting plane method.
Step1: Build the 5implex Toble
stepa: check out the conditians build it
Stp3: Ihibally followthe simplex
Step4: Get the ortespodhig valoes
steps: If valgs are integer then Skop Det all steps
step6 :IErot by considerng themaxfracional vakje fromit
Step 7:Generate the seorce vOw'
53
Alitheuatical Pogramming |UTORIAL I GOMOHYS 1T HOD
4.2 IN-TUTORIAL
I Fnd solutio s g itepe sipex uthod (GooY CHtop: plne m1ho)
MaximizeZ
subjet t)
3r 2r) <i
I2 2
and rj. J) are 01-1Cgative mleYerS
Solution:
Sol Ratio
Bv S1 Sa
S1
54
AMathematical l'ioyau TUTORIAL J GOMORYS ALTIOD
Ce
Sol Ratio
B-V S1 Sa
Sol Rotio
B-v S1
t l h o uLe r
a ?
k s l n u : d i
55
\athenhacal Pogamt TUTORIAL I GO\MOR) S MLTOD
Xtoa+s1+sa
Fractional cot constraint
Sol Ratio
BV S1 G1
G1
)
Sol
Sa Gi1
O l e r
S1
-|
36
13 POST UOLAI
6x,+ 8 ts2- la
I6
Sol Ratio
B-V 51 5a
S1 4 4
Sa 3 4 3
Sol Raig
S1 Sa
B-v
S1 3
3
16
I6 4
-4
57
Matheutlcl oapwy
Cp |4
Sol Ratio
B"v S1
6 a
14 I6 C 3
-a-3
St
58
\lathemical ogaunn. TUTORIAL I GOMORY'S AMETHOD
14 16
Sol Ratio
BV X, S1 G
-3)?
(6 -4
14 l6 3
- -3
CB 14 16
Sol
B-v G1
16
-
61
= 44
Ko
59
Matheula ical Poaming
L a s h u l a lt: t.hiht d
60
Tutorial 5
Learning outcomes:
61
Mathenaial 'eam
5.2 IN-TUTORIAL
3 3
Subjet to
3
212
I| -3r + 2r < 3
Where , I2, T3 >0 and iuteger. Get the
cutting plane method. optiual solution as an integer valne usiig Goioy
Solution:
3
CB
J
S1 Sa S3 Ratio
T5 3-35
3 4-5
3 3
3
B-V
K ß i e r t
a S1 Sa S3 Ratio
3 3-33
S-33
3 a 6 S
a 6 5
62
\latheuatical Phoamng TUTORIAL ). JBRANCI AND BOUND AIETHOD
Xa
Ratio
3"33
BV
S1 S3 Ga
-75
3
O-75
-0-5
G-3 3
Rotio
B-y 3 S1 Sa S3 G1
-0°667
3 1-33
S1\
G1 1 O-66
03
Ratio
Sirce all -G=0 63
TUTORIAL J BRANCII AND BOUND \ETHOD
2r <l0)
IWhere l e
I0l-negative iutegers
Solution:
Given,
+t74sas
(o,4), 8,0)
Pointsare
64
TUTORIAL ) BRANCH AND BOUND \MAITIOD
G lo la
By grophicol method
.:Intersecion point is (S4)
=35
Maxz-5
I K o n eLr a
u k s h u i ii e o d
65
IUORAL S DRANCILAND BO0ND
MEiIOD
K o nLeaukshu.til
66
Wathemaid P'roNlammly
TUTORIAL , LAVCAND 0UND ME.TIOD
5.3 POST-TUTORIAL
I Eplan
Snbject to:
r t ) <9
S/, -5
Sa
G-j
6
Sol Ratio
S1 Sa
18 6 6
G-~j -I6
67
()9+()e
OE+8
89
Mathematal Programng
K o u e
L r
a u
k s h m a
E i adl h
u a h
69
Mathenlatica l'op: TWTORIAL J BRANCH AND BOUND METIOD
Date of Evaltation:
70
Tutorial6
Dynamic Programming
Date of the Session:
6.1 PRE-TUTORIAL
1. What is
Dynamic Programming?
Dynamio rogramming is a techniwe that besks the
7 Save the vesut foy fubuve problens into sJb-Po
POvpOsesSo that we do not need to conpute the
Yesult ogan
.the main se of dyngfie L a k s i û g
2. State the
diferent types of Dynamic Programming?
the difo@rt types of dynanic pyframming are krapsack broelling
Salesman
71
TUTORIAL 6 DYNAMC PROGHAU
b.2 IN-TUTORIAL
WNl/e thc Poht lor he 0/|kuapk hooleu
usuw dyuu DoLwy
Poht lleght
30
3
s°- {(o,))
s'- {(o,o), (19,5])
s -{Co,), ( a)
7-3
s- (o9,69, (a9), (69), 690), yro), (s9,3), (698), (9))
x=ste (a9) ss s (19)
25=0 sE (44) ss s°E( )
se (10+) ss s'(40,)
z'-o se (o,o) ss s'e(o)
40+So- 90
72
TUTORIAL 6
POST-TUTORIAL DYNACROGRANINO
.OCCpt ol travelipy
6.3
sles Poblem
Solution
with cal-in CKHup
travelling Salesan problem (7ao) is
The a dassic
in comater science operations opioizoticn prcblern
vOwte thal allas a
Yesearhthe
oad is to fiod the shotest
A0ssible Salesman to visit a set of cities, exacty
to the standingáty
73
/thellatical Prograuliug
TUTORIAL 6 DYNANJC PROGRAM\1|NG
ld tle istlce bol
Shortest possib: oute at 'INits (VUIV cityween Cvey pir of cit ies
xacly once d
20
10
15
25 30
35
Solution:
if i=)
Co (vE)
if (Gi)
iEV
3
4
Step a!
=5.
74
=9+8 -17
=3tS-3
= 18
Sep 3
Gafs - mino tci43, J+cff93,
min 49+1s,iot33= at
min 8+ I3
path s | 2-
: The
o u d a t i
I h o u eLr ua k s h a t d
76
Ltheul.
itiCal Program1ning
TUTORIAL G DYNAMIC PROGRAIMING
I h O n eLr a k s h l l a l t h
77
1ZthMatiCal Proguming
T0TORIAL G DYNANCPROGHANINO
a k s h m a l a
Date of Evaluation:
78