SlideShare a Scribd company logo
1
UNIT 7
DYNAMIC PROGRAMMING
Introduction
 Dynamic programming is a useful mathematical technique for making a sequence of
interrelated decisions.
 It provides a systematic procedure for determining the optimal combination
of decisions.
 In contrast to linear programming, there does not exist a standard mathematical
formulation of “the” dynamic programming problem.
 Rather, dynamic programming is a general type of approach to problem solving, and the
particular equations used must be developed to fit each situation.
 Therefore, a certain degree of ingenuity and insight into the general structure of dynamic
programming problems is required to recognize when and how a problem can be solved
by dynamic programming procedures.
 These abilities can best be developed by an exposure to a wide variety of dynamic
programming applications and a study of the characteristics that are common to all these
situations.
 The technique is useful in a large number of multi-period business problems, such as
(a) smoothing production employment,
(b) allocating capital funds,
(c) allocating salespeople to marketing areas, and
(d)evaluating investment opportunities.
Definition
 The mathematical technique of optimizing a sequence of inter-related decisions over a
period of time is called dynamic programming.
Differences between Linear Programming (LP) and Dynamic Programming (DP)
(1) First, there is no algorithm (like the simplex method) that can be programmed to solve all
problems. Instead, dynamic programming is a technique that allows a difficult problem to be
broken down into a sequence of easier sub-problems, which are then evaluated by stages.
(2) Second, linear programming is a method that gives single-stage (i.e., one-time period)
solutions. Dynamic programming has the power to determine the optimal solution over a one-
year time horizon by breaking the problem into 12 smaller one-month horizon problems and to
solve each of these optimally. Hence, it uses a multistage approach.
Dynamic Programming uses the backward recursive method for solving the problems
2
Bellman’s Principle of Optimality
 Bellman’s principle of optimality is the principle which guides the solution of a problem
using dynamic programming.
 It states:
Regardless of the decisions taken to enter a particular state in a particular stage, the
remaining decisions made for leaving that stage must constitute an optimal policy”
Steps in Dynamic Programming
1. Divide the original problem into sub-problems called stages.
2. Solve the last stage of the problem for all possible conditions or states.
3. Working backward from that last stage, solve each intermediate stage.
4. Obtain the optimal solution for the original problem by solving all stages sequentially.
Terminologyof Dynamic Programming
1. Stage: a period or a logical sub-problem.
2. State variables: possible beginning situations or conditions of a stage. These have also
been called the input variables.
3. Decision variables: alternatives or possible decisions that exist at each stage.
4. Decision criterion: a statement concerning the objective of the problem.
5. Optimal policy: a set of decision rules, developed as a result of the decision criteria, that
gives optimal decisions for any entering condition at any stage.
6. Transformation: normally, an algebraic statement that reveals the relationship between
stages.
 In most applications, dynamic programming obtains solutions by working backward
from the end of the problem toward the beginning, thus breaking up a large, unwieldy
problem into a series of smaller, more tractable problems
3
Example: Shortest Route Problem
Find the shortest path from City 1 to City 10 in the diagram shown below using the
recursive principle of Dynamic Programming.
Solution
Stage 1
 There is only one path from node (8) to node (10). The distance of (8) – (10) = 6.
 Therefore, label node (8) with 6. Indicate the segment (8) –(10) with a *
 There is only one path from node (9) to node (10). The distance of (9) – (10) = 7.
 Therefore, label node (9) with 7. Indicate the segment (9) –(10) with a *
Stage 2
From node (5)
 There are two paths from (5) to (10) viz., (5)-(8)-(10) and (5)-(9)-(10)
 Distance of path (5)-(8)-(10) = Length of (5)-(8) + Label of (8) = 5 + 6 = 11
 Distance of path (5)-(9)-(10) = Length of (5)-(9) + Label of (9) = 3 + 7 = 10
 Therefore label of (5) = Min {11, 10} = 10. Indicate (5) –(9) with a *
From node (6)
 There are two paths from (6) to (10) viz., (6)-(8)-(10) and (6)-(9)-(10)
 Distance of path (6)-(8)-(10) = Length of (6)-(8) + Label of (8) = 7 + 6 = 13
 Distance of path (6)-(9)-(10) = Length of (6)-(9) + Label of (9) = 8 + 7 = 15
 Therefore label of (6) = Min {13, 15} = 13. Indicate (6) –(8) with a *
