Brownian dynamics study of the relaxation behavior of linear and ring polymers