We introduce a homology theory for k-graphs and explore its fundamental
properties. We establish connections with algebraic topology by showing that
the homology of a k-graph coincides with the homology of its topological
realisation as described by Kaliszewski et al. We exhibit combinatorial
versions of a number of standard topological constructions, and show that they
are compatible, from a homological point of view, with their topological
counterparts. We show how to twist the C*-algebra of a k-graph by a T-valued
2-cocycle and demonstrate that examples include all noncommutative tori. In the
appendices, we construct a cubical set \tilde{Q}(\Lambda) from a k-graph
{\Lambda} and demonstrate that the homology and topological realisation of
{\Lambda} coincide with those of \tilde{Q}(\Lambda) as defined by Grandis.Comment: 33 pages, 9 pictures and one diagram prepared in TiK