A robust algorithm that solves almost every maze problem