  We define cofinite graphs and cofinite groupoids in a unified way that
extends the notion of cofinite groups introduced by Hartley. The common
underlying structure of all these objects is that they are directed graphs
endowed with a certain type of uniform structure, that we call a cofinite
uniformity. We begin by exploring the fundamental theory of cofinite directed
graphs in full generality. The general theory turns out to be almost completely
analogous to that of cofinite groups. For instance, every cofinite directed
graph has a unique completion which is a com- pact cofinite direct graph.
Moreover, compact cofinite directed graphs are precisely the profinite directed
graphs, i.e., projective limits of finite discrete topological directed graphs.
We then apply the general theory to directed graphs with additional structure
such as graphs (in the sense of Serre) and groupoids, thus leading to the
notions of cofinite graphs and cofinite groupoids. Cofinite groupoids with only
finitely many identities behave much the same as cofinite groups, which are the
same thing as cofinite groupoids with a single identity. However the situation
for cofinite groupoids with infinitely many identities is more complicated.
