SlideShare a Scribd company logo
1 of 17
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

Similar to Pintu ram

Limitations of linear programming
Limitations of linear programmingLimitations of linear programming
Limitations of linear programming
Tarun Gehlot
 
Dynamic programming 2
Dynamic programming 2Dynamic programming 2
Dynamic programming 2
Roy Thomas
 
Dynamic programming class 16
Dynamic programming class 16Dynamic programming class 16
Dynamic programming class 16
Kumar
 
Our presentation on algorithm design
Our presentation on algorithm designOur presentation on algorithm design
Our presentation on algorithm design
Nahid Hasan
 
Generational Layered Canvas Mechanism for Collaborative Web Applications
Generational Layered Canvas Mechanism for Collaborative Web ApplicationsGenerational Layered Canvas Mechanism for Collaborative Web Applications
Generational Layered Canvas Mechanism for Collaborative Web Applications
kata shin
 
Module 2ppt.pptx divid and conquer method
Module 2ppt.pptx divid and conquer methodModule 2ppt.pptx divid and conquer method
Module 2ppt.pptx divid and conquer method
JyoReddy9
 

Similar to Pintu ram (20)

Approximation algorithms
Approximation  algorithms Approximation  algorithms
Approximation algorithms
 
Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of Optimality
 
Limitations of linear programming
Limitations of linear programmingLimitations of linear programming
Limitations of linear programming
 
Dynamic programming 2
Dynamic programming 2Dynamic programming 2
Dynamic programming 2
 
Dynamic programming prasintation eaisy
Dynamic programming prasintation eaisyDynamic programming prasintation eaisy
Dynamic programming prasintation eaisy
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
algorithm_6dynamic_programming.pdf
algorithm_6dynamic_programming.pdfalgorithm_6dynamic_programming.pdf
algorithm_6dynamic_programming.pdf
 
Dynamic programming class 16
Dynamic programming class 16Dynamic programming class 16
Dynamic programming class 16
 
Our presentation on algorithm design
Our presentation on algorithm designOur presentation on algorithm design
Our presentation on algorithm design
 
Dynamic pgmming
Dynamic pgmmingDynamic pgmming
Dynamic pgmming
 
CH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptxCH-1.1 Introduction (1).pptx
CH-1.1 Introduction (1).pptx
 
PID_27_Stage1_Presentation.pptx
PID_27_Stage1_Presentation.pptxPID_27_Stage1_Presentation.pptx
PID_27_Stage1_Presentation.pptx
 
20090720 smith
20090720 smith20090720 smith
20090720 smith
 
Ch1
Ch1Ch1
Ch1
 
MapReduce Algorithm Design
MapReduce Algorithm DesignMapReduce Algorithm Design
MapReduce Algorithm Design
 
Convex optmization in communications
Convex optmization in communicationsConvex optmization in communications
Convex optmization in communications
 
Generational Layered Canvas Mechanism for Collaborative Web Applications
Generational Layered Canvas Mechanism for Collaborative Web ApplicationsGenerational Layered Canvas Mechanism for Collaborative Web Applications
Generational Layered Canvas Mechanism for Collaborative Web Applications
 
Module 2ppt.pptx divid and conquer method
Module 2ppt.pptx divid and conquer methodModule 2ppt.pptx divid and conquer method
Module 2ppt.pptx divid and conquer method
 
# Can we trust ai. the dilemma of model adjustment
# Can we trust ai. the dilemma of model adjustment# Can we trust ai. the dilemma of model adjustment
# Can we trust ai. the dilemma of model adjustment
 
complexity analysis.pdf
complexity analysis.pdfcomplexity analysis.pdf
complexity analysis.pdf
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

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