4
From node (7)
 There are two paths from (7) to (10) viz., (7)-(8)-(10) and (7)-(9)-(10)
 Distance of path (7)-(8)-(10) = Length of (7)-(8) + Label of (8) = 2 + 6 = 8
 Distance of path (7)-(9)-(10) = Length of (7)-(9) + Label of (9) = 4 + 7 = 11
 Therefore label of (7) = Min {8, 11} = 8. Indicate (7) –(8) with a *
Stage 3
From node (2)
 There are three paths from (2) to (10) viz., (2)-(5), (2)-(6) and (2)-(7)
 Distance of path (2)-(5) = Length of (2)-(5) + Label of (5) = 4 +10 = 14
 Distance of path (2)-(6) = Length of (2)-(6) + Label of (6) = 2 + 13 = 15
 Distance of path (2)-(7) = Length of (2)-(7) + Label of (7) = 5 + 8 = 13
 Therefore label of (2) = Min {14, 15, 13} = 13. Indicate (2) –(7) with a *
From node (3)
 There are three paths from (3) to (10) viz., (3)-(5), (3)-(6) and (3)-(7)
 Distance of path (3)-(5) = Length of (3)-(5) + Label of (5) = 4 +10 = 14
 Distance of path (3)-(6) = Length of (3)-(6) + Label of (6) = 3 + 13 = 16
 Distance of path (3)-(7) = Length of (3)-(7) + Label of (7) = 7 + 8 = 15
 Therefore label of (3) = Min {14, 16, 15} = 14. Indicate (3) –(5) with a *
From node (4)
 There are three paths from (4) to (10) viz., (4)-(5), (4)-(6) and (4)-(7)
 Distance of path (4)-(5) = Length of (4)-(5) + Label of (5) = 2 +10 = 12
 Distance of path (4)-(6) = Length of (4)-(6) + Label of (6) = 1 + 13 = 14
 Distance of path (4)-(7) = Length of (4)-(7) + Label of (7) = 5 + 8 = 13
 Therefore label of (4) = Min {12, 14, 13} = 12. Indicate (4) –(5) with a *
Stage 4
From node (1)
 There are three paths from (1) to (10) viz., (1)-(2), (1)-(3) and (1)-(4)
 Distance of path (1)-(2) = Length of (1)-(2) + Label of (2) = 5 +13 = 18
 Distance of path (1)-(3) = Length of (1)-(3) + Label of (3) = 7 + 14 = 21
 Distance of path (1)-(4) = Length of (1)-(4) + Label of (4) = 3 + 12 = 15
 Therefore label of (1) = Min {18, 21, 15} = 15. Indicate (1) –(4) with a *
 Since the label of (1) is 15, the distance of the shortest path from (1) to (10) = 15.
Starting from (1) and following the paths indicated by *s,
the shortestpath is (1)-(4)-(5)-(9)-(10). Its distance is 15.

More Related Content

What's hot

North West Corner Method
North West Corner MethodNorth West Corner Method
North West Corner Method
Muhammad Waleed
 
Queuing model
Queuing model Queuing model
Queuing model
goyalrama
 
Business process re-engineering (BPR)
Business process re-engineering (BPR)Business process re-engineering (BPR)
Business process re-engineering (BPR)
Divya Uthirarajan
 
Transportation Problem
Transportation ProblemTransportation Problem
Transportation Problem
Alvin Niere
 
Manufacturing systems
Manufacturing systems Manufacturing systems
Manufacturing systems
Sumit Bhattacharya
 
Operations Research - Models
Operations Research - ModelsOperations Research - Models
Operations Research - Models
Sundar B N
 
Resource management techniques
Resource management techniquesResource management techniques
Resource management techniques
Dr Geetha Mohan
 
Queuing theory
Queuing theoryQueuing theory
Queuing theory
KULDEEP MATHUR
 
Unit 2 monte carlo simulation
Unit 2 monte carlo simulationUnit 2 monte carlo simulation
Unit 2 monte carlo simulation
DevaKumari Vijay
 
Operating characteristics ofqueuing system
Operating characteristics ofqueuing systemOperating characteristics ofqueuing system
Operating characteristics ofqueuing system
Aminul Tanvin
 
