The map above can also be represented as a gridlike structure (figure 6.4)
with the numbers next to each line (called weights) showing the number of
attractions on every block. The tourists must decide among the many possible
paths between the northwesternmost point (called the source vertex) and
the southeasternmost point (called the sink vertex). The weight of a path from
the source to the sink is simply the sum of weights of its edges, or the overall
number of attractions. We will refer to this kind of construct as a graph, the
intersections of streets we will call vertices, and the streets themselves will
be edges and have a weight associated with them. We assume that horizontal
edges in the graph are oriented to the east like!while vertical edges are oriented
to the south like #. A path is a continuous sequence of edges, and the
length of a path is the sum of the edge weights in the path.3 A more detailed
discussion of graphs can be found in chapter 8.