SlideShare a Scribd company logo
2
Most read
3
Most read
9
Most read
Prepared by-
▪ Bhavin Darji
Guided by –
SUBJECT-ADA (2150703)
Introduction to Dynamic Programming, Principle of Optimality
Introduction
▪ Typically applied to optimization problem.
▪ Invented by a U.S. Mathematician Richard Bellman in 1950.
▪ In the word Dynamic Programming the word programming stands for
planning.
▪ Dynamic Programming is technique for solving problems with
overlapping subproblems.
▪ In this method each subproblem is solved only once.
▪ The result of each subproblem is recorded in a table from which we
can obtain a solution to the original problem.
▪ In Dynamic computing duplications in solution is avoided totally.
▪ Efficient then Divide and conquer strategy.
▪ Uses bottom up approach of problem solving.
Dynamic Programming
▪ Dynamic Programming is an algorithm design technique for
optimization problems: often minimizing or maximizing.
▪ Like divide and conquer, DP solves problems by combining solutions
to subproblems.
▪ Unlike divide and conquer, subproblems are not independent.
▪ Subproblems may share subproblems
▪ However, solution to one subproblem may not affect the solutions
to other subproblems of the same problem.
DP reduces computation by
▪ Solving subproblems in a bottom-up fashion.
▪ Storing solution to a subproblem the first time it is solved.
▪ Looking up the solution when subproblem is encountered again.
Key Idea
 The key idea is to save answers of overlapping smaller sub-problems
to avoid recomputation.
▪ determine structure of optimal solutions.
Steps in Dynamic Programming
1. Characterize structure of an optimal solution.
2. Define value of optimal solution recursively.
3. Compute optimal solution values either top-down with
caching or bottom-up in a table.
4. Construct an optimal solution from computed values.
Dynamic Programming Properties
• An instance is solved using the solutions for smaller instances.
• The solutions for a smaller instance might be needed multiple times, so
store their results in a table.
• Thus each smaller instance is solved only once.
• Additional space is used to save time.
Principle of Optimality
▪ Obtains the solution using principle of optimality.
▪ In an optimal sequence of decisions or choices, each subsequence must
also be optimal.
▪ When it is not possible to apply the principle of optimality it is almost
impossible to obtain the solution using the dynamic programming
approach.
▪ Example: Finding of shortest path in a given graph uses the principle
of optimality.
Problem solving using Dynamic Programming
▪ Various problem that can be solved using dynamic
programming are-
▪ Calculating the Binomial coefficient
▪ Making change problem
▪ Assembly line scheduling
▪ Knapsack problem
▪ Shortest path
▪ Matrix chain Multiplication
ThankYou 

More Related Content

What's hot (20)

PPTX
Graph coloring using backtracking
shashidharPapishetty
 
PPT
Greedy Algorihm
Muhammad Amjad Rana
 
DOC
Branch and bound
Nv Thejaswini
 
PPTX
Performance analysis(Time & Space Complexity)
swapnac12
 
PDF
Daa notes 1
smruti sarangi
 
PPTX
Chess board problem(divide and conquer)
RASHIARORA8
 
PPTX
And or graph
Ali A Jalil
 
PPTX
8 queens problem using back tracking
Tech_MX
 
PPTX
Knapsack problem using greedy approach
padmeshagrekar
 
PPTX
Principal Sources of Optimization in compiler design
LogsAk
 
PPTX
Webinar : P, NP, NP-Hard , NP - Complete problems
Ziyauddin Shaik
 
PPTX
15 puzzle problem using branch and bound
Abhishek Singh
 
PPT
Heuristic Search Techniques Unit -II.ppt
karthikaparthasarath
 
PPTX
Asymptotic Notation
Protap Mondal
 
PPTX
Merge sort algorithm
srutisenpatra
 
PPTX
Depth Buffer Method
Ummiya Mohammedi
 
PPT
Disk scheduling
NEERAJ BAGHEL
 
PPT
Branch and bound
Dr Shashikant Athawale
 
PDF
operating system structure
Waseem Ud Din Farooqui
 
PPTX
0 1 knapsack using branch and bound
Abhishek Singh
 
Graph coloring using backtracking
shashidharPapishetty
 
