Metropolis minimization