SlideShare a Scribd company logo
PRESENTATION Topic : “DYNAMIC PROGRAMMING”
Prepared By: Pintu Ram
Course: B.Sc.(Hons.)C.S. Sem : 2nd Roll no : 2k17/CS/72
Submitted to : Mr. Ashish Jha
College Of Vocational Studies
INDEX
WHAT IS DYNNAMIC PROGRAMMMING
WHAT IS OPTIMIZATION PROBLEM
WHAT IS OPTIMAL SOLUTION
PRICIPLE OF OPTIMALITY
DYNAMIC PROGRAMMING ALGORITHM
ADVANTAGE OF DYNAMIC PROGRAMMING
DISADVANTAGE OF DYNAMIC
PROGRAMMING
EXAMPLE OF DYNAMIC PROGRAMMING
WHAT IS DYNAMIC PROGARMMING
DEFINITION:
Dynamic Programming is a general algorithm
design technique for solving a complicated
problem defined by recurrences with overlapping
sub problems.
Invented by : “American mathematician”
“Richard Bellman”
in 1950
Dp and dcp
DP:> Dynamic Programming
DCP:> Divide and Conquer Programming
DP likes DCP.
But, Some difference
DCP :applies when sub problems does not overlap.
(repeatedly works)/(top down)
DP :applies when sub problems overlap.
(avoids repeatedly works)(bottom up)
Optimization problem
Dynamic Programming is generally applied for
solving optimization problems.
OPTIMIZATION PROBLEM:
Such problems that can have many possible
solutions and each solution has a
value and we wish to find a solution with
optimal value (minimum and maximum).
Optimal solution
It is a feasible/suitable/appropriate/right
solution which is our favorable.
Or not a solution but the best solution.
It provides the most beneficial result for the
specified objective problems.
If the objective problem is related to profit then
optimal solution has a maximum value
While if the objective problem is related to the
cost the optimal solution has a minimum value.
Principle of optimality
The Dynamic Programming works on a
principle of optimality.
“The principle of optimality states that in an
optimal sequences of decisions/choices, each
sequences must also be optimal.”
Dynamic programming algo
or dpa
Steps for designing a DPA:
♠CHRACTERIZE optimal substructure.
♠RECURSIVELY define the. optimal value
♠COMPUTE the optimal value in bottom up.
♠CONSTRUCT an optimal solution.
ADVANTAGE OF DYNAMIC PROGRAMMING
Easier to implement.
Require much less computing resources.
Much faster to executer.
Greedy algorithm is used to solve optimization
problems.
DISADVANTAGE OF DYNAMIC
PROGRAMMING
It does not always reach to the global solution.
Or,
Even the global solution is not found, most of
the times is lose, and in this case the sub
optimal solution is the best solution.
EXAMPLE OF DYNAIMC PROGRAMMING
Multi graph:
A multistage graph is a directed weighted graph
and the vertices are divided into stages such that
the edges are connecting the vertices from one
stage to next stage only. First stage and last stage
have a single vertex to represent the starting
point to sink of a graph.
Objective of problem
We have to selecting the path which
is giving us the minimum cost.
–Diagram of a multistage graph
–
1
2
1
2
1
1
1
0
9
5
4
3
8
7
6
9
6
4
2
5
68
2
7
3
21
2
7
11
11
5
4
5
3
Stage 1 Stage 2 Stage 3 Stage 4 Stage 5
4
Finding the cost of each stages and vertices are
following:
Cost (5,12)=0 | Cost (4,9)=4 | Cost (4,9)=2 | Cost
(4,11)=5
Cost (3,6)=min { cost(6,9)+cost(4,9),
cost(6,10)+cost(4,10) }
=min{ 6+4 , 5+2 }
=7
Similarly:
Cost(3,7)=5 | Cost(3,8)=7 | Cost(2,2)=7 | Cost(2,3)=9 |
Cost(2,4)=18 | Cost(2,5)=15 | Cost(1,1)=16
•Table representing minimum cast in
multistage graph
V 1 2 3 4 5 6 7 8 9 1
0
1
1
12
C 16 7 9 1
8
1
5
7 5 7 4 2 5 0
2/ 7 6 8 8 10 10 11 1 12 12 12
Formulation for finding the minimum cast in
multistage graph.
cost(i , j) = min{cost(j , l)+cost(i+1 , l)}
(j, l) € edges
l € s+1 (next stage)
stage vertex next stage
Thank you