Greedy Algorihm
Muhammad Amjad Rana
 
Branch and bound
Nv Thejaswini
 
Performance analysis(Time & Space Complexity)
swapnac12
 
Daa notes 1
smruti sarangi
 
Chess board problem(divide and conquer)
RASHIARORA8
 
And or graph
Ali A Jalil
 
8 queens problem using back tracking
Tech_MX
 
Knapsack problem using greedy approach
padmeshagrekar
 
Principal Sources of Optimization in compiler design
LogsAk
 
Webinar : P, NP, NP-Hard , NP - Complete problems
Ziyauddin Shaik
 
15 puzzle problem using branch and bound
Abhishek Singh
 
Heuristic Search Techniques Unit -II.ppt
karthikaparthasarath
 
Asymptotic Notation
Protap Mondal
 
Merge sort algorithm
srutisenpatra
 
Depth Buffer Method
Ummiya Mohammedi
 
Disk scheduling
NEERAJ BAGHEL
 
Branch and bound
Dr Shashikant Athawale
 
operating system structure
Waseem Ud Din Farooqui
 
0 1 knapsack using branch and bound
Abhishek Singh
 

Similar to Introduction to Dynamic Programming, Principle of Optimality (20)

PPTX
Computer science in Dynamic programming .pptx
shorabi2127061
 
PPT
Dynamic programming 2
Roy Thomas
 
PPTX
esign and Analysis of Algorithms Presentation.pptx
Niraj759370
 
PDF
L21_L27_Unit_5_Dynamic_Programming Computer Science
priyanshukumarbt23cs
 
PPTX
Dynamic programming, Branch and bound algorithm & Greedy algorithms
Dr. SURBHI SAROHA
 
PDF
Dynamic Programming Algorithm CSI-504.pdf
dinemma1
 
PPTX
Dynamic programming in Design Analysis and Algorithms
NikunjGoyal20
 
PPTX
Module 2ppt.pptx divid and conquer method
JyoReddy9
 
PPTX
dinosourrrrrrrrrrrrrrrrrrrrrr formula .pptx
ShohidulIslamSovon
 
PPTX
Introduction to dynamic programming
Amisha Narsingani
 
PPTX
Algorithms Design Patterns
Ashwin Shiv
 
PPTX
Dynamic programming class 16
Kumar
 
PPT
Dynamic programming
Md.Mojibul Hoque
 
PPTX
DynamicProgramming.pptx
SaimaShaheen14
 
PPT
Pintu ram
pinturam2
 
PPTX
3. CPT121 - Introduction to Problem Solving - Module 1 - Unit 3.pptx
Agoyi1
 
PPTX
CH-1.1 Introduction (1).pptx
satvikkushwaha1
 
PPTX
algo classification.pptx
ShivaniSharma335055
 
PPTX
ADA Unit 2.pptx
AmanKumar879992
 
PPTX
QA CHAPTER II.pptx
Teshome48
 
Computer science in Dynamic programming .pptx
shorabi2127061
 
Dynamic programming 2
Roy Thomas
 
esign and Analysis of Algorithms Presentation.pptx
Niraj759370
 
L21_L27_Unit_5_Dynamic_Programming Computer Science
priyanshukumarbt23cs
 
Dynamic programming, Branch and bound algorithm & Greedy algorithms
Dr. SURBHI SAROHA
 
Dynamic Programming Algorithm CSI-504.pdf
dinemma1
 
Dynamic programming in Design Analysis and Algorithms
NikunjGoyal20
 
Module 2ppt.pptx divid and conquer method
JyoReddy9
 
dinosourrrrrrrrrrrrrrrrrrrrrr formula .pptx
ShohidulIslamSovon
 
Introduction to dynamic programming
Amisha Narsingani
 
Algorithms Design Patterns
Ashwin Shiv
 
Dynamic programming class 16
Kumar
 
Dynamic programming
Md.Mojibul Hoque
 
DynamicProgramming.pptx
SaimaShaheen14
 
Pintu ram
pinturam2
 
3. CPT121 - Introduction to Problem Solving - Module 1 - Unit 3.pptx
Agoyi1
 
CH-1.1 Introduction (1).pptx
satvikkushwaha1
 
