category of paths on a graph
A nice class of illustrative examples of some notions of category theoryis provided by categories
of paths on a graph.
Let be an undirected graph. Denote the set of vertices of by “”and denote the set of edges of by “”.
A path of the graph is an ordered tuplet of vertices such that, for all between and , there exists an edge connecting and . As a special case, we allow trivial paths which consistof a single vertex — soon we will see that these in fact play an importantrole as identity elements in our category.
In our category, the vertices of the graph will be the objects and themorphisms will be paths; given two of these objects and , we set to be the set of all paths such that and . Given an object , we set ,the trivial path mentioned above.
To finish specifying our category, we need to specify the composition operation.This operation will be the concatenation of paths, which is defined as follows:Given a path and a path, we set
(Remember that .) To have a bona fide category, we need tocheck that this choice satisfies the defining properties (A1 - A3 in theentry http://planetmath.org/node/965category). This is rather easily verified.
A1: Given a morphism , it can onlybelong to if and , hence unless and .
A2: Suppose that we have four objects and threemorphisms, ,, and. Then,by the definition of the operation given above,
Since these two quantities are equal, the operation is associative.
A3: It is easy enough to check that paths with a singlevertex act as identity elements:
It is also possible to consider the equivalence class of pathsmodulo retracing. To introduce this category, we first definea binary relation
on the class of paths as follows:Let and be any two paths such that the right endpoint
of is the same as the left endpoint of , i.e. and for some vertices of our graph. Let be any vertexwhich shares an edge with . Then we set .
Let be the smallest equivalence relations which contains. We will call this equivalence relation retracing.
As defined above, it may not intuitively obvious what thisequivalence amounts to. To this end, we may consider a differentdescription. Define the reversal of a path to be thepath obtained by reversing the order of the vertices traversed:
Then we may show that two paths are equivalent under retracingif they may both be obtained from a third path by insertingterms of the form . In symbols, we claim that if there exists an integer and paths such that
and
This characterization explains the choice of the term “retracing” —we do not change the equivalence class of the path if we happen towander off somewhere in the course of following the path but thenbacktrack and pick the path up again where we left off on ourdigression.
Rather than presenting a detailed formal proof, we will sketch howthe two definitions may be shown to be equivalent.