  In combinatorial commutative algebra and algebraic statistics many toric
ideals are constructed from graphs. Keeping the categorical structure of graphs
in mind we give previous results a more functorial context and generalize them
by introducing the ideals of graph homomorphisms. For this new class of ideals
we investigate how the topology of the graphs influence the algebraic
properties. We describe explicit Grobner bases for several classes,
generalizing results by Hibi, Sturmfels and Sullivant. One of our main tools is
the toric fiber product, and we employ results by Engstrom, Kahle and
Sullivant. The lattice polytopes defined by our ideals include important
classes in optimization theory, as the stable set polytopes.
