Animals 4:   G r a p h s

More formally, for a graph we need a set of so-called vertices, in our case the set of all cages. Some pairs of vertices are adjacent, the others are not. Adjaceny is symmetric, meaning that if vertex x is adjacent to vertex y, then vertex y is also adjacent to vertex x. In our example, the doors between the cages are all two-way: If cage y can be directly reached from cage x, then the animal can also go back---cage x can also be directly reached from cage y.

If two vertices are adjacent, then we call the pair an edge of the graph.

On the left, the cage graph of the animal puzzle is shown. Note that such a graph remains constant throughout the whole game. It doesn't show the present placement of the animals, what we later call states. It also doesn't reveal where the animals belong. This information would be just another state, the target state.


Erich Prisner 2002-2013