The nearer gate at a GAA ground looks like a shortcut, but is it?
You're walking to pitch T at a GAA ground. From the car park, gate A is closer than gate B. But you still have to get from the gate to the pitch. Which gate gives you the shorter walk overall?
Each position is a state. Read the table in backward stage order: pitch T first, the two gates next and car park S last. The one-way edges run from the car park to the gates and from the gates to the pitch. At S, the table gives eight hundred metres via B.
Follow the route through gate A. The first leg from S to A costs two hundred metres. Then you reuse the table entry for A: seven hundred metres to the pitch. Add them to get nine hundred metres for the route via A.
Try the other gate. The first leg from S to B is five hundred metres. The table says the best remaining distance from B is three hundred metres. What's the total via B? Pick an answer.
Before you reach T, add each outgoing edge cost to the best remaining cost from its successor. Take the least total. At T, nothing remains. Bellman's principle explains the rule: if the rest of a shortest route could be shortened, replacing it would shorten the whole route.
Start with zero at T. From S, going via A costs two hundred plus seven hundred metres. Via B costs five hundred plus three hundred. The smaller total is eight hundred, so record eight hundred as the value at S and B as the minimising successor.
At state U, the route via P costs one hundred metres for the first leg and six hundred after it. Via Q costs four hundred metres and then two hundred. Pick the pair that gives the best total and the next state.
If you write only eight hundred metres at S, you've recorded how far the best route is. You still haven't said where to go. Record B beside that value. The recorded choices form your optimal policy, telling you where to go at each state before the destination.
Start at S with zero. Settle S and label A two hundred and B five hundred. Settle A and label T nine hundred. Settle B and lower T to eight hundred. Settle T last. The steps stay the same with two-way edges: before T is settled, reverse edges lead back to settled states.