Homology of certain algebras defined by graphs