Search fora minimal path in the maze. Model.