algo classification.pptx
ShivaniSharma335055
 
ADA Unit 2.pptx
AmanKumar879992
 
QA CHAPTER II.pptx
Teshome48
 
Ad

Recently uploaded (20)

PPTX
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
PPT
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
PPTX
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
PDF
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PPTX
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
PDF
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PDF
SERVERLESS PERSONAL TO-DO LIST APPLICATION
anushaashraf20
 
PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PDF
3rd International Conference on Machine Learning and IoT (MLIoT 2025)
ClaraZara1
 
PDF
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
PPT
New_school_Engineering_presentation_011707.ppt
VinayKumar304579
 
PPT
Testing and final inspection of a solar PV system
MuhammadSanni2
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPTX
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
PPTX
Distribution reservoir and service storage pptx
dhanashree78
 
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
Footbinding.pptmnmkjkjkknmnnjkkkkkkkkkkkkkk
mamadoundiaye42742
 
How Industrial Project Management Differs From Construction.pptx
jamespit799
 
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
SERVERLESS PERSONAL TO-DO LIST APPLICATION
anushaashraf20
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
3rd International Conference on Machine Learning and IoT (MLIoT 2025)
ClaraZara1
 
REINFORCEMENT LEARNING IN DECISION MAKING SEMINAR REPORT
anushaashraf20
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
New_school_Engineering_presentation_011707.ppt
VinayKumar304579
 
Testing and final inspection of a solar PV system
MuhammadSanni2
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
Distribution reservoir and service storage pptx
dhanashree78
 
Ad

Introduction to Dynamic Programming, Principle of Optimality

  • 1. Prepared by- ▪ Bhavin Darji Guided by – SUBJECT-ADA (2150703) Introduction to Dynamic Programming, Principle of Optimality
  • 2. Introduction ▪ Typically applied to optimization problem. ▪ Invented by a U.S. Mathematician Richard Bellman in 1950. ▪ In the word Dynamic Programming the word programming stands for planning.
  • 3. ▪ Dynamic Programming is technique for solving problems with overlapping subproblems. ▪ In this method each subproblem is solved only once. ▪ The result of each subproblem is recorded in a table from which we can obtain a solution to the original problem. ▪ In Dynamic computing duplications in solution is avoided totally. ▪ Efficient then Divide and conquer strategy. ▪ Uses bottom up approach of problem solving.
  • 4. Dynamic Programming ▪ Dynamic Programming is an algorithm design technique for optimization problems: often minimizing or maximizing. ▪ Like divide and conquer, DP solves problems by combining solutions to subproblems. ▪ Unlike divide and conquer, subproblems are not independent. ▪ Subproblems may share subproblems ▪ However, solution to one subproblem may not affect the solutions to other subproblems of the same problem.
  • 5. DP reduces computation by ▪ Solving subproblems in a bottom-up fashion. ▪ Storing solution to a subproblem the first time it is solved. ▪ Looking up the solution when subproblem is encountered again.
  • 6. Key Idea  The key idea is to save answers of overlapping smaller sub-problems to avoid recomputation. ▪ determine structure of optimal solutions.
  • 7. Steps in Dynamic Programming 1. Characterize structure of an optimal solution. 2. Define value of optimal solution recursively. 3. Compute optimal solution values either top-down with caching or bottom-up in a table. 4. Construct an optimal solution from computed values.
  • 8. Dynamic Programming Properties • An instance is solved using the solutions for smaller instances. • The solutions for a smaller instance might be needed multiple times, so store their results in a table. • Thus each smaller instance is solved only once. • Additional space is used to save time.
  • 9. Principle of Optimality ▪ Obtains the solution using principle of optimality. ▪ In an optimal sequence of decisions or choices, each subsequence must also be optimal. ▪ When it is not possible to apply the principle of optimality it is almost impossible to obtain the solution using the dynamic programming approach. ▪ Example: Finding of shortest path in a given graph uses the principle of optimality.
  • 10. Problem solving using Dynamic Programming ▪ Various problem that can be solved using dynamic programming are- ▪ Calculating the Binomial coefficient ▪ Making change problem ▪ Assembly line scheduling ▪ Knapsack problem ▪ Shortest path ▪ Matrix chain Multiplication