  Let $p$ be an odd prime. From a simple undirected graph $G$, through the
classical procedures of Baer (Trans. Am. Math. Soc., 1938), Tutte (J. Lond.
Math. Soc., 1947) and Lov\'asz (B. Braz. Math. Soc., 1989), there is a
$p$-group $P_G$ of class $2$ and exponent $p$ that is naturally associated with
$G$. Our first result is to show that this construction of groups from graphs
respects isomorphism types. That is, given two graphs $G$ and $H$, $G$ and $H$
are isomorphic as graphs if and only if $P_G$ and $P_H$ are isomorphic as
groups. Our second contribution is a new homomorphism notion for graphs. Based
on this notion, a category of graphs can be defined, and the
Baer-Lov\'asz-Tutte construction naturally leads to a functor from this
category of graphs to the category of groups.
