Without thinking about it,
At a minimum level, a geographic map is a set of peaks with connected edges, peaks are the intersections and dead ends of the roads, and the edges are the roads that connect them.
Directions are just a series of links to the vertices that you need to go through to go from vertex A to vertex B.
So, to save a geographical map, you use a tree / map. To indicate directions, you use a list of links to vertices or an initial vertex and a list of edges to get to the final vertex.
By linking more information to each vertex / edge, you get everything you need to create a complete map. (IE, the weight of each edge to get the shortest path).
source share