Your GAA club needs its mower for three months. When should you replace it?
Your GAA club needs its mower for three more months. Keeping it is cheap while it’s fairly new, but running costs rise as it ages. Would you replace it now, wait a month, or keep it for all three?
To price a route, add its edge weights. Here, forty plus ninety gives one hundred and thirty euro. In a directed network you must follow the arrows. Without arrows, you can use an edge either way. Dijkstra’s algorithm finds shortest routes in either kind of network when the weights are non-negative.
You start month one with a one-month-old mower. Keep it for forty euro and it starts month two aged two months. Replace it for one hundred and twenty euro and the new mower works that month, so it starts month two aged one. The month is your stage.
You start month two with a two-month-old mower and replace it straight away. The new mower does that month’s work. At the start of month three, how old is the mower you have? Pick an answer.
Each month is a stage. The number after each node letter is the mower’s starting age, in months. K means keep and R means replace. Each arrow gives the full cost for that month, with no resale payment at the finish. Which information from earlier months do you still need?
V means least remaining cost from a state; k means keeping cost. At the finish there’s nothing left to pay. Choose the cheaper final action at each age. Bellman’s principle says a cheaper continuation would improve the whole route. For each earlier decision, add its cost to its best continuation and take the smaller total.
You start month two with a two-month-old mower. Suppose keeping it this month now costs thirty euro. The replacement cost and all month-three costs stay the same. Work out the minimum total for the two months left, then pick an answer.
Back to the original costs. The first row says keep, so you reach month two aged two. That row says replace, then the month-three row for age one says keep. Those three choices give your route. The optimal policy also specifies the best choice at every other reachable state.
Start at A with zero. Repeatedly settle the smallest tentative label and test whether going through it makes a neighbour’s label smaller. D and E tie. D lowers the finish label to two hundred; E leaves it unchanged. If the edges become undirected, none of the reverse moves improves a label, so the result is unchanged.
If asked to justify your method, show why the cheapest next arrow can fail. At C, keeping costs ninety now but two hundred and ten overall. Dijkstra settles the smallest label: any route through unsettled nodes first reaches one at no lower cost, and non-negative edges can’t reduce it. On this acyclic network, Bellman works backwards.