The Lattice Polynomial of a Graph