Maze exit-path-finder algorith