Show worked solution
Worked solution
Identify the stages, states and arcs of the network
Dynamic programming labels each state by the stage it belongs to; a route uses exactly one arc per stage from the source to the sink.
Give the sink its initial value
The route ends at , so from there is no further value to add.
Stage 3: optimise state
The optimal value at state combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.
Stage 3: optimise state
The optimal value at state combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.
Stage 2: optimise state
The optimal value at state combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.
Stage 2: optimise state
The optimal value at state combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.
Stage 2: optimise state
The optimal value at state combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.
Stage 1: optimise state
The optimal value at state combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.
Stage 1: optimise state
The optimal value at state combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.
Stage 1: optimise state
The optimal value at state combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.
Stage 0: optimise state
The optimal value at state combines each outgoing arc with the value already fixed at the state it leads to, and keeps the largest total.
Trace the optimal route forwards from the source
Following the optimal choice recorded at each state gives the route, whose arc values add up to the optimal total.
State Bellman's principle of optimality
Any part of an optimal route is itself optimal for the sub-problem that starts where that part begins, so each state need only be optimised once.
Record the optimal value at every state
Each label is the best value obtainable on a route from that state to the sink.
Select the route of greatest total value
This route attains the maximum total value of and no other route matches it.