Computer generation of the characteristic polynomials of chemical graphs