SlideShare a Scribd company logo
1 of 26
Operations Research
Course Code: IPE 3103
Instructor: Md. Rasel Sarkar
Dept. of IPE, RUET, Rajshahi, Bangladesh
Academic Year: 2020-21
Chapter 10
Dynamic programming
Dynamic Program (DP)
๏‚ง Dynamic programming is a mathematical technique
dealing with the optimization of multistage decision
process.
๏‚ง Original decisions problem is divided into small sub-
problem (stages) and stages are optimized rather
than simultaneously.
๏‚ง In contrast to linear programming, there does not
exist a standard mathematical formulation of โ€œthe
dynamic programming problemโ€.
๏‚ง Dynamic programming is applicable when the sub-
problems are not independent.
Recursive Nature of Dynamic
Programming
๏‚ง Computations are then carried out recursively
where the optimum solution of one sub-problem is
used as an input to the next sub-problem.
๏‚ง The optimum solution for the entire problem is at
hand when the last sub-problem is solved.
๏‚ง The manner in which the recursive computations
are carried out depends on how the original
problem is decomposed.
Shortest Route Problem
Suppose that we want to select the shortest highway route
between two cities. The network in Figure below provides the
possible routes between the starting city at node 1 and the
destination city at node 7. Where the number on the line
shows distance from one node to another.
First decompose it into stages as delineated by the
vertical dashed lines in Figure. Next, carry out the
computations for each stage separately.
Stage 1
Shortest distance from node 1 to node 2 = 7 miles (from node 1)
Shortest distance from node 1 to node 3 = 8 miles (from node 1)
Shortest distance from node 1 to node 4 = 5 miles (from node 1)
Stage 2 (n=2)
Node 5 can be reached from nodes 2, 3, and 4. Thus โ€“
shortest distance
to node x5
= min
j=2,3,4
{ distance from
node xj to x5
+ shortest distance
to node xj
}
Let,
f*n(xi) be the shortest distance to node xi at stage n
d(xj, xi) as the distance from node xj to node xi.
๐‘ฅ๐‘— = all possible routes to node xi.
Now above eqn. can be mathematically expressed as
f*2(x5) = min
j=2,3,4
{d(xj, x5) + (f1(xj)}
Thus,
shortest distance
to node x5
= min
12 + 7 = 19
8 + 8 = 16
7 + 5 = 12
= 12 miles (from node 4)
Node 6 can be reached from nodes 3 and 4. Thus โ€“
shortest distance
to node x6
= min
j=3,4
{ distance from
node xj to x6
+ shortest distance
to node xj
}
= min
9 + 8 = 17
13 + 5 = 18
= 17 miles (from node 3)
Stage 3
The destination node 7 can be reached from either node 5
or 6.
shortest distance
to node x7
= min
j=5,6
distance from
node xj to x7
+ shortest distance
to node xj
= min
9 + 12 = 21
6 + 17 = 23
= 21 miles (from node 5)
Shortest distance from node 1 to node 7 = 21 miles.
Thus, the shortest route is 1 โ†’ 4 โ†’ 5 โ†’ 7.
Recursive equation
The DP recursive equation is defined as โ€“
๐‘“0 ๐‘ฅ1 = 0
๐‘“๐‘›
โˆ— ๐‘ฅ๐‘– = min ๐‘‘ ๐‘ฅ๐‘—, ๐‘ฅ๐‘– + ๐‘“๐‘›โˆ’1
โˆ—
(๐‘ฅ๐‘—) , for ๐‘› = 2, 3,โ€ฆ
Principle of optimality
The principle of optimality is the basic principle of
dynamic programming, which was developed by
Richard Bellman that:
โ€œAn optimal policy has the property that whatever
the initial conditions and decisions are the remaining
stages constitute an optimal policy regardless of the
policy adopted in all preceding stagesโ€
Capital budgeting problem
Consider the capital budgeting problem where three
existing factories, each being considered for possible
expansion. Factories 1, 2 and 3 have three, four and
two alternative plans for expansion respectively. The
expected additional costs and the corresponding
revenues for jth plan of the nth factory are given by cnj
and Rnj. The objective of the decision problem is to
select a plan j for each factory n which will maximize
the total revenue. The cost of the selected set of
plans should not exceed the total available capital, C.
The data of the problem is tabulated below. All costs
and revenue are scaled by 10-3.
Assume the total capital available is C = 10.
Factory, n n = 1 n = 2 n = 3
Plan, j c1j R1j c2j R2j c3j R3j
1 0 0 0 0 0 0
2 2 5 5 8 1 3
3 4 6 6 9 โ€“ โ€“
4 โ€“ โ€“ 8 12 โ€“ โ€“
Recursive equation:
๐‘“๐‘›
โˆ— ๐‘‹ = ๐‘š๐‘Ž๐‘ฅ
0โ‰ค ๐‘๐‘›๐‘—โ‰ค ๐‘‹
{๐‘…๐‘›๐‘— ๐‘๐‘›๐‘— + ๐‘“๐‘›โˆ’1
โˆ—
(๐‘‹ โˆ’ ๐‘๐‘›๐‘—)}
Where
X = amounts available for allocation.
๐‘“๐‘›
โˆ—
๐‘‹ = the maximum return from allocating X
dollars at nth stage.
๐‘๐‘›๐‘— = the decision variable, denote the amount
allocated to jth plan of nth stage.
๐‘…๐‘›๐‘— ๐‘๐‘›๐‘— = return from the jth plan on the nth stage.
Stage n = 1 (Factory 1)
๐‘“1 ๐‘‹ = ๐‘…1๐‘— ๐‘1๐‘—
j =1
(c11= 0, R11=0)
j = 2
(c12= 2, R12=5)
j = 3
(R13=6, c13= 4)
Optimum Sol.
X ๐‘“1 ๐‘‹ ๐‘“1 ๐‘‹ ๐‘“1 ๐‘‹ ๐‘“1
โˆ—
๐‘‹ j*
0 0 โ€“ โ€“ 0 1
1 0 โ€“ โ€“ 0 1
2 0 5 โ€“ 5 2
3 0 5 โ€“ 5 2
4 0 5 6 6 3
5 0 5 6 6 3
6 0 5 6 6 3
7 0 5 6 6 3
8 0 5 6 6 3
9 0 5 6 6 3
10 0 5 6 6 3
Stage n = 2 (Factory 2)
๐‘“2 ๐‘‹ = ๐‘…2๐‘— ๐‘2๐‘— + ๐‘“ โˆ—1 (๐‘‹ โˆ’ ๐‘2๐‘—)
j =1
(c21= 0, R21= 0)
j = 2
(c22= 5, R22 = 8)
j = 3
(c23= 6, R23=9)
j = 4
(c24= 8, R23=12)
Optimum
Solution
X ๐‘“2 ๐‘‹ ๐‘“2 ๐‘‹ ๐‘“2 ๐‘‹ ๐‘“2 ๐‘‹ ๐‘“2
โˆ—
๐‘‹ j*
0 0 + 0 = 0 โ€“ โ€“ โ€“ 0 1
1 0 + 0 = 0 โ€“ โ€“ โ€“ 0 1
2 0 + 5 = 5 โ€“ โ€“ โ€“ 5 1
3 0 + 5 = 5 โ€“ โ€“ โ€“ 5 1
4 0 + 6 = 6 โ€“ โ€“ โ€“ 6 1
5 0 + 6 = 6 8 + 0 = 8 โ€“ โ€“ 8 2
6 0 + 6 = 6 8 + 0 = 8 9 + 0 = 9 โ€“ 9 3
7 0 + 6 = 6 8 + 5 = 13 9 + 0 = 9 โ€“ 13 2
8 0 + 6 = 6 8 + 5 = 13 9 + 5 = 14 12 + 0 = 12 14 3
9 0 + 6 = 6 8 + 6 = 14 9 + 5 = 14 12 + 0 = 12 14 2, 3
10 0 + 6 = 6 8 + 6 = 14 9 + 6 = 15 12 + 5 = 17 17 4
Stage n = 3 (Factory 3)
๐‘“3 ๐‘‹ = ๐‘…3๐‘— ๐‘3๐‘— + ๐‘“2 (๐‘‹ โˆ’ ๐‘3๐‘—)*
j =1
(c31 = 0, R31 = 0)
j = 2
(c32= 1, R32 = 3)
Optimum Solution
X ๐‘“2 ๐‘‹ ๐‘“2 ๐‘‹ ๐‘“3
โˆ—
๐‘‹ j*
0 0 + 0 = 0 โ€“ 0 1
1 0 + 0 = 0 3 + 0 = 3 3 2
2 0 + 5 = 5 3 + 0 = 3 5 1
3 0 + 5 = 5 3 + 5 = 8 8 2
4 0 + 6 = 6 3 + 5 = 8 8 2
5 0 + 8 = 8 3 + 6 = 9 9 2
6 0 + 9 = 9 3 + 8 = 11 11 2
7 0 + 13 = 13 3 + 9 = 12 13 1
8 0 + 14 = 14 3 + 13 = 16 16 2
9 0 + 14 = 14 3 + 14 = 17 17 2
10 0 + 17 = 17 3 + 14 = 17 17 1, 2
Optimal profit = 17
Optimal Policy:
Factory 1 Factory 2 Factory 3
Option 1 2 4 1
Option 2 3 2 2
Option 3 2 3 2
Example
(Liberman)
The owner of a chain of three grocery stores has
purchased five crates of fresh strawberries. The
estimated probability distribution of potential sales
of the strawberries before spoilage differs among the
three stores. Therefore, the owner wants to know
how to allocate five crates to the three stores to
maximize expected profit. For administrative
reasons, the owner does not wish to split crates
between stores. However, he is willing to distribute
no crates to any of his stores.
The following table gives the estimated expected
profit at each store when it is allocated various
numbers of crates:
Use dynamic programming to determine how many
of the five crates should be assigned to each of the
three stores to maximize the total expected profit.
Solution
Let , The decision variables xn (n = 1, 2, 3) are the
number of crates to allocate to stage (store) n.
X = number of crates available for allocation to different
stores.
pn(xn) = be the profit from allocating xn crates to store n.
๐‘“๐‘› ๐‘‹ = profit from allocating X crates to store, n
๐‘“๐‘›
โˆ—
๐‘‹ = Optimal profit from allocating X crates to store, n
Now get,
๐‘“๐‘› ๐‘‹ = ๐‘๐‘› ๐‘ฅ๐‘› + ๐‘“๐‘›โˆ’1
โˆ—
๐‘‹ โˆ’ ๐‘ฅ๐‘›
Consequently, the recursive relationship is
for n = 1, 2, 3
๐‘ฅ๐‘› = 0, 1, 2 โ€ฆ . ๐‘‹
where ๐‘“๐‘›
โˆ— ๐‘‹ = max ๐‘“๐‘›
โˆ— ๐‘‹ โˆ’ ๐‘ฅ๐‘›
๐‘“๐‘›
โˆ— ๐‘‹ = max { ๐‘๐‘› ๐‘ฅ๐‘› + ๐‘“๐‘›โˆ’1
โˆ—
๐‘‹ โˆ’ ๐‘ฅ๐‘› }
๐‘ฅ๐‘› = 0, 1, 2 โ€ฆ . ๐‘‹
๐‘“1 ๐‘‹ = ๐‘1 ๐‘ฅ1
X 0 1 2 3 4 5 ๐‘“1
โˆ—
๐‘‹ ๐‘ฅ1
โˆ—
0 0 โ€“ โ€“ โ€“ โ€“ โ€“ 0 0
1 0 5 โ€“ โ€“ โ€“ โ€“ 5 1
2 0 5 9 โ€“ โ€“ โ€“ 9 2
3 0 5 9 14 โ€“ โ€“ 14 3
4 0 5 9 14 17 โ€“ 17 4
5 0 5 9 14 17 21 21 5
Stage, n = 1 (Store 1)
Stage, n = 2 (Store 2)
๐‘“2 ๐‘‹ = ๐‘2 ๐‘ฅ2 + ๐‘“1
โˆ—
X โˆ’ ๐‘ฅ2
X 0 1 2 3 4 5 ๐‘“2
โˆ—
๐‘‹ ๐‘ฅ2
โˆ—
0 0 + 0 = 0 โ€“ โ€“ โ€“ โ€“ โ€“ 0 0
1 0 + 5 = 5 6 + 0 = 6 โ€“ โ€“ โ€“ โ€“ 6 1
2 0 + 9 = 9 6 + 5 = 11 11+0= 11 โ€“ โ€“ โ€“ 11 1, 2
3 0+14 = 14 6 + 9= 15 11+5= 16 15+0= 15 โ€“ โ€“ 16 2
4 0+17= 17 6 + 14= 20 11+9= 20 14+5= 19 19+0= 19 โ€“ 20 1, 2
5 0 +21= 21 6 + 17= 23 11+14= 25 14+9= 23 19+5= 24 22+0= 22 25 2
Stage, n = 3 (Store 3)
๐‘“3 ๐‘‹ = ๐‘3 ๐‘ฅ3 + ๐‘“2
โˆ—
X โˆ’ ๐‘ฅ3
X 0 1 2 3 4 5 ๐‘“3
โˆ—
X ๐‘ฅ3
โˆ—
0 0+0 = 0 โ€“ โ€“ โ€“ โ€“ โ€“ 0 0
1 0+6 = 6 4+0 = 4 โ€“ โ€“ โ€“ โ€“ 6 0
2 0+11 = 11 4+6 = 10 9+0 = 9 โ€“ โ€“ โ€“ 11 0
3 0+16 = 16 4+11 = 15 9+6 = 15 13+0 = 13 โ€“ โ€“ 16 0
4 0+20 = 20 4+16 = 20 9+11 = 20 13+6 = 19 18+0 = 18 โ€“ 20 0, 1
5 0+25 = 25 4+20 = 24 9+16 = 25 13+11 = 24 18+6 = 24 20+0 = 20 25 0, 2
Optimal Solution
Optimal profit = 25
Optimal Policy:
Store 1 Store 2 Store 3
Option 1 3 2 0
Option 2 1 2 2

More Related Content

What's hot

Simplex Method
Simplex MethodSimplex Method
Simplex MethodSachin MK
ย 
Transportation Modelling - Quantitative Analysis and Discrete Maths
Transportation Modelling - Quantitative Analysis and Discrete MathsTransportation Modelling - Quantitative Analysis and Discrete Maths
Transportation Modelling - Quantitative Analysis and Discrete MathsKrupesh Shah
ย 
Integer Programming, Goal Programming, and Nonlinear Programming
Integer Programming, Goal Programming, and Nonlinear ProgrammingInteger Programming, Goal Programming, and Nonlinear Programming
Integer Programming, Goal Programming, and Nonlinear ProgrammingSalah A. Skaik - MBA-PMPยฎ
ย 
Dual simplexmethod
Dual simplexmethodDual simplexmethod
Dual simplexmethodJoseph Konnully
ย 
Simplex Method
Simplex MethodSimplex Method
Simplex Methodkzoe1996
ย 
Marginal costing
Marginal costing Marginal costing
Marginal costing student
ย 
Integer Linear Programming
Integer Linear ProgrammingInteger Linear Programming
Integer Linear ProgrammingSukhpalRamanand
ย 
Transportation problems
Transportation problemsTransportation problems
Transportation problemsVishalHotchandani2
ย 
AGGREGATE PRODUCTION PLANNING
AGGREGATE PRODUCTION PLANNING AGGREGATE PRODUCTION PLANNING
AGGREGATE PRODUCTION PLANNING Aqib ali
ย 
Cost and Cost Concepts
Cost and Cost ConceptsCost and Cost Concepts
Cost and Cost ConceptsPaurav Shah
ย 
Two Phase Method- Linear Programming
Two Phase Method- Linear ProgrammingTwo Phase Method- Linear Programming
Two Phase Method- Linear ProgrammingManas Lad
ย 
scheduling
schedulingscheduling
schedulingAnu Reddy
ย 
primal and dual problem
primal and dual problemprimal and dual problem
primal and dual problemYash Lad
ย 
Performance Measures of Manufacturing System
Performance Measures of Manufacturing SystemPerformance Measures of Manufacturing System
Performance Measures of Manufacturing SystemDesignage Solutions
ย 
Concept of Duality
Concept of DualityConcept of Duality
Concept of DualitySubhamSatpathy2
ย 
Linear programing
Linear programingLinear programing
Linear programingAniruddh Tiwari
ย 
La violence conjugale et l'echec scolaire
La violence conjugale  et l'echec scolaireLa violence conjugale  et l'echec scolaire
La violence conjugale et l'echec scolaireLotfi Akremi
ย 
Assignment Problem
Assignment ProblemAssignment Problem
Assignment ProblemNakul Bhardwaj
ย 
Chapter 6_OM
Chapter 6_OMChapter 6_OM
Chapter 6_OMguest537689
ย 

What's hot (20)

Simplex Method
Simplex MethodSimplex Method
Simplex Method
ย 
Transportation Modelling - Quantitative Analysis and Discrete Maths
Transportation Modelling - Quantitative Analysis and Discrete MathsTransportation Modelling - Quantitative Analysis and Discrete Maths
Transportation Modelling - Quantitative Analysis and Discrete Maths
ย 
Integer Programming, Goal Programming, and Nonlinear Programming
Integer Programming, Goal Programming, and Nonlinear ProgrammingInteger Programming, Goal Programming, and Nonlinear Programming
Integer Programming, Goal Programming, and Nonlinear Programming
ย 
Dual simplexmethod
Dual simplexmethodDual simplexmethod
Dual simplexmethod
ย 
Simplex Method
Simplex MethodSimplex Method
Simplex Method
ย 
Marginal costing
Marginal costing Marginal costing
Marginal costing
ย 
Integer Linear Programming
Integer Linear ProgrammingInteger Linear Programming
Integer Linear Programming
ย 
Transportation problems
Transportation problemsTransportation problems
Transportation problems
ย 
AGGREGATE PRODUCTION PLANNING
AGGREGATE PRODUCTION PLANNING AGGREGATE PRODUCTION PLANNING
AGGREGATE PRODUCTION PLANNING
ย 
Cost and Cost Concepts
Cost and Cost ConceptsCost and Cost Concepts
Cost and Cost Concepts
ย 
Two Phase Method- Linear Programming
Two Phase Method- Linear ProgrammingTwo Phase Method- Linear Programming
Two Phase Method- Linear Programming
ย 
scheduling
schedulingscheduling
scheduling
ย 
primal and dual problem
primal and dual problemprimal and dual problem
primal and dual problem
ย 
Performance Measures of Manufacturing System
Performance Measures of Manufacturing SystemPerformance Measures of Manufacturing System
Performance Measures of Manufacturing System
ย 
Concept of Duality
Concept of DualityConcept of Duality
Concept of Duality
ย 
Goal Programming
Goal ProgrammingGoal Programming
Goal Programming
ย 
Linear programing
Linear programingLinear programing
Linear programing
ย 
La violence conjugale et l'echec scolaire
La violence conjugale  et l'echec scolaireLa violence conjugale  et l'echec scolaire
La violence conjugale et l'echec scolaire
ย 
Assignment Problem
Assignment ProblemAssignment Problem
Assignment Problem
ย 
Chapter 6_OM
Chapter 6_OMChapter 6_OM
Chapter 6_OM
ย 

Similar to Chapter 12 Dynamic programming.pptx

Opt Assgnment #-1 PPTX.pptx
Opt Assgnment #-1 PPTX.pptxOpt Assgnment #-1 PPTX.pptx
Opt Assgnment #-1 PPTX.pptxAbdellaKarime
ย 
Lesson 8: Rational Functions
Lesson 8: Rational FunctionsLesson 8: Rational Functions
Lesson 8: Rational FunctionsKevin Johnson
ย 
Cuaderno+de+integrales
Cuaderno+de+integralesCuaderno+de+integrales
Cuaderno+de+integralesjoseluisroyo
ย 
Lesson 22: Polynomial Long Division
Lesson 22: Polynomial Long DivisionLesson 22: Polynomial Long Division
Lesson 22: Polynomial Long DivisionKevin Johnson
ย 
Explicit upper bound for the function of sum of divisors
Explicit upper bound for the function of sum of divisorsExplicit upper bound for the function of sum of divisors
Explicit upper bound for the function of sum of divisorsAlexander Decker
ย 
Polynomial Function and Synthetic Division
Polynomial Function and Synthetic DivisionPolynomial Function and Synthetic Division
Polynomial Function and Synthetic DivisionElceed
ย 
Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Rai University
ย 
College algebra real mathematics real people 7th edition larson solutions manual
College algebra real mathematics real people 7th edition larson solutions manualCollege algebra real mathematics real people 7th edition larson solutions manual
College algebra real mathematics real people 7th edition larson solutions manualJohnstonTBL
ย 
4. Integral Calculus for gcse and other exams.pptx
4. Integral Calculus for gcse and other exams.pptx4. Integral Calculus for gcse and other exams.pptx
4. Integral Calculus for gcse and other exams.pptxHappy Ladher
ย 
B.tech ii unit-3 material multiple integration
B.tech ii unit-3 material multiple integrationB.tech ii unit-3 material multiple integration
B.tech ii unit-3 material multiple integrationRai University
ย 
Ejercicios resueltos de analisis matematico 1
Ejercicios resueltos de analisis matematico 1Ejercicios resueltos de analisis matematico 1
Ejercicios resueltos de analisis matematico 1tinardo
ย 
Two phase method lpp
Two phase method lppTwo phase method lpp
Two phase method lppAnurag Srivastava
ย 
Numerical integration
Numerical integration Numerical integration
Numerical integration Dhyey Shukla
ย 
1.basic of fractions
1.basic of fractions1.basic of fractions
1.basic of fractionsDreams4school
ย 
Gr 11 equations
Gr 11   equationsGr 11   equations
Gr 11 equationsRenate Rohrs
ย 
Set 1 mawar
Set 1 mawarSet 1 mawar
Set 1 mawarfaazafauzana
ย 

Similar to Chapter 12 Dynamic programming.pptx (20)

Opt Assgnment #-1 PPTX.pptx
Opt Assgnment #-1 PPTX.pptxOpt Assgnment #-1 PPTX.pptx
Opt Assgnment #-1 PPTX.pptx
ย 
Lesson 8: Rational Functions
Lesson 8: Rational FunctionsLesson 8: Rational Functions
Lesson 8: Rational Functions
ย 
Integral calculus
Integral calculusIntegral calculus
Integral calculus
ย 
EPCA_MODULE-2.pptx
EPCA_MODULE-2.pptxEPCA_MODULE-2.pptx
EPCA_MODULE-2.pptx
ย 
Cuaderno+de+integrales
Cuaderno+de+integralesCuaderno+de+integrales
Cuaderno+de+integrales
ย 
Lesson 22: Polynomial Long Division
Lesson 22: Polynomial Long DivisionLesson 22: Polynomial Long Division
Lesson 22: Polynomial Long Division
ย 
Explicit upper bound for the function of sum of divisors
Explicit upper bound for the function of sum of divisorsExplicit upper bound for the function of sum of divisors
Explicit upper bound for the function of sum of divisors
ย 
Polynomial Function and Synthetic Division
Polynomial Function and Synthetic DivisionPolynomial Function and Synthetic Division
Polynomial Function and Synthetic Division
ย 
Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3
ย 
Logarithma
LogarithmaLogarithma
Logarithma
ย 
College algebra real mathematics real people 7th edition larson solutions manual
College algebra real mathematics real people 7th edition larson solutions manualCollege algebra real mathematics real people 7th edition larson solutions manual
College algebra real mathematics real people 7th edition larson solutions manual
ย 
4. Integral Calculus for gcse and other exams.pptx
4. Integral Calculus for gcse and other exams.pptx4. Integral Calculus for gcse and other exams.pptx
4. Integral Calculus for gcse and other exams.pptx
ย 
B.tech ii unit-3 material multiple integration
B.tech ii unit-3 material multiple integrationB.tech ii unit-3 material multiple integration
B.tech ii unit-3 material multiple integration
ย 
Ejercicios resueltos de analisis matematico 1
Ejercicios resueltos de analisis matematico 1Ejercicios resueltos de analisis matematico 1
Ejercicios resueltos de analisis matematico 1
ย 
Two phase method lpp
Two phase method lppTwo phase method lpp
Two phase method lpp
ย 
Numerical integration
Numerical integration Numerical integration
Numerical integration
ย 
1.basic of fractions
1.basic of fractions1.basic of fractions
1.basic of fractions
ย 
Gr 11 equations
Gr 11   equationsGr 11   equations
Gr 11 equations
ย 
Equations.pptx
Equations.pptxEquations.pptx
Equations.pptx
ย 
Set 1 mawar
Set 1 mawarSet 1 mawar
Set 1 mawar
ย 

Recently uploaded

Model Call Girl in Narela Delhi reach out to us at ๐Ÿ”8264348440๐Ÿ”
Model Call Girl in Narela Delhi reach out to us at ๐Ÿ”8264348440๐Ÿ”Model Call Girl in Narela Delhi reach out to us at ๐Ÿ”8264348440๐Ÿ”
Model Call Girl in Narela Delhi reach out to us at ๐Ÿ”8264348440๐Ÿ”soniya singh
ย 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
ย 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
ย 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
ย 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
ย 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
ย 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
ย 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
ย 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
ย 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
ย 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEslot gacor bisa pakai pulsa
ย 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
ย 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoรฃo Esperancinha
ย 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
ย 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
ย 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
ย 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
ย 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
ย 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
ย 

Recently uploaded (20)

Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
ย 
Model Call Girl in Narela Delhi reach out to us at ๐Ÿ”8264348440๐Ÿ”
Model Call Girl in Narela Delhi reach out to us at ๐Ÿ”8264348440๐Ÿ”Model Call Girl in Narela Delhi reach out to us at ๐Ÿ”8264348440๐Ÿ”
Model Call Girl in Narela Delhi reach out to us at ๐Ÿ”8264348440๐Ÿ”
ย 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
ย 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
ย 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
ย 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
ย 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
ย 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
ย 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
ย 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
ย 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
ย 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
ย 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
ย 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
ย 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
ย 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
ย 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
ย 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
ย 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
ย 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
ย 

Chapter 12 Dynamic programming.pptx

  • 1. Operations Research Course Code: IPE 3103 Instructor: Md. Rasel Sarkar Dept. of IPE, RUET, Rajshahi, Bangladesh Academic Year: 2020-21 Chapter 10 Dynamic programming
  • 2. Dynamic Program (DP) ๏‚ง Dynamic programming is a mathematical technique dealing with the optimization of multistage decision process. ๏‚ง Original decisions problem is divided into small sub- problem (stages) and stages are optimized rather than simultaneously. ๏‚ง In contrast to linear programming, there does not exist a standard mathematical formulation of โ€œthe dynamic programming problemโ€. ๏‚ง Dynamic programming is applicable when the sub- problems are not independent.
  • 3. Recursive Nature of Dynamic Programming ๏‚ง Computations are then carried out recursively where the optimum solution of one sub-problem is used as an input to the next sub-problem. ๏‚ง The optimum solution for the entire problem is at hand when the last sub-problem is solved. ๏‚ง The manner in which the recursive computations are carried out depends on how the original problem is decomposed.
  • 4. Shortest Route Problem Suppose that we want to select the shortest highway route between two cities. The network in Figure below provides the possible routes between the starting city at node 1 and the destination city at node 7. Where the number on the line shows distance from one node to another.
  • 5. First decompose it into stages as delineated by the vertical dashed lines in Figure. Next, carry out the computations for each stage separately.
  • 6. Stage 1 Shortest distance from node 1 to node 2 = 7 miles (from node 1) Shortest distance from node 1 to node 3 = 8 miles (from node 1) Shortest distance from node 1 to node 4 = 5 miles (from node 1)
  • 7. Stage 2 (n=2) Node 5 can be reached from nodes 2, 3, and 4. Thus โ€“ shortest distance to node x5 = min j=2,3,4 { distance from node xj to x5 + shortest distance to node xj } Let, f*n(xi) be the shortest distance to node xi at stage n d(xj, xi) as the distance from node xj to node xi. ๐‘ฅ๐‘— = all possible routes to node xi. Now above eqn. can be mathematically expressed as f*2(x5) = min j=2,3,4 {d(xj, x5) + (f1(xj)}
  • 8. Thus, shortest distance to node x5 = min 12 + 7 = 19 8 + 8 = 16 7 + 5 = 12 = 12 miles (from node 4) Node 6 can be reached from nodes 3 and 4. Thus โ€“ shortest distance to node x6 = min j=3,4 { distance from node xj to x6 + shortest distance to node xj } = min 9 + 8 = 17 13 + 5 = 18 = 17 miles (from node 3)
  • 9. Stage 3 The destination node 7 can be reached from either node 5 or 6. shortest distance to node x7 = min j=5,6 distance from node xj to x7 + shortest distance to node xj = min 9 + 12 = 21 6 + 17 = 23 = 21 miles (from node 5) Shortest distance from node 1 to node 7 = 21 miles. Thus, the shortest route is 1 โ†’ 4 โ†’ 5 โ†’ 7.
  • 10. Recursive equation The DP recursive equation is defined as โ€“ ๐‘“0 ๐‘ฅ1 = 0 ๐‘“๐‘› โˆ— ๐‘ฅ๐‘– = min ๐‘‘ ๐‘ฅ๐‘—, ๐‘ฅ๐‘– + ๐‘“๐‘›โˆ’1 โˆ— (๐‘ฅ๐‘—) , for ๐‘› = 2, 3,โ€ฆ
  • 11. Principle of optimality The principle of optimality is the basic principle of dynamic programming, which was developed by Richard Bellman that: โ€œAn optimal policy has the property that whatever the initial conditions and decisions are the remaining stages constitute an optimal policy regardless of the policy adopted in all preceding stagesโ€
  • 12. Capital budgeting problem Consider the capital budgeting problem where three existing factories, each being considered for possible expansion. Factories 1, 2 and 3 have three, four and two alternative plans for expansion respectively. The expected additional costs and the corresponding revenues for jth plan of the nth factory are given by cnj and Rnj. The objective of the decision problem is to select a plan j for each factory n which will maximize the total revenue. The cost of the selected set of plans should not exceed the total available capital, C.
  • 13. The data of the problem is tabulated below. All costs and revenue are scaled by 10-3. Assume the total capital available is C = 10. Factory, n n = 1 n = 2 n = 3 Plan, j c1j R1j c2j R2j c3j R3j 1 0 0 0 0 0 0 2 2 5 5 8 1 3 3 4 6 6 9 โ€“ โ€“ 4 โ€“ โ€“ 8 12 โ€“ โ€“
  • 14. Recursive equation: ๐‘“๐‘› โˆ— ๐‘‹ = ๐‘š๐‘Ž๐‘ฅ 0โ‰ค ๐‘๐‘›๐‘—โ‰ค ๐‘‹ {๐‘…๐‘›๐‘— ๐‘๐‘›๐‘— + ๐‘“๐‘›โˆ’1 โˆ— (๐‘‹ โˆ’ ๐‘๐‘›๐‘—)} Where X = amounts available for allocation. ๐‘“๐‘› โˆ— ๐‘‹ = the maximum return from allocating X dollars at nth stage. ๐‘๐‘›๐‘— = the decision variable, denote the amount allocated to jth plan of nth stage. ๐‘…๐‘›๐‘— ๐‘๐‘›๐‘— = return from the jth plan on the nth stage.
  • 15. Stage n = 1 (Factory 1) ๐‘“1 ๐‘‹ = ๐‘…1๐‘— ๐‘1๐‘— j =1 (c11= 0, R11=0) j = 2 (c12= 2, R12=5) j = 3 (R13=6, c13= 4) Optimum Sol. X ๐‘“1 ๐‘‹ ๐‘“1 ๐‘‹ ๐‘“1 ๐‘‹ ๐‘“1 โˆ— ๐‘‹ j* 0 0 โ€“ โ€“ 0 1 1 0 โ€“ โ€“ 0 1 2 0 5 โ€“ 5 2 3 0 5 โ€“ 5 2 4 0 5 6 6 3 5 0 5 6 6 3 6 0 5 6 6 3 7 0 5 6 6 3 8 0 5 6 6 3 9 0 5 6 6 3 10 0 5 6 6 3
  • 16. Stage n = 2 (Factory 2) ๐‘“2 ๐‘‹ = ๐‘…2๐‘— ๐‘2๐‘— + ๐‘“ โˆ—1 (๐‘‹ โˆ’ ๐‘2๐‘—) j =1 (c21= 0, R21= 0) j = 2 (c22= 5, R22 = 8) j = 3 (c23= 6, R23=9) j = 4 (c24= 8, R23=12) Optimum Solution X ๐‘“2 ๐‘‹ ๐‘“2 ๐‘‹ ๐‘“2 ๐‘‹ ๐‘“2 ๐‘‹ ๐‘“2 โˆ— ๐‘‹ j* 0 0 + 0 = 0 โ€“ โ€“ โ€“ 0 1 1 0 + 0 = 0 โ€“ โ€“ โ€“ 0 1 2 0 + 5 = 5 โ€“ โ€“ โ€“ 5 1 3 0 + 5 = 5 โ€“ โ€“ โ€“ 5 1 4 0 + 6 = 6 โ€“ โ€“ โ€“ 6 1 5 0 + 6 = 6 8 + 0 = 8 โ€“ โ€“ 8 2 6 0 + 6 = 6 8 + 0 = 8 9 + 0 = 9 โ€“ 9 3 7 0 + 6 = 6 8 + 5 = 13 9 + 0 = 9 โ€“ 13 2 8 0 + 6 = 6 8 + 5 = 13 9 + 5 = 14 12 + 0 = 12 14 3 9 0 + 6 = 6 8 + 6 = 14 9 + 5 = 14 12 + 0 = 12 14 2, 3 10 0 + 6 = 6 8 + 6 = 14 9 + 6 = 15 12 + 5 = 17 17 4
  • 17. Stage n = 3 (Factory 3) ๐‘“3 ๐‘‹ = ๐‘…3๐‘— ๐‘3๐‘— + ๐‘“2 (๐‘‹ โˆ’ ๐‘3๐‘—)* j =1 (c31 = 0, R31 = 0) j = 2 (c32= 1, R32 = 3) Optimum Solution X ๐‘“2 ๐‘‹ ๐‘“2 ๐‘‹ ๐‘“3 โˆ— ๐‘‹ j* 0 0 + 0 = 0 โ€“ 0 1 1 0 + 0 = 0 3 + 0 = 3 3 2 2 0 + 5 = 5 3 + 0 = 3 5 1 3 0 + 5 = 5 3 + 5 = 8 8 2 4 0 + 6 = 6 3 + 5 = 8 8 2 5 0 + 8 = 8 3 + 6 = 9 9 2 6 0 + 9 = 9 3 + 8 = 11 11 2 7 0 + 13 = 13 3 + 9 = 12 13 1 8 0 + 14 = 14 3 + 13 = 16 16 2 9 0 + 14 = 14 3 + 14 = 17 17 2 10 0 + 17 = 17 3 + 14 = 17 17 1, 2
  • 18. Optimal profit = 17 Optimal Policy: Factory 1 Factory 2 Factory 3 Option 1 2 4 1 Option 2 3 2 2 Option 3 2 3 2
  • 19. Example (Liberman) The owner of a chain of three grocery stores has purchased five crates of fresh strawberries. The estimated probability distribution of potential sales of the strawberries before spoilage differs among the three stores. Therefore, the owner wants to know how to allocate five crates to the three stores to maximize expected profit. For administrative reasons, the owner does not wish to split crates between stores. However, he is willing to distribute no crates to any of his stores.
  • 20. The following table gives the estimated expected profit at each store when it is allocated various numbers of crates: Use dynamic programming to determine how many of the five crates should be assigned to each of the three stores to maximize the total expected profit.
  • 21. Solution Let , The decision variables xn (n = 1, 2, 3) are the number of crates to allocate to stage (store) n. X = number of crates available for allocation to different stores. pn(xn) = be the profit from allocating xn crates to store n. ๐‘“๐‘› ๐‘‹ = profit from allocating X crates to store, n ๐‘“๐‘› โˆ— ๐‘‹ = Optimal profit from allocating X crates to store, n
  • 22. Now get, ๐‘“๐‘› ๐‘‹ = ๐‘๐‘› ๐‘ฅ๐‘› + ๐‘“๐‘›โˆ’1 โˆ— ๐‘‹ โˆ’ ๐‘ฅ๐‘› Consequently, the recursive relationship is for n = 1, 2, 3 ๐‘ฅ๐‘› = 0, 1, 2 โ€ฆ . ๐‘‹ where ๐‘“๐‘› โˆ— ๐‘‹ = max ๐‘“๐‘› โˆ— ๐‘‹ โˆ’ ๐‘ฅ๐‘› ๐‘“๐‘› โˆ— ๐‘‹ = max { ๐‘๐‘› ๐‘ฅ๐‘› + ๐‘“๐‘›โˆ’1 โˆ— ๐‘‹ โˆ’ ๐‘ฅ๐‘› } ๐‘ฅ๐‘› = 0, 1, 2 โ€ฆ . ๐‘‹
  • 23. ๐‘“1 ๐‘‹ = ๐‘1 ๐‘ฅ1 X 0 1 2 3 4 5 ๐‘“1 โˆ— ๐‘‹ ๐‘ฅ1 โˆ— 0 0 โ€“ โ€“ โ€“ โ€“ โ€“ 0 0 1 0 5 โ€“ โ€“ โ€“ โ€“ 5 1 2 0 5 9 โ€“ โ€“ โ€“ 9 2 3 0 5 9 14 โ€“ โ€“ 14 3 4 0 5 9 14 17 โ€“ 17 4 5 0 5 9 14 17 21 21 5 Stage, n = 1 (Store 1)
  • 24. Stage, n = 2 (Store 2) ๐‘“2 ๐‘‹ = ๐‘2 ๐‘ฅ2 + ๐‘“1 โˆ— X โˆ’ ๐‘ฅ2 X 0 1 2 3 4 5 ๐‘“2 โˆ— ๐‘‹ ๐‘ฅ2 โˆ— 0 0 + 0 = 0 โ€“ โ€“ โ€“ โ€“ โ€“ 0 0 1 0 + 5 = 5 6 + 0 = 6 โ€“ โ€“ โ€“ โ€“ 6 1 2 0 + 9 = 9 6 + 5 = 11 11+0= 11 โ€“ โ€“ โ€“ 11 1, 2 3 0+14 = 14 6 + 9= 15 11+5= 16 15+0= 15 โ€“ โ€“ 16 2 4 0+17= 17 6 + 14= 20 11+9= 20 14+5= 19 19+0= 19 โ€“ 20 1, 2 5 0 +21= 21 6 + 17= 23 11+14= 25 14+9= 23 19+5= 24 22+0= 22 25 2
  • 25. Stage, n = 3 (Store 3) ๐‘“3 ๐‘‹ = ๐‘3 ๐‘ฅ3 + ๐‘“2 โˆ— X โˆ’ ๐‘ฅ3 X 0 1 2 3 4 5 ๐‘“3 โˆ— X ๐‘ฅ3 โˆ— 0 0+0 = 0 โ€“ โ€“ โ€“ โ€“ โ€“ 0 0 1 0+6 = 6 4+0 = 4 โ€“ โ€“ โ€“ โ€“ 6 0 2 0+11 = 11 4+6 = 10 9+0 = 9 โ€“ โ€“ โ€“ 11 0 3 0+16 = 16 4+11 = 15 9+6 = 15 13+0 = 13 โ€“ โ€“ 16 0 4 0+20 = 20 4+16 = 20 9+11 = 20 13+6 = 19 18+0 = 18 โ€“ 20 0, 1 5 0+25 = 25 4+20 = 24 9+16 = 25 13+11 = 24 18+6 = 24 20+0 = 20 25 0, 2
  • 26. Optimal Solution Optimal profit = 25 Optimal Policy: Store 1 Store 2 Store 3 Option 1 3 2 0 Option 2 1 2 2