A technique inspired on quantum annealing is proposed in order to obtain the classical ground state of a spin-glass by tracking the full wavefunction of a given system within the subspace of matrix product states (MPS), using the density matrix renormalization group (DMRG). The technique is exemplified within the problem of obtention of the classical ground state of an Ising spin glass on ladder geometries. Its performance is evaluated and related to the entanglement entropy.