lesson

Updated 6 days ago
Every time you type a destination into a map app, it searches through millions of streets and hands you the fastest route in less than a second.
To explain any real-world computing system, we break it into four clear stages: inputs, data models, processing steps, and outputs.
๐Interactive diagram
How does a computer even store an entire city's worth of winding roads and stoplights?
Modeling the Real World
Computers cannot see pavement, so they turn the city into a graph โ a network of points connected by lines.
Each street intersection is a node (a specific location point), and each street connecting them is an edge with a travel time cost.
๐Interactive diagram
Once the map is stored as nodes and travel times, how does the app find the quickest path?
The Step-by-Step Process
The computer uses an algorithm, which is a fixed sequence of rules to solve a problem step by step.
In 1956, computer scientist Edsger Dijkstra designed a famous method: start at the origin, check all neighboring intersections, and always expand outward from the intersection with the lowest total travel time.
๐Interactive diagram