Why can a navigation app recommend the longer route?
The shortest route on a map can be slower than a longer one. A network can assign each road a distance or an estimated travel time, and changing what gets added changes the winning path. Even the same road layout can therefore produce different recommendations when its time estimates change.
Questions you could explore
- What would you optimize if arriving reliably mattered more than the lowest predicted time?
Start reading
- NetworkX documentationsingle_source_dijkstra
A technical reference shows how weighted routes are compared by adding edge costs. Time and distance are different possible costs in a simplified road model.
Ready to try your ideas aloud?
Your topic carries over. Record up to 2½ minutes, depending on your plan.