Game theory ppt
Game theory pptGame theory ppt
Game theory ppt
Anushka Kapoor
 
Linear programing
Linear programingLinear programing
Linear programing
Aniruddh Tiwari
 
Simulation & Modelling
Simulation & ModellingSimulation & Modelling
Simulation & Modelling
Saneem Nazim
 
Game Theory Operation Research
Game Theory Operation ResearchGame Theory Operation Research
Game Theory Operation Research
R A Shah
 
Queuing Theory - Operation Research
Queuing Theory - Operation ResearchQueuing Theory - Operation Research
Queuing Theory - Operation Research
Manmohan Anand
 
Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulation
Rajesh Piryani
 
Decision Support System in MIS.pptx
Decision Support System in MIS.pptxDecision Support System in MIS.pptx
Decision Support System in MIS.pptx
rajalakshmi5921
 
OPERATION RESEARCH Simulation
OPERATION RESEARCH SimulationOPERATION RESEARCH Simulation
OPERATION RESEARCH Simulation
Komal Hambir
 
Decision theory
Decision theoryDecision theory
Decision theory
Surekha98
 

What's hot (20)

North West Corner Method
North West Corner MethodNorth West Corner Method
North West Corner Method
 
Queuing model
Queuing model Queuing model
Queuing model
 
Business process re-engineering (BPR)
Business process re-engineering (BPR)Business process re-engineering (BPR)
Business process re-engineering (BPR)
 
Transportation Problem
Transportation ProblemTransportation Problem
Transportation Problem
 
Manufacturing systems
Manufacturing systems Manufacturing systems
Manufacturing systems
 
Operations Research - Models
Operations Research - ModelsOperations Research - Models
Operations Research - Models
 
Resource management techniques
Resource management techniquesResource management techniques
Resource management techniques
 
Queuing theory
Queuing theoryQueuing theory
Queuing theory
 
Unit 2 monte carlo simulation
Unit 2 monte carlo simulationUnit 2 monte carlo simulation
Unit 2 monte carlo simulation
 
Operating characteristics ofqueuing system
Operating characteristics ofqueuing systemOperating characteristics ofqueuing system
Operating characteristics ofqueuing system
 
Game theory ppt
Game theory pptGame theory ppt
Game theory ppt
 
Linear programing
Linear programingLinear programing
Linear programing
 
Simulation & Modelling
Simulation & ModellingSimulation & Modelling
Simulation & Modelling
 
Game Theory Operation Research
Game Theory Operation ResearchGame Theory Operation Research
Game Theory Operation Research
 
Queuing Theory - Operation Research
Queuing Theory - Operation ResearchQueuing Theory - Operation Research
Queuing Theory - Operation Research
 
Game theory
Game theoryGame theory
Game theory
 
Monte carlo simulation
Monte carlo simulationMonte carlo simulation
Monte carlo simulation
 
Decision Support System in MIS.pptx
Decision Support System in MIS.pptxDecision Support System in MIS.pptx
Decision Support System in MIS.pptx
 
OPERATION RESEARCH Simulation
OPERATION RESEARCH SimulationOPERATION RESEARCH Simulation
OPERATION RESEARCH Simulation
 
Decision theory
Decision theoryDecision theory
Decision theory
 

Viewers also liked

Daa:Dynamic Programing
Daa:Dynamic ProgramingDaa:Dynamic Programing
Daa:Dynamic Programingrupali_2bonde
 
Unit 6 inventory
Unit 6 inventoryUnit 6 inventory
Unit 6 inventory
Nageswara Rao Thots
 
OR 14 15-unit_4
OR 14 15-unit_4OR 14 15-unit_4
OR 14 15-unit_4
Nageswara Rao Thots
 
OR (JNTUK) III Mech Unit 8 simulation
OR (JNTUK) III Mech Unit 8  simulationOR (JNTUK) III Mech Unit 8  simulation
OR (JNTUK) III Mech Unit 8 simulation
Nageswara Rao Thots
 
OR 14 15-unit_2
OR 14 15-unit_2OR 14 15-unit_2
OR 14 15-unit_2
Nageswara Rao Thots
 
OR 14 15-unit_1
OR 14 15-unit_1OR 14 15-unit_1
OR 14 15-unit_1
Nageswara Rao Thots
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programmingOye Tu
 
