2.10 Bellman's principle of optimality — Practise
Work independently. The questions and answers are shown together at the end.
These questions want reasons, not numbers. State the principle, then say what it does and does not claim.
- State Bellman's principle of optimality in your own words.
- Explain why Bellman's principle is what makes dynamic programming valid.
- H On the staged network of Section 2.9, the optimal route from to is . Name one part of it and state why that part is optimal between its own endpoints.
- Explain how Bellman's principle relates to the greedy approach, and why the two are not the same.
- H In backward recursion, the value stored at each state is the least cost from that state to the end. Explain, using Bellman's principle, why this value does not need to record the route that achieves it.
- A student claims: "Bellman's principle says every part of any route is optimal." State what is wrong and give the correct statement.
Answers and concise solutions
1. Show the answer
1. The principle
Answer:
Bellman's principle of optimality says that any part of an optimal route is itself an optimal route between its own two endpoints. If the whole journey is the cheapest possible, then no section of it can be replaced by a cheaper section — if it could, replacing it would make the whole journey cheaper, contradicting that the whole was optimal.
2. Show the answer
2. Why it makes DP valid
Answer:
Dynamic programming works by solving small sub-problems once and building larger answers from them. That is only valid if a sub-problem's best answer is the same whichever larger problem it belongs to. Bellman's principle gives exactly that. If every part of an optimal route is itself optimal, then the best cost from a vertex to the destination is a fixed number, independent of how you arrived at that vertex. So each state can be solved once and reused, which is what the backward recursion relies on.
3. Show the answer
3. A part and why it is optimal
Answer:
Take the part , of cost . It is optimal between and : the only other route is at , which is dearer. The principle guarantees it without checking. If some route from to were cheaper than , replacing in the whole route would give a route from to cheaper than — but is optimal. So no cheaper part can exist.
4. Show the answer
4. Bellman and greedy
Answer:
Bellman's principle says something about an already optimal route: its parts are optimal too. It is a property of the best route, used to build the best route. Greedy says something different: take the cheapest choice now. That is a method, and Bellman's principle does not justify it. On the network of Section 2.9 the cheapest first edge gave a total of , while the optimal total was — so the greedy choice was part of no optimal route at all. Bellman's principle holds for optimal routes; greedy does not always find one.
5. Show the answer
5. Why the route is not stored
Answer:
Bellman's principle says the best continuation from a state depends only on the state, not on how you got there. So to compare two choices at a stage, all you need is the least cost from each resulting state to the end — a single number per state. The route itself does not have to be stored. Once the values are known, the route is recovered by starting at the first stage and, at each stage, taking the choice that achieved the stored value. Storing one number per state instead of every route is what keeps dynamic programming efficient.
6. Show the answer
6. What is wrong
Answer:
The student has dropped the word "optimal". Bellman's principle says: every part of an optimal route is itself optimal. It says nothing about a route that is not optimal. A part of a poor route is usually poor as well. The principle is used to find the optimal route, by building it from optimal parts — it is not a claim that every route is made of optimal pieces.