LOGIC & PUZZLES / ROUTES

Why the shortest route
is not always obvious.

A short line on a map may not be the cheapest, quickest, safest, or most accessible way to travel.

First define what “best” is measuring.

A shortest-path problem represents locations as graph vertices and connections as edges. Each edge may have a weight describing distance, travel time, cost, energy, or another quantity that can be added along a route. The shortest path minimizes the total weight; it does not necessarily use the fewest streets or have the fewest turns. On a simple graph with equal-weight edges, breadth-first search finds a path with the fewest edges. If edge weights differ but remain nonnegative, Dijkstra's algorithm can find a minimum-total-weight path by repeatedly expanding the lowest-cost known frontier. Negative edge weights require different methods and careful checks because an apparently attractive cycle may reduce the total indefinitely. Real route planning also has constraints that a basic algorithm may not represent: one-way restrictions, stairs, mobility access, opening hours, weather, roadworks, transfer penalties, fare zones, and changing traffic. A mathematical optimum under an incomplete model can be practically wrong. Even the way a map draws a route can distort straight-line distance because Earth is curved and projections distort shape. Clarify whether the objective is walking distance, expected time, fixed fare, or a combination; if two objectives conflict, a user may need to choose a trade-off rather than accept a single answer. A weighted sum can combine measures, but its scale and preference weights should be stated. Algorithms usually return one optimal route even if several have the same cost. Storing predecessor links allows the full route to be reconstructed after computing distances. For small examples, examine each route by hand and verify that the edge costs add to the reported total. For larger graphs, test disconnected destinations, equal-cost alternatives, and zero-weight edges. If a real map service provides a route, verify accessibility, local restrictions, current closures, and the path itself before setting out. A displayed route is not a guarantee of safety, legal access, or a live observation. The educational problem is to make the graph and cost function explicit. Once the model is accurate enough for its purpose, the algorithm gives a reproducible answer; the human still decides whether that answer is actually the best route for this journey.

Compare distance with the number of turns.

Draw five places connected by roads with different distances. Add a second annotation for steepness or accessible surfaces, without combining them yet. Find the path minimizing total distance, then find the path with the fewest connections, and explain why the answers differ.

← RecursionAll puzzle guidesChecksums and data errors →