OR Unit 5 queuing theory
OR Unit 5 queuing theoryOR Unit 5 queuing theory
OR Unit 5 queuing theory
Nageswara Rao Thots
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
Sahil Kumar
 
Queuing theory
Queuing theoryQueuing theory
Queuing theory
Amit Sinha
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programmingparamalways
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
Gopi Saiteja
 
A software approach to mathematical programming
A software approach to mathematical programmingA software approach to mathematical programming
A software approach to mathematical programming
Arian Razmi Farooji
 
Classbfs121001503719748
Classbfs121001503719748Classbfs121001503719748
Classbfs121001503719748Raju Panthadi
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
Melaku Bayih Demessie
 
A comparative study of initial basic feasible solution methods
A comparative study of initial basic feasible solution methodsA comparative study of initial basic feasible solution methods
A comparative study of initial basic feasible solution methodsAlexander Decker
 
OR 14 15-unit_3
OR 14 15-unit_3OR 14 15-unit_3
OR 14 15-unit_3
Nageswara Rao Thots
 
Transportation lecture
Transportation lectureTransportation lecture
Transportation lecture
Moudud Hasan
 
Dynamic programming class 16
Dynamic programming class 16Dynamic programming class 16
Dynamic programming class 16Kumar
 
BC 504-Operation Research
BC 504-Operation ResearchBC 504-Operation Research
BC 504-Operation Research
PCTE
 

Viewers also liked (20)

Daa:Dynamic Programing
Daa:Dynamic ProgramingDaa:Dynamic Programing
Daa:Dynamic Programing
 
Unit 6 inventory
Unit 6 inventoryUnit 6 inventory
Unit 6 inventory
 
OR 14 15-unit_4
OR 14 15-unit_4OR 14 15-unit_4
OR 14 15-unit_4
 
OR (JNTUK) III Mech Unit 8 simulation
OR (JNTUK) III Mech Unit 8  simulationOR (JNTUK) III Mech Unit 8  simulation
OR (JNTUK) III Mech Unit 8 simulation
 
OR 14 15-unit_2
OR 14 15-unit_2OR 14 15-unit_2
OR 14 15-unit_2
 
OR 14 15-unit_1
OR 14 15-unit_1OR 14 15-unit_1
OR 14 15-unit_1
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programming
 
OR Unit 5 queuing theory
OR Unit 5 queuing theoryOR Unit 5 queuing theory
OR Unit 5 queuing theory
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Queuing theory
Queuing theoryQueuing theory
Queuing theory
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
A software approach to mathematical programming
A software approach to mathematical programmingA software approach to mathematical programming
A software approach to mathematical programming
 
Classbfs121001503719748
Classbfs121001503719748Classbfs121001503719748
Classbfs121001503719748
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
A comparative study of initial basic feasible solution methods
A comparative study of initial basic feasible solution methodsA comparative study of initial basic feasible solution methods
A comparative study of initial basic feasible solution methods
 
OR 14 15-unit_3
OR 14 15-unit_3OR 14 15-unit_3
OR 14 15-unit_3
 
Transportation lecture
Transportation lectureTransportation lecture
Transportation lecture
 
Dynamic programming class 16
Dynamic programming class 16Dynamic programming class 16
Dynamic programming class 16
 
BC 504-Operation Research
BC 504-Operation ResearchBC 504-Operation Research
BC 504-Operation Research
 

Similar to Unit 7 dynamic programming

Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
Nv Thejaswini
 
dynamic programming complete by Mumtaz Ali (03154103173)
dynamic programming complete by Mumtaz Ali (03154103173)dynamic programming complete by Mumtaz Ali (03154103173)
dynamic programming complete by Mumtaz Ali (03154103173)
Mumtaz Ali
 
Lecture#9
Lecture#9Lecture#9
Lecture#9
Ali Shah
 
A practical work of matlab
A practical work of matlabA practical work of matlab
A practical work of matlab
SalanSD
 
Improved Timing Estimation Using Iterative Normalization Technique for OFDM S...
Improved Timing Estimation Using Iterative Normalization Technique for OFDM S...Improved Timing Estimation Using Iterative Normalization Technique for OFDM S...
Improved Timing Estimation Using Iterative Normalization Technique for OFDM S...
IJECEIAES
 
Algorithmic research
Algorithmic researchAlgorithmic research
Algorithmic research
Merlin Florrence
 