More Related Content

PPT
Dynamic programming
PDF
TMCL Edit
PPTX
Introduction to basic programming
PPTX
Programming preparation_stepping Algorithm
PPTX
Algorithm n problem solving x
PPTX
Estimation
PPTX
Dynamic programmng2
PDF
Unit 4- Dynamic Programming.pdf
Dynamic programming
TMCL Edit
Introduction to basic programming
Programming preparation_stepping Algorithm
Algorithm n problem solving x
Estimation
Dynamic programmng2
Unit 4- Dynamic Programming.pdf

Similar to Pintu ram (20)

PPTX
Introduction to Dynamic Programming, Principle of Optimality
PPTX
Module 2ppt.pptx divid and conquer method
PDF
Unit 4 of design and analysis of algorithms
PPTX
Dynamic programming
PPTX
Introduction to dynamic programming
PPTX
Dynamic Programing.pptx good for understanding
PPTX
Algorithm Design Technique
PDF
Dynamic Programming
PPTX
Dynamic Programming: Optimizing Solutions
PPT
dynamic-programming unit 3 power point presentation
PPTX
ADA Unit 2.pptx
PPTX
Dynamic programming class 16
PPTX
Dynamic Programming - Part 1
PDF
Dynamic Programming Algorithm CSI-504.pdf
PPT
Dynamic programming 2
PPTX
Computer science in Dynamic programming .pptx
PPT
5.3 dynamic programming 03
PDF
L21_L27_Unit_5_Dynamic_Programming Computer Science
PPTX
Dynamic Programming
PPTX
AAC ch 3 Advance strategies (Dynamic Programming).pptx
Introduction to Dynamic Programming, Principle of Optimality
Module 2ppt.pptx divid and conquer method
Unit 4 of design and analysis of algorithms
Dynamic programming
Introduction to dynamic programming
Dynamic Programing.pptx good for understanding
Algorithm Design Technique
Dynamic Programming
Dynamic Programming: Optimizing Solutions
dynamic-programming unit 3 power point presentation
ADA Unit 2.pptx
Dynamic programming class 16
Dynamic Programming - Part 1
Dynamic Programming Algorithm CSI-504.pdf
Dynamic programming 2
Computer science in Dynamic programming .pptx
5.3 dynamic programming 03
L21_L27_Unit_5_Dynamic_Programming Computer Science
Dynamic Programming
AAC ch 3 Advance strategies (Dynamic Programming).pptx
Ad

Recently uploaded (20)

PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
August Patch Tuesday
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
A Presentation on Touch Screen Technology
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
A Presentation on Artificial Intelligence
PPTX
Tartificialntelligence_presentation.pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
project resource management chapter-09.pdf
PDF
Hybrid model detection and classification of lung cancer
PDF
NewMind AI Weekly Chronicles - August'25-Week II
1 - Historical Antecedents, Social Consideration.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
A comparative study of natural language inference in Swahili using monolingua...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
August Patch Tuesday
Unlocking AI with Model Context Protocol (MCP)
A comparative analysis of optical character recognition models for extracting...
Chapter 5: Probability Theory and Statistics
Univ-Connecticut-ChatGPT-Presentaion.pdf
A novel scalable deep ensemble learning framework for big data classification...
A Presentation on Touch Screen Technology
DP Operators-handbook-extract for the Mautical Institute
Heart disease approach using modified random forest and particle swarm optimi...
A Presentation on Artificial Intelligence
Tartificialntelligence_presentation.pptx
Hindi spoken digit analysis for native and non-native speakers
project resource management chapter-09.pdf
Hybrid model detection and classification of lung cancer
NewMind AI Weekly Chronicles - August'25-Week II
Ad

