Bellman–Ford

Find the cheapest trip from the start to each town, even when some roads pay you to travel. Also check for a reachable loop that pays out again each time around.

Scan all edges to improve prices. An improvement on pass V reveals a reachable negative cycle.

Time is O(VE + V). One million represents infinity on this map. An empty result reports a reachable negative cycle.