Nth term algebra_level_6
Nth term algebra_level_6Nth term algebra_level_6
Nth term algebra_level_6
harlie90
 
An improved tabular technique for presenting the various
An improved tabular technique for presenting the variousAn improved tabular technique for presenting the various
An improved tabular technique for presenting the variousAlexander Decker
 
An improved tabular technique for presenting the various
An improved tabular technique for presenting the variousAn improved tabular technique for presenting the various
An improved tabular technique for presenting the variousAlexander Decker
 
SURVEY ON POLYGONAL APPROXIMATION TECHNIQUES FOR DIGITAL PLANAR CURVES
SURVEY ON POLYGONAL APPROXIMATION TECHNIQUES FOR DIGITAL PLANAR CURVESSURVEY ON POLYGONAL APPROXIMATION TECHNIQUES FOR DIGITAL PLANAR CURVES
SURVEY ON POLYGONAL APPROXIMATION TECHNIQUES FOR DIGITAL PLANAR CURVES
Zac Darcy
 
Operation research model for solving TSP
Operation research model for solving TSPOperation research model for solving TSP
Operation research model for solving TSP
DrGovindshaysharma
 
Branch and bounding : Data structures
Branch and bounding : Data structuresBranch and bounding : Data structures
Branch and bounding : Data structures
Kàŕtheek Jåvvàjí
 
Hand gesture recognition using discrete wavelet transform and hidden Markov m...
Hand gesture recognition using discrete wavelet transform and hidden Markov m...Hand gesture recognition using discrete wavelet transform and hidden Markov m...
Hand gesture recognition using discrete wavelet transform and hidden Markov m...
TELKOMNIKA JOURNAL
 
7-White Box Testing.ppt
7-White Box Testing.ppt7-White Box Testing.ppt
7-White Box Testing.ppt
HirenderPal
 
Data_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.pptData_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.ppt
ISHANAMRITSRIVASTAVA
 
Ch07 1-2-overview graphcoverage
Ch07 1-2-overview graphcoverageCh07 1-2-overview graphcoverage
Ch07 1-2-overview graphcoverage
Rija Hameed
 
Measures of Variation (Ungrouped Data)
Measures of Variation (Ungrouped Data)Measures of Variation (Ungrouped Data)
Measures of Variation (Ungrouped Data)
Zaira Mae
 
Monte Carlo Simulation
Monte Carlo SimulationMonte Carlo Simulation
Monte Carlo Simulation
Deepti Singh
 
White box testing
White box testingWhite box testing
White box testing
Purvi Sankhe
 

Similar to Unit 7 dynamic programming (20)

algorithm Unit 3
algorithm Unit 3algorithm Unit 3
algorithm Unit 3
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
 
dynamic programming complete by Mumtaz Ali (03154103173)
dynamic programming complete by Mumtaz Ali (03154103173)dynamic programming complete by Mumtaz Ali (03154103173)
dynamic programming complete by Mumtaz Ali (03154103173)
 
Lecture#9
Lecture#9Lecture#9
Lecture#9
 
A practical work of matlab
A practical work of matlabA practical work of matlab
A practical work of matlab
 
Improved Timing Estimation Using Iterative Normalization Technique for OFDM S...
Improved Timing Estimation Using Iterative Normalization Technique for OFDM S...Improved Timing Estimation Using Iterative Normalization Technique for OFDM S...
Improved Timing Estimation Using Iterative Normalization Technique for OFDM S...
 
Algorithmic research
Algorithmic researchAlgorithmic research
Algorithmic research
 
Nth term algebra_level_6
Nth term algebra_level_6Nth term algebra_level_6
Nth term algebra_level_6
 
An improved tabular technique for presenting the various
An improved tabular technique for presenting the variousAn improved tabular technique for presenting the various
An improved tabular technique for presenting the various
 
An improved tabular technique for presenting the various
An improved tabular technique for presenting the variousAn improved tabular technique for presenting the various
An improved tabular technique for presenting the various
 
SURVEY ON POLYGONAL APPROXIMATION TECHNIQUES FOR DIGITAL PLANAR CURVES
SURVEY ON POLYGONAL APPROXIMATION TECHNIQUES FOR DIGITAL PLANAR CURVESSURVEY ON POLYGONAL APPROXIMATION TECHNIQUES FOR DIGITAL PLANAR CURVES
SURVEY ON POLYGONAL APPROXIMATION TECHNIQUES FOR DIGITAL PLANAR CURVES
 
