2.10 Bellman's principle of optimality — Practise with help
Warm-up: remember
- On the network of Section 2.9, what is the least cost from to ?
- What is the least cost from to , and along which route?
Answers and feedback
- , so .
- , along .
Practise with help
1. State Bellman's principle of optimality.
Hint
It is about parts of an optimal route.
Next step
What can you say about any section of the best route?
Full working
Any part of an optimal route is itself an optimal route between its own two endpoints.
Equivalently: if a route is optimal as a whole, then replacing any section of it with a cheaper section would produce a cheaper whole, which is impossible. So no section can be improved.
2. The optimal route from to is with cost 8. Is the part optimal between and ? Explain.
Hint
What other route is there from to ?
Next step
The only edges out of are and , and there is no route from to in this network.
Full working
Yes. The only edge from to is , so the part is trivially the optimal route between and .
Bellman's principle guarantees this in general, but here you can also check it directly because the network is small. Both agree, as they must.
3. A route from to goes with cost 12. Is the part optimal between and ? Show your working.
Hint
Compare with .
Next step
against .
Full working
No. costs , while costs . So the part is not optimal between and .
This does not contradict Bellman's principle, because the whole route is not optimal — its cost is 12, against the optimal 8. The principle only makes claims about optimal routes.
4. Explain why Bellman's principle is needed for dynamic programming to work.
Hint
What does dynamic programming reuse?
Next step
The value at a state, whichever larger problem it belongs to.
Full working
Dynamic programming solves each state once and reuses its value wherever that state appears. That is only sound if the value is the same in every context.
Bellman's principle gives exactly that: the least cost from a state to the end depends only on the state, not on how you reached it. So the value is fixed, and can be computed once.
Without the principle, the best continuation from a state might depend on the route taken to reach it, and a single number per state would not be enough — dynamic programming would be invalid.
5. A student says: "Bellman's principle means the greedy method is correct — always take the best-looking step." Explain the mistake.
Hint
The principle is about an optimal route. Does the greedy choice find one?
Next step
On the network of Section 2.9, greedy gave 10 and optimal was 8.
Full working
The principle says that in an already optimal route, every part is optimal. It does not say that choosing the cheapest step at each stage builds an optimal route.
On the network of Section 2.9, the greedy choice from is , leading to a total of 10, while the optimal total is 8. So the greedy route is not optimal, and the principle says nothing about its parts.
The difference is direction and knowledge. The principle is used backwards, when the cost of the rest of the journey is already known. Greedy decides forwards, without that knowledge.
6. On a four-stage network, the optimal route from stage 1 to stage 4 is with cost 8. A second route also costs 8. Does this break Bellman's principle?
Hint
Does the principle say the optimal route is unique?
Next step
It says parts of an optimal route are optimal — not that there is only one.
Full working
No. The principle says that every part of an optimal route is optimal between its own endpoints. It does not say there is only one optimal route.
Both routes are optimal, and both have the same cost 8. The part costs , and the part costs : both are optimal between and , because they tie. Ties are allowed.
When values tie, a dynamic programming table records the best value; there may be more than one route achieving it.
A question from Section 2.9
7. In the backward recursion, the value at each state is computed from the values of the states one stage later. Explain how this uses Bellman's principle.
Hint
The value at a state is the cost of the best continuation.
Next step
The continuation begins with one edge, then an optimal route from the next state.
Full working
The best continuation from a state starts with one edge to some state in the next stage, and then continues optimally from there. By Bellman's principle, that continuation is itself an optimal route from the next state — so its cost is exactly the value already computed for that state.
So the value at a state is
which is the recursion. Bellman's principle is what makes the "value(next state)" term the right thing to add: it is the cost of the best continuation, guaranteed.
8. A network has one stage with a single state, and the cost to the end is 0. Explain why the recursion has to start there, using Bellman's principle.
Hint
What is the optimal route from the destination to itself?
Next step
There is nothing to decide.
Full working
At the last stage the route is already finished, so the optimal route from that state to the end is the empty route, of cost 0. There is no decision and no dependence on any other state.
That is the only place where the value is known without using Bellman's principle. Every other value is computed from the values one stage later, using the principle to justify adding "the cost of the best continuation". So the recursion must start where the value is known directly — at the end — and work backwards.