  For a graph G, we construct two algebras, whose dimensions are both equal to
the number of spanning trees of G. One of these algebras is the quotient of the
polynomial ring modulo certain monomial ideal, while the other is the quotient
of the polynomial ring modulo certain powers of linear forms. We describe the
set of monomials that forms a linear basis in each of these two algebras. The
basis elements correspond to G-parking functions that naturally came up in the
abelian sandpile model. These ideals are instances of the general class of
monotone monomial ideals and their deformations. We show that the Hilbert
series of a monotone monomial ideal is always bounded by the Hilbert series of
its deformation. Then we define an even more general class of monomial ideals
associated with posets and construct free resolutions for these ideals. In some
cases these resolutions coincide with Scarf resolutions. We prove several
formulas for Hilbert series of monotone monomial ideals and investigate when
they are equal to Hilbert series of deformations. In the appendix we discuss
the sandpile model.