Operation research model for solving TSP
Operation research model for solving TSPOperation research model for solving TSP
Operation research model for solving TSP
 
Branch and bounding : Data structures
Branch and bounding : Data structuresBranch and bounding : Data structures
Branch and bounding : Data structures
 
Hand gesture recognition using discrete wavelet transform and hidden Markov m...
Hand gesture recognition using discrete wavelet transform and hidden Markov m...Hand gesture recognition using discrete wavelet transform and hidden Markov m...
Hand gesture recognition using discrete wavelet transform and hidden Markov m...
 
7-White Box Testing.ppt
7-White Box Testing.ppt7-White Box Testing.ppt
7-White Box Testing.ppt
 
Data_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.pptData_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.ppt
 
Ch07 1-2-overview graphcoverage
Ch07 1-2-overview graphcoverageCh07 1-2-overview graphcoverage
Ch07 1-2-overview graphcoverage
 
Measures of Variation (Ungrouped Data)
Measures of Variation (Ungrouped Data)Measures of Variation (Ungrouped Data)
Measures of Variation (Ungrouped Data)
 
Monte Carlo Simulation
Monte Carlo SimulationMonte Carlo Simulation
Monte Carlo Simulation
 
White box testing
White box testingWhite box testing
White box testing
 

Recently uploaded

Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 

