TITLE: Ambiguity in the definition of graph homomorphism
QUESTION [5 upvotes]: Given graph $G$ and $H$ and a function between $f : G \rightarrow H$ between the vertex sets, we say that $f$ is a graph homomorphism iff for all vertexes $x$ and $y$ of $G$ such that $xy$ is an edge of $G$, it holds that $f(x)f(y)$ is an edge of $H$.
However, some authors define graphs as having no loops, while others allow loops. These lead to different notions of homomorphism. Is there a correct one?
In particular, disallowing loops leads to a stricter notion of homomorphism, because it means that if $f$ is a homomorphism, then for all vertexes $x$ and $y$ of $G$ such that $xy$ is an edge of $G$, it holds that $f(x) \neq f(y)$. (Because otherwise $f(x)f(y)$ would be a loop in $H$).
On the other hand, allowing loops leads to a more lenient notion of homomorphism: under this definition, a homomorphism can collapse an enormous graph $G$ to a tiny graph $H$ with only one vertex and one edge.

REPLY [2 votes]: The definition is the same in both cases: with or without loops. The question is whether you want to apply it to graphs without loops, or graphs with loops (or even to directed graphs). Technically we have a choice of categories, each with their own collections of results and theorems. You get to choose the class of "graphs" you will work with. 
The one most people meet first is graphs with no loops, and the problems that arise there can be viewed as generalizations of coloring problems.