Professional Documents
Culture Documents
Dynamic Programming
Dynamic programming is a solution approach an not a technique and often uses other techniques
within its overall solution approach.
Basic Definition of
Dynamic Programming
Dynamic programming solution approach, knapsack problem, stagecoach /
Example
shortest route problem
Main principle is subdivision of a problem into smaller sub problems referred to as stages
The solution approach encompassed
Consider stages in reverse order so as to be able to observe the last decision (stage 1) in terms of
by dynamic programming is to break
all possible outcomes
down a problem into smaller sub
States are identified at each stage (different levels of resources available at that stage)
problems called stages and then
The best decision is the one that results in the greatest return
solve these stages sequentially. The
States and decisions are then related to the next stage in the solution process through a transition
outcome of a decision/solution at one
function
stage will affect the decision made at
At the last stage, all resources are considered available
the next stage in the sequence.
We select the decisions that triggered the sequence of best decisions with the highest return.
The knapsack problem is a traditional example of dynamic programming that is concerned with how
many of each of several different kinds of item to put in a knapsack in order to maximize the return
from the items.
Example
• Travelers from China who visit the United States and Optimal decision Item :
Europe on a frequent basis (such as athletes, Item Weight (lb) Profit ($)
musicians and dancers) are allowed to return with a Denim jeans = 1 🡪 $ 90
limited number of consumer items not generally Denim jeans 2 90 Radio/tape = 1 🡪 $ 150
available in China.
Tape cassettes = 0 🡪 0
• The items, which are carried in a duffel bag, cannot Radio/tape players 3 150
exceed a weight of 5 pounds.
• Once the travelers is inside the country, the items are Total profit = $ 240
Tape cassettes 1 30
sold on the black market at a highly inflated price.
Stagecoach Problem
Explanation
The stagecoach problem is a problem specially constructed1 to illustrate the features and to
introduce the terminology of dynamic programming. It concerns a mythical fortune seeker in
Missouri who decided to go west to join the gold rush in California during the mid-19th century.
The journey would require traveling by stagecoach through unsettled country where there was
serious danger of attack by marauders.
Optimal Decision
Any Question?