The Brief
A regional logistics firm runs lorries between depots and is haemorrhaging fuel money on suboptimal routes. Their dispatcher just types in the source and destination and a human picks the route by gut feel. You have been brought in to build the routing engine that will slot into their dispatch system.
Given a weighted directed graph of depots (where edge weights are journey time in minutes), implement Dijkstra's algorithm from scratch — no networkx, no scipy. Return both the shortest distance and the actual path. Then layer on a multi-stop optimiser: given a list of mandatory stops in any order, find the cheapest tour starting and ending at the depot.