TITLE: Singular homology of a graph.
QUESTION [7 upvotes]: By a graph I will understand an undirected graph without multiple edges or loops. By a morphism of graphs I will understand a map $f$ between the underlying sets of vertices, such that if $x$ and $y$ are adjacent, then $f(x)$ and $f(y)$ are either adjacent or equal.
Let $G$ be a finite graph. One can realise $G$ as a CW-complex $|G|$ and look at topological invariants, such as singular homology. But this captures only very little information about $G$, because except from $H_0(|G|)$ and $H_1(|G|)$ all homology groups are zero.
Consider the following alternative construction: Let us write $\Delta_n$ for the complete graph on $n$ vertices, and let us re-baptise this graph by the name "standard $n$-simplex". There are obvious codegeneracy and coface maps between standard simplices, so that we obtain a cosimplicial object $\Delta_\bullet$ in the category of graphs. Now, proceed as usual: Morphisms $\Delta_\bullet \to G$ form a simplicial set, applying the free group construction yields then simplicial group, and the associated chain complex is the one whose homology $H_i^{\mathrm{sing}}(G)$ I shall call "singular homology of $G$".
Obvious properties of $H_i^{\mathrm{sing}}(G)$ are: It is a finitely generated commutative group ($G$ is finite), covariantly functorial in $G$. In particular, if we work with coefficients in a field, we obtain representations of the automorphism group of $G$. The homology of the point is $\mathbb Z$ in degree $0$ and trivial in higher degrees. We can define singular cohomology accordingly, and get then a natural pairing between homology and cohomology.
The list of all natural questions one must ask after making such a definition is long, so I will not ask everything. 
(a) Is there a comparison map $H_i(|G|) \to H_i^{\mathrm{sing}}(G)$, maybe even on the level of chain complexes? Is there some more elaborate CW-complex $||G||$ one can naturally associate with $G$ such that $H_i(||G||)$ gives back singular homology of $G$? In that case, one would ask for a natural map $|G| \to ||G||$.
(b) Given a graph $G$, is there a largest integer $i$ such that $H_i^{\mathrm{sing}}(G)$ is nonzero? Assuming yes, is this integer less or equal the size of the largest complete subgraph of $G$.
(c) Is there a Künneth morphism in singular cohomology? --is there a natural ring strucure on cohomology?
(d) What is a homotopy between morphisms of graphs? Given an answer to that, do homotopically equivalent morphisms induce the same maps in homology?
(z) Can you give an example of a graph with nontrivial $H_2^{\mathrm{sing}}(G)$?

REPLY [3 votes]: In response to (d), you may find some of the papers by Anton Dochtermann interesting. In particular, the paper Hom complexes and homotopy theory in the category of graphs might contain something you are looking for. I've seen two different notions of graph morphism: one where you allow $f(x) = f(y)$ if $x$ and $y$ are adjacent as you have, and one where you don't. Not allowing equality is what Dochtermann does, but your definition can be recovered if you put a loop at each vertex, for example.
If you use this definition (so the complete graphs form a simplicial object given by the different ways of embedding), then homology is not a homotopy invariant if my old notes are correct: the line graph on 3 vertices and the line graph on 2 vertices are homotopic but $H_1$ for the first is rank 2 while for the second it is rank 1. This should probably be double-checked (sorry that I am not doing this).
Maybe I should also mention that homology defined this way has been studied in the literature. It usually goes by the name of the "clique complex".
Hope that's of some help. I wrote some notes exploring some of these ideas which you can have if you like (but looking back, it looks like I was confused and I don't remember what I was trying to do), just send me an email.