SlideShare a Scribd company logo
5
Most read
8
Most read
10
Most read
Elements of Dynamic ProgrammingAn Introduction byTafhimUl IslamC091008CSE 4th SemesterInternational Islamic University Chittagong
What is Dynamic ProgrammingDynamic Programming (DP) is not an algorithm. It’s a technique/approach that we use to build efficient algorithms for problems of very specific class
The ElementsOptimal SubstructureOverlapping sub-problemMemoization
What is Substructure?A substructure is a structure itself that helps a bigger structure of the same kind to exist.The substructure does not play an auxiliary roleIt is an essential part of the super structureIt is only smaller in size compared to the super structureIt has the same properties of the superstructure
Optimal SubstructureSo optimal substructure is simply the optimal selection among all the possible substructures that can help a super structure of the same kind to existExample: To know how to multiply n matrices optimally we must multiply the last matrix with the optimal multiplication result of the n-1 other matrices. The base case for the recursion here is that the optimal parenthesization of
Optimal SubstructureTo build a building with the best possible strength, we need to build each level as optimally as possibleTo solve a mathematical problem, we all the smaller problems inside that problem to have the correct result. Each problem might depend on the previous problem solved. So we need to take care of all the problems optimally, with correct calculations.
Overlapping Sub-problemOverlapping sub-problem is found in those problems where bigger problems share the same smaller problems. This means, while solving larger problems through their sub-problems we find the same sub-problems in two or more different large problems. In these cases a sub-problem is usually found to be solved previously.
Overlapping Sub-problemOverlapping sub-problems can be found in Matrix-Chain-Multiplication (MCM) problem.
Cases where mistakes might occurUnweighted shortest path: Find a path from u to v consisting of the fewest edges. Such a path must be simple, since removing a cycle from a path pro-duces a path with fewer edges.Unweighted longest simple path: Find a simple path from u to v consisting of the most edges. We need to include the requirement of simplicity because other-wise we can traverse a cycle as many times as we like to create paths with an arbitrarily large number of edges.
MemoizaitonThe memoization technique is the method of storing values of solutions to previously solved problems. This generally means storing the values in a data structure that helps us reach them efficiently when the same problems occur during the program’s execution. The data structure can be anything that helps us do that but generally a table is used.

More Related Content

PPTX
Predicate logic
PPTX
daa-unit-3-greedy method
PPTX
2 phase locking protocol DBMS
PPTX
Type checking in compiler design
DOC
Unit 2 in daa
PPTX
Realibity design
DOC
Naming in Distributed System
PPTX
Transport layer
Predicate logic
daa-unit-3-greedy method
2 phase locking protocol DBMS
Type checking in compiler design
Unit 2 in daa
Realibity design
Naming in Distributed System
Transport layer

What's hot (20)

DOCX
Concurrency Control Techniques
PPTX
Semantic net in AI
PPTX
Page replacement algorithms
PPT
Knapsack problem using fixed tuple
PPTX
Strassen's matrix multiplication
PPTX
Webinar : P, NP, NP-Hard , NP - Complete problems
PPT
Np cooks theorem
PPTX
The n Queen Problem
PPT
recursive transition_networks
PPTX
Sum of subset problem.pptx
PPTX
Distributed DBMS - Unit 5 - Semantic Data Control
PPTX
Distributed DBMS - Unit 6 - Query Processing
PPT
BackTracking Algorithm: Technique and Examples
PDF
Design issues of dos
PPTX
Semantic nets in artificial intelligence
PPTX
Grasp patterns and its types
PPTX
Public Key Cryptosystem
PDF
I. AO* SEARCH ALGORITHM
PPTX
Routing algorithm
PPTX
Principle source of optimazation
Concurrency Control Techniques
Semantic net in AI
Page replacement algorithms
Knapsack problem using fixed tuple
Strassen's matrix multiplication
Webinar : P, NP, NP-Hard , NP - Complete problems
Np cooks theorem
The n Queen Problem
recursive transition_networks
Sum of subset problem.pptx
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 6 - Query Processing
BackTracking Algorithm: Technique and Examples
Design issues of dos
Semantic nets in artificial intelligence
Grasp patterns and its types
Public Key Cryptosystem
I. AO* SEARCH ALGORITHM
Routing algorithm
Principle source of optimazation
Ad

Similar to Elements of dynamic programming (20)