Pintu ram

  • 1. PRESENTATION Topic : “DYNAMIC PROGRAMMING” Prepared By: Pintu Ram Course: B.Sc.(Hons.)C.S. Sem : 2nd Roll no : 2k17/CS/72 Submitted to : Mr. Ashish Jha College Of Vocational Studies
  • 2. INDEX WHAT IS DYNNAMIC PROGRAMMMING WHAT IS OPTIMIZATION PROBLEM WHAT IS OPTIMAL SOLUTION PRICIPLE OF OPTIMALITY DYNAMIC PROGRAMMING ALGORITHM ADVANTAGE OF DYNAMIC PROGRAMMING DISADVANTAGE OF DYNAMIC PROGRAMMING EXAMPLE OF DYNAMIC PROGRAMMING
  • 3. WHAT IS DYNAMIC PROGARMMING DEFINITION: Dynamic Programming is a general algorithm design technique for solving a complicated problem defined by recurrences with overlapping sub problems. Invented by : “American mathematician” “Richard Bellman” in 1950
  • 4. Dp and dcp DP:> Dynamic Programming DCP:> Divide and Conquer Programming DP likes DCP. But, Some difference DCP :applies when sub problems does not overlap. (repeatedly works)/(top down) DP :applies when sub problems overlap. (avoids repeatedly works)(bottom up)
  • 5. Optimization problem Dynamic Programming is generally applied for solving optimization problems. OPTIMIZATION PROBLEM: Such problems that can have many possible solutions and each solution has a value and we wish to find a solution with optimal value (minimum and maximum).
  • 6. Optimal solution It is a feasible/suitable/appropriate/right solution which is our favorable. Or not a solution but the best solution. It provides the most beneficial result for the specified objective problems. If the objective problem is related to profit then optimal solution has a maximum value While if the objective problem is related to the cost the optimal solution has a minimum value.
  • 7. Principle of optimality The Dynamic Programming works on a principle of optimality. “The principle of optimality states that in an optimal sequences of decisions/choices, each sequences must also be optimal.”
  • 8. Dynamic programming algo or dpa Steps for designing a DPA: ♠CHRACTERIZE optimal substructure. ♠RECURSIVELY define the. optimal value ♠COMPUTE the optimal value in bottom up. ♠CONSTRUCT an optimal solution.
  • 9. ADVANTAGE OF DYNAMIC PROGRAMMING Easier to implement. Require much less computing resources. Much faster to executer. Greedy algorithm is used to solve optimization problems.
  • 10. DISADVANTAGE OF DYNAMIC PROGRAMMING It does not always reach to the global solution. Or, Even the global solution is not found, most of the times is lose, and in this case the sub optimal solution is the best solution.
  • 11. EXAMPLE OF DYNAIMC PROGRAMMING Multi graph: A multistage graph is a directed weighted graph and the vertices are divided into stages such that the edges are connecting the vertices from one stage to next stage only. First stage and last stage have a single vertex to represent the starting point to sink of a graph.
  • 12. Objective of problem We have to selecting the path which is giving us the minimum cost.
  • 13. –Diagram of a multistage graph – 1 2 1 2 1 1 1 0 9 5 4 3 8 7 6 9 6 4 2 5 68 2 7 3 21 2 7 11 11 5 4 5 3 Stage 1 Stage 2 Stage 3 Stage 4 Stage 5 4
  • 14. Finding the cost of each stages and vertices are following: Cost (5,12)=0 | Cost (4,9)=4 | Cost (4,9)=2 | Cost (4,11)=5 Cost (3,6)=min { cost(6,9)+cost(4,9), cost(6,10)+cost(4,10) } =min{ 6+4 , 5+2 } =7 Similarly: Cost(3,7)=5 | Cost(3,8)=7 | Cost(2,2)=7 | Cost(2,3)=9 | Cost(2,4)=18 | Cost(2,5)=15 | Cost(1,1)=16
  • 15. •Table representing minimum cast in multistage graph V 1 2 3 4 5 6 7 8 9 1 0 1 1 12 C 16 7 9 1 8 1 5 7 5 7 4 2 5 0 2/ 7 6 8 8 10 10 11 1 12 12 12
  • 16. Formulation for finding the minimum cast in multistage graph. cost(i , j) = min{cost(j , l)+cost(i+1 , l)} (j, l) € edges l € s+1 (next stage) stage vertex next stage