Graph compression and the zeros of polynomials