In this paper we present a dynamical Monte Carlo algorithm which is applicable to systems satisfying a clustering condition: during the dynamical evolution the system is mostly trapped in deep local minima (as happens in glasses, pinning problems etc.). We compare the algorithm to the usual Monte Carlo algorithm, using as an example the Bernasconi model. In this model, a straightforward implementation of the algorithm gives an improvement of several orders of magnitude in computational speed with respect to a recent, already very efficient, implementation of the algorithm of Bortz, Kalos and Lebowitz.