Unit 7 dynamic programming

  • 1. 1 UNIT 7 DYNAMIC PROGRAMMING Introduction  Dynamic programming is a useful mathematical technique for making a sequence of interrelated decisions.  It provides a systematic procedure for determining the optimal combination of decisions.  In contrast to linear programming, there does not exist a standard mathematical formulation of “the” dynamic programming problem.  Rather, dynamic programming is a general type of approach to problem solving, and the particular equations used must be developed to fit each situation.  Therefore, a certain degree of ingenuity and insight into the general structure of dynamic programming problems is required to recognize when and how a problem can be solved by dynamic programming procedures.  These abilities can best be developed by an exposure to a wide variety of dynamic programming applications and a study of the characteristics that are common to all these situations.  The technique is useful in a large number of multi-period business problems, such as (a) smoothing production employment, (b) allocating capital funds, (c) allocating salespeople to marketing areas, and (d)evaluating investment opportunities. Definition  The mathematical technique of optimizing a sequence of inter-related decisions over a period of time is called dynamic programming. Differences between Linear Programming (LP) and Dynamic Programming (DP) (1) First, there is no algorithm (like the simplex method) that can be programmed to solve all problems. Instead, dynamic programming is a technique that allows a difficult problem to be broken down into a sequence of easier sub-problems, which are then evaluated by stages. (2) Second, linear programming is a method that gives single-stage (i.e., one-time period) solutions. Dynamic programming has the power to determine the optimal solution over a one- year time horizon by breaking the problem into 12 smaller one-month horizon problems and to solve each of these optimally. Hence, it uses a multistage approach. Dynamic Programming uses the backward recursive method for solving the problems
  • 2. 2 Bellman’s Principle of Optimality  Bellman’s principle of optimality is the principle which guides the solution of a problem using dynamic programming.  It states: Regardless of the decisions taken to enter a particular state in a particular stage, the remaining decisions made for leaving that stage must constitute an optimal policy” Steps in Dynamic Programming 1. Divide the original problem into sub-problems called stages. 2. Solve the last stage of the problem for all possible conditions or states. 3. Working backward from that last stage, solve each intermediate stage. 4. Obtain the optimal solution for the original problem by solving all stages sequentially. Terminologyof Dynamic Programming 1. Stage: a period or a logical sub-problem. 2. State variables: possible beginning situations or conditions of a stage. These have also been called the input variables. 3. Decision variables: alternatives or possible decisions that exist at each stage. 4. Decision criterion: a statement concerning the objective of the problem. 5. Optimal policy: a set of decision rules, developed as a result of the decision criteria, that gives optimal decisions for any entering condition at any stage. 6. Transformation: normally, an algebraic statement that reveals the relationship between stages.  In most applications, dynamic programming obtains solutions by working backward from the end of the problem toward the beginning, thus breaking up a large, unwieldy problem into a series of smaller, more tractable problems
  • 3. 3 Example: Shortest Route Problem Find the shortest path from City 1 to City 10 in the diagram shown below using the recursive principle of Dynamic Programming. Solution Stage 1  There is only one path from node (8) to node (10). The distance of (8) – (10) = 6.  Therefore, label node (8) with 6. Indicate the segment (8) –(10) with a *  There is only one path from node (9) to node (10). The distance of (9) – (10) = 7.  Therefore, label node (9) with 7. Indicate the segment (9) –(10) with a * Stage 2 From node (5)  There are two paths from (5) to (10) viz., (5)-(8)-(10) and (5)-(9)-(10)  Distance of path (5)-(8)-(10) = Length of (5)-(8) + Label of (8) = 5 + 6 = 11  Distance of path (5)-(9)-(10) = Length of (5)-(9) + Label of (9) = 3 + 7 = 10  Therefore label of (5) = Min {11, 10} = 10. Indicate (5) –(9) with a * From node (6)  There are two paths from (6) to (10) viz., (6)-(8)-(10) and (6)-(9)-(10)  Distance of path (6)-(8)-(10) = Length of (6)-(8) + Label of (8) = 7 + 6 = 13  Distance of path (6)-(9)-(10) = Length of (6)-(9) + Label of (9) = 8 + 7 = 15  Therefore label of (6) = Min {13, 15} = 13. Indicate (6) –(8) with a *
  • 4. 4 From node (7)  There are two paths from (7) to (10) viz., (7)-(8)-(10) and (7)-(9)-(10)  Distance of path (7)-(8)-(10) = Length of (7)-(8) + Label of (8) = 2 + 6 = 8  Distance of path (7)-(9)-(10) = Length of (7)-(9) + Label of (9) = 4 + 7 = 11  Therefore label of (7) = Min {8, 11} = 8. Indicate (7) –(8) with a * Stage 3 From node (2)  There are three paths from (2) to (10) viz., (2)-(5), (2)-(6) and (2)-(7)  Distance of path (2)-(5) = Length of (2)-(5) + Label of (5) = 4 +10 = 14  Distance of path (2)-(6) = Length of (2)-(6) + Label of (6) = 2 + 13 = 15  Distance of path (2)-(7) = Length of (2)-(7) + Label of (7) = 5 + 8 = 13  Therefore label of (2) = Min {14, 15, 13} = 13. Indicate (2) –(7) with a * From node (3)  There are three paths from (3) to (10) viz., (3)-(5), (3)-(6) and (3)-(7)  Distance of path (3)-(5) = Length of (3)-(5) + Label of (5) = 4 +10 = 14  Distance of path (3)-(6) = Length of (3)-(6) + Label of (6) = 3 + 13 = 16  Distance of path (3)-(7) = Length of (3)-(7) + Label of (7) = 7 + 8 = 15  Therefore label of (3) = Min {14, 16, 15} = 14. Indicate (3) –(5) with a * From node (4)  There are three paths from (4) to (10) viz., (4)-(5), (4)-(6) and (4)-(7)  Distance of path (4)-(5) = Length of (4)-(5) + Label of (5) = 2 +10 = 12  Distance of path (4)-(6) = Length of (4)-(6) + Label of (6) = 1 + 13 = 14  Distance of path (4)-(7) = Length of (4)-(7) + Label of (7) = 5 + 8 = 13  Therefore label of (4) = Min {12, 14, 13} = 12. Indicate (4) –(5) with a * Stage 4 From node (1)  There are three paths from (1) to (10) viz., (1)-(2), (1)-(3) and (1)-(4)  Distance of path (1)-(2) = Length of (1)-(2) + Label of (2) = 5 +13 = 18  Distance of path (1)-(3) = Length of (1)-(3) + Label of (3) = 7 + 14 = 21  Distance of path (1)-(4) = Length of (1)-(4) + Label of (4) = 3 + 12 = 15  Therefore label of (1) = Min {18, 21, 15} = 15. Indicate (1) –(4) with a *  Since the label of (1) is 15, the distance of the shortest path from (1) to (10) = 15. Starting from (1) and following the paths indicated by *s, the shortestpath is (1)-(4)-(5)-(9)-(10). Its distance is 15.