PPTX
Introduction to dynamic programming
PDF
Disign and Analysis for algorithm in computer science and technology
PPTX
DAA UNIT 3
PPTX
mmmmmmm
PPTX
ETCS262A-Analysis of design Algorithm.pptx
PPTX
Dynamic programmng2
PPTX
Operation's research models
PDF
Minimization of Assignment Problems
PDF
Lexisearch Approach to Travelling Salesman Problem
PDF
[Emnlp] what is glo ve part i - towards data science
PPTX
Dynamic programming prasintation eaisy
PPTX
algorithm design.pptx
PDF
Cuckoo Search: Recent Advances and Applications
PPTX
Machine Learning basics
PPSX
Ic lecture6 architecture and algo
PDF
Top Machine Learning Algorithms Used By AI Professionals ARTiBA.pdf
PPTX
Architecture Algorithm Definition
PPTX
esign and Analysis of Algorithms Presentation.pptx
PPTX
Module 2ppt.pptx divid and conquer method
PPTX
Advanced-Algorithmic-Analysis-CIA-II presentation.pptx
Introduction to dynamic programming
Disign and Analysis for algorithm in computer science and technology
DAA UNIT 3
mmmmmmm
ETCS262A-Analysis of design Algorithm.pptx
Dynamic programmng2
Operation's research models
Minimization of Assignment Problems
Lexisearch Approach to Travelling Salesman Problem
[Emnlp] what is glo ve part i - towards data science
Dynamic programming prasintation eaisy
algorithm design.pptx
Cuckoo Search: Recent Advances and Applications
Machine Learning basics
Ic lecture6 architecture and algo
Top Machine Learning Algorithms Used By AI Professionals ARTiBA.pdf
Architecture Algorithm Definition
esign and Analysis of Algorithms Presentation.pptx
Module 2ppt.pptx divid and conquer method
Advanced-Algorithmic-Analysis-CIA-II presentation.pptx
Ad

Recently uploaded (20)

PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Lesson notes of climatology university.
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Cell Structure & Organelles in detailed.
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Institutional Correction lecture only . . .
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Complications of Minimal Access Surgery at WLH
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
A systematic review of self-coping strategies used by university students to ...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
GDM (1) (1).pptx small presentation for students
Lesson notes of climatology university.
Computing-Curriculum for Schools in Ghana
Cell Structure & Organelles in detailed.
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Institutional Correction lecture only . . .
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Anesthesia in Laparoscopic Surgery in India
Complications of Minimal Access Surgery at WLH
102 student loan defaulters named and shamed – Is someone you know on the list?
O5-L3 Freight Transport Ops (International) V1.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Final Presentation General Medicine 03-08-2024.pptx

Elements of dynamic programming

  • 1. Elements of Dynamic ProgrammingAn Introduction byTafhimUl IslamC091008CSE 4th SemesterInternational Islamic University Chittagong
  • 2. What is Dynamic ProgrammingDynamic Programming (DP) is not an algorithm. It’s a technique/approach that we use to build efficient algorithms for problems of very specific class
  • 4. What is Substructure?A substructure is a structure itself that helps a bigger structure of the same kind to exist.The substructure does not play an auxiliary roleIt is an essential part of the super structureIt is only smaller in size compared to the super structureIt has the same properties of the superstructure
  • 5. Optimal SubstructureSo optimal substructure is simply the optimal selection among all the possible substructures that can help a super structure of the same kind to existExample: To know how to multiply n matrices optimally we must multiply the last matrix with the optimal multiplication result of the n-1 other matrices. The base case for the recursion here is that the optimal parenthesization of
  • 6. Optimal SubstructureTo build a building with the best possible strength, we need to build each level as optimally as possibleTo solve a mathematical problem, we all the smaller problems inside that problem to have the correct result. Each problem might depend on the previous problem solved. So we need to take care of all the problems optimally, with correct calculations.
  • 7. Overlapping Sub-problemOverlapping sub-problem is found in those problems where bigger problems share the same smaller problems. This means, while solving larger problems through their sub-problems we find the same sub-problems in two or more different large problems. In these cases a sub-problem is usually found to be solved previously.
  • 8. Overlapping Sub-problemOverlapping sub-problems can be found in Matrix-Chain-Multiplication (MCM) problem.
  • 9. Cases where mistakes might occurUnweighted shortest path: Find a path from u to v consisting of the fewest edges. Such a path must be simple, since removing a cycle from a path pro-duces a path with fewer edges.Unweighted longest simple path: Find a simple path from u to v consisting of the most edges. We need to include the requirement of simplicity because other-wise we can traverse a cycle as many times as we like to create paths with an arbitrarily large number of edges.
  • 10. MemoizaitonThe memoization technique is the method of storing values of solutions to previously solved problems. This generally means storing the values in a data structure that helps us reach them efficiently when the same problems occur during the program’s execution. The data structure can be anything that helps us do that but generally a table is used.