school — something like the familiar shape shown in Figure 5.1, for
example.
I’d always thought of graphs as useful for visualizing the rise and fall of
some property, like the temperature charts shown on TV weather reports or
sales figures, stuff like that, and so I was left wondering how this sort of
graph could possibly be used to represent the paths weaving around the
walls and obstacles in a game environment. If you have never studied
graph theory, then this is possibly the way you think about graphs too. I
guess it’s just the way we are conditioned. However, let me show you
something interesting. Check out Figure 5.2.
This is the same graph, but I’ve changed the axis labeling to represent the x
and y coordinates of Cartesian space, adding a few cosmetic embellish

ments so that now it represents a path meandering close to a river. In fact it
looks like something your average person on the street would refer to as a
map. Indeed, the whole image is a map, but the series of waypoints and the
footpath connecting them is represented by a very simple graph. Now I
realize a few of you will be thinking this is no big deal, but I believe that
for many this subtle shift in perspective can be a revelation. It certainly was
for me. In graph terminology, the waypoints are called nodes (or some

times vectors) and the footpaths connecting them are called edges (or
sometimes arcs).
Figure 5.3 shows some more examples of graphs. As you can see, they
can assume a wide variety of configurations.
194  Chapter 5
Graphs
Figure 5.2