SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Dynamic Programming

   Operations Research
Dynamic programming
• Series of inter-related decisions
• How to find the combination of most optimal
  decisions over time?
• Production Scheduling, Inventory Control,
  Warehousing, given changes in demand –
  How much to produce, store and sell over a
  period of time


                                                2
Sometimes its easier to work
        backwards from the end!
• You are going for an arranged marriage and
  you have 10 proposals, whom you will meet
  one after the other.
• Once you have rejected a proposal, you
  cannot get the same girl again!
• The current profile may be best or they may
  be better profiles yet to come . . .
• How to decide?
A problem along similar lines
•   Lets say you have 10 tries to receive a random amount between 0 and 100. At
    each try, you can either accept what you get and quit, or pass to next try.
•   At each try, when would you accept or reject the value that comes up?
•   Working backwards,
     – On the last attempt (assuming you passed 9 times), you will have to take whatever value
       comes – expected value = 50.
     – On the second last attempt, you can either accept whatever comes or pass to last attempt
       where you expect to get 50. So, in second last attempt, if you get more than 50 you should
       accept, else pass.
     – On the third last attempt, you can either accept or move to second last attempt, where you
       expect to get 75 or again pass to last attempt where you expect to get 50. On an average you
       would expect to get 62.5 over the last two attempts. Therefore, if you get more than 62.5 in
       third last attempt, you should accept, else pass.
     – On the 4th last attempt, you can either accept or move to 3rd last attempt where you expect to
       get 87.5 or pass to 2nd last attempt where you expect to get 75 or pass to last attempt where
       you expect to get 50. On an average you would expect to get 708 over last 3 attempts.
       Therefore, if you get more than 708 in 4th last attempt, you should accept, else pass.
     – And so on . . .
Finding Shortest Path




Stage 1   Stage 2   Stage 3   Stage 4   Stage 5
Working Backwards
Stage 3   H         I     SP        Go to
E         1+3       4+4   4         H
F         6+3       3+4   7         I
G         3+3       3+4   6         H


                Stage     E     F       G       SP       Go to
                4
                B         7+4   4+7     6+6     11       E or F
                C         3+4   2+7     4+6     7        E
                D         4+4   1+7     5+6     8        E or F



                                Stage       B        C       D     SP   Go to
                                5
                                A           2+11 4+7         2+8   10   D
ADEHJ =2+4+1+3=10
ADFIJ = 2+1+3+4=10
Bellman’s Principle of Optimality
• “An optimal policy has the property that
  whatever the initial state and initial decision
  are, the remaining decisions must constitute
  an optimal policy with regard to the state
  resulting from the first decision.”

Weitere ähnliche Inhalte

Was ist angesagt?

Daa:Dynamic Programing
Daa:Dynamic ProgramingDaa:Dynamic Programing
Daa:Dynamic Programing
rupali_2bonde
 
Travelling salesman dynamic programming
Travelling salesman dynamic programmingTravelling salesman dynamic programming
Travelling salesman dynamic programming
maharajdey
 

Was ist angesagt? (20)

Principle source of optimazation
Principle source of optimazationPrinciple source of optimazation
Principle source of optimazation
 
sum of subset problem using Backtracking
sum of subset problem using Backtrackingsum of subset problem using Backtracking
sum of subset problem using Backtracking
 
Daa:Dynamic Programing
Daa:Dynamic ProgramingDaa:Dynamic Programing
Daa:Dynamic Programing
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
Vam
VamVam
Vam
 
Heuristc Search Techniques
Heuristc Search TechniquesHeuristc Search Techniques
Heuristc Search Techniques
 
Unit 7 dynamic programming
Unit 7   dynamic programmingUnit 7   dynamic programming
Unit 7 dynamic programming
 
Queuing theory
Queuing theoryQueuing theory
Queuing theory
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithm
 
Job sequencing with deadline
Job sequencing with deadlineJob sequencing with deadline
Job sequencing with deadline
 
Midsquare method- simulation system
Midsquare method- simulation systemMidsquare method- simulation system
Midsquare method- simulation system
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity ppt
 
Depth Buffer Method
Depth Buffer MethodDepth Buffer Method
Depth Buffer Method
 
Solving Degenaracy in Transportation Problem
Solving Degenaracy in Transportation ProblemSolving Degenaracy in Transportation Problem
Solving Degenaracy in Transportation Problem
 
Lecture28 tsp
Lecture28 tspLecture28 tsp
Lecture28 tsp
 
backtracking algorithms of ada
backtracking algorithms of adabacktracking algorithms of ada
backtracking algorithms of ada
 
Travelling salesman dynamic programming
Travelling salesman dynamic programmingTravelling salesman dynamic programming
Travelling salesman dynamic programming
 
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionDistributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock Detection
 
Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 

Andere mochten auch

Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
paramalways
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programming
Oye Tu
 

Andere mochten auch (20)

Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Dynamic pgmming
Dynamic pgmmingDynamic pgmming
Dynamic pgmming
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programming
 
Elements of dynamic programming
Elements of dynamic programmingElements of dynamic programming
Elements of dynamic programming
 
Knapsack Problem
Knapsack ProblemKnapsack Problem
Knapsack Problem
 
Dynamic programming - fundamentals review
Dynamic programming - fundamentals reviewDynamic programming - fundamentals review
Dynamic programming - fundamentals review
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
5.3 dynamic programming
5.3 dynamic programming5.3 dynamic programming
5.3 dynamic programming
 
Optimum polygon triangulation
Optimum polygon triangulationOptimum polygon triangulation
Optimum polygon triangulation
 
Lesson 19: Maximum and Minimum Values
Lesson 19: Maximum and Minimum ValuesLesson 19: Maximum and Minimum Values
Lesson 19: Maximum and Minimum Values
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
 
Queuing problems
Queuing problemsQueuing problems
Queuing problems
 
Maximums and minimum
Maximums and minimum Maximums and minimum
Maximums and minimum
 
Kmp
KmpKmp
Kmp
 
15 puzzle problem game on android
15 puzzle problem game on android15 puzzle problem game on android
15 puzzle problem game on android
 
Master method
Master method Master method
Master method
 
String Matching Finite Automata & KMP Algorithm.
String Matching Finite Automata & KMP Algorithm.String Matching Finite Automata & KMP Algorithm.
String Matching Finite Automata & KMP Algorithm.
 

Mehr von Nilam Kabra

Layout Case Study
Layout Case StudyLayout Case Study
Layout Case Study
Nilam Kabra
 
Facility & Layout Design Case Study
Facility & Layout Design Case StudyFacility & Layout Design Case Study
Facility & Layout Design Case Study
Nilam Kabra
 
Capacity & Inventory Management
Capacity & Inventory ManagementCapacity & Inventory Management
Capacity & Inventory Management
Nilam Kabra
 
Organizational Behavior Chapter 9
Organizational Behavior Chapter 9Organizational Behavior Chapter 9
Organizational Behavior Chapter 9
Nilam Kabra
 
Organizational Behavior Chapter 8
Organizational Behavior Chapter 8Organizational Behavior Chapter 8
Organizational Behavior Chapter 8
Nilam Kabra
 
Organizational Behavior Chapter 7
Organizational Behavior Chapter 7Organizational Behavior Chapter 7
Organizational Behavior Chapter 7
Nilam Kabra
 
Organizational Behavior Chapter 5
Organizational Behavior Chapter 5Organizational Behavior Chapter 5
Organizational Behavior Chapter 5
Nilam Kabra
 
Organizational Behavior Chapter 4
Organizational Behavior Chapter 4Organizational Behavior Chapter 4
Organizational Behavior Chapter 4
Nilam Kabra
 
Organizational Behavior Chapter 3
Organizational Behavior Chapter 3Organizational Behavior Chapter 3
Organizational Behavior Chapter 3
Nilam Kabra
 
Organizational Behavior Chapter 2
Organizational Behavior Chapter 2Organizational Behavior Chapter 2
Organizational Behavior Chapter 2
Nilam Kabra
 
Organizational Behavior Chapter 1
Organizational Behavior Chapter 1Organizational Behavior Chapter 1
Organizational Behavior Chapter 1
Nilam Kabra
 
Transportation Assignment
Transportation AssignmentTransportation Assignment
Transportation Assignment
Nilam Kabra
 
Replacement Theory
Replacement TheoryReplacement Theory
Replacement Theory
Nilam Kabra
 
Relationship Marketing
Relationship MarketingRelationship Marketing
Relationship Marketing
Nilam Kabra
 
Human Resource Management
Human Resource ManagementHuman Resource Management
Human Resource Management
Nilam Kabra
 

Mehr von Nilam Kabra (19)

The EOQ Formula
The EOQ FormulaThe EOQ Formula
The EOQ Formula
 
Layout Case Study
Layout Case StudyLayout Case Study
Layout Case Study
 
Facility & Layout Design Case Study
Facility & Layout Design Case StudyFacility & Layout Design Case Study
Facility & Layout Design Case Study
 
Equations
EquationsEquations
Equations
 
EOQ Ken Homa
EOQ   Ken HomaEOQ   Ken Homa
EOQ Ken Homa
 
Capacity & Inventory Management
Capacity & Inventory ManagementCapacity & Inventory Management
Capacity & Inventory Management
 
Organizational Behavior Chapter 9
Organizational Behavior Chapter 9Organizational Behavior Chapter 9
Organizational Behavior Chapter 9
 
Organizational Behavior Chapter 8
Organizational Behavior Chapter 8Organizational Behavior Chapter 8
Organizational Behavior Chapter 8
 
Organizational Behavior Chapter 7
Organizational Behavior Chapter 7Organizational Behavior Chapter 7
Organizational Behavior Chapter 7
 
Organizational Behavior Chapter 5
Organizational Behavior Chapter 5Organizational Behavior Chapter 5
Organizational Behavior Chapter 5
 
Organizational Behavior Chapter 4
Organizational Behavior Chapter 4Organizational Behavior Chapter 4
Organizational Behavior Chapter 4
 
Organizational Behavior Chapter 3
Organizational Behavior Chapter 3Organizational Behavior Chapter 3
Organizational Behavior Chapter 3
 
Organizational Behavior Chapter 2
Organizational Behavior Chapter 2Organizational Behavior Chapter 2
Organizational Behavior Chapter 2
 
Organizational Behavior Chapter 1
Organizational Behavior Chapter 1Organizational Behavior Chapter 1
Organizational Behavior Chapter 1
 
Transportation Assignment
Transportation AssignmentTransportation Assignment
Transportation Assignment
 
Replacement Theory
Replacement TheoryReplacement Theory
Replacement Theory
 
Queuing Theory
Queuing TheoryQueuing Theory
Queuing Theory
 
Relationship Marketing
Relationship MarketingRelationship Marketing
Relationship Marketing
 
Human Resource Management
Human Resource ManagementHuman Resource Management
Human Resource Management
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Krashi Coaching
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Kürzlich hochgeladen (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

Dynamic Programming

  • 1. Dynamic Programming Operations Research
  • 2. Dynamic programming • Series of inter-related decisions • How to find the combination of most optimal decisions over time? • Production Scheduling, Inventory Control, Warehousing, given changes in demand – How much to produce, store and sell over a period of time 2
  • 3. Sometimes its easier to work backwards from the end! • You are going for an arranged marriage and you have 10 proposals, whom you will meet one after the other. • Once you have rejected a proposal, you cannot get the same girl again! • The current profile may be best or they may be better profiles yet to come . . . • How to decide?
  • 4. A problem along similar lines • Lets say you have 10 tries to receive a random amount between 0 and 100. At each try, you can either accept what you get and quit, or pass to next try. • At each try, when would you accept or reject the value that comes up? • Working backwards, – On the last attempt (assuming you passed 9 times), you will have to take whatever value comes – expected value = 50. – On the second last attempt, you can either accept whatever comes or pass to last attempt where you expect to get 50. So, in second last attempt, if you get more than 50 you should accept, else pass. – On the third last attempt, you can either accept or move to second last attempt, where you expect to get 75 or again pass to last attempt where you expect to get 50. On an average you would expect to get 62.5 over the last two attempts. Therefore, if you get more than 62.5 in third last attempt, you should accept, else pass. – On the 4th last attempt, you can either accept or move to 3rd last attempt where you expect to get 87.5 or pass to 2nd last attempt where you expect to get 75 or pass to last attempt where you expect to get 50. On an average you would expect to get 708 over last 3 attempts. Therefore, if you get more than 708 in 4th last attempt, you should accept, else pass. – And so on . . .
  • 5. Finding Shortest Path Stage 1 Stage 2 Stage 3 Stage 4 Stage 5
  • 7. Stage 3 H I SP Go to E 1+3 4+4 4 H F 6+3 3+4 7 I G 3+3 3+4 6 H Stage E F G SP Go to 4 B 7+4 4+7 6+6 11 E or F C 3+4 2+7 4+6 7 E D 4+4 1+7 5+6 8 E or F Stage B C D SP Go to 5 A 2+11 4+7 2+8 10 D ADEHJ =2+4+1+3=10 ADFIJ = 2+1+3+4=10
  • 8. Bellman’s Principle of Optimality • “An optimal policy has the property that whatever the initial state and initial decision are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decision.”