to further aide in the algorithm developmentwe place certain restrictions on movement within the maze firstwe can only move one cell at time and only to open positionsthose not blocked by wall or previously used along the current path the latter prevents us from reusing cell as part of the solution since we want to find path from the start to the exit without ever having to go in circles finallywe limit movement between opens cells to the horizontal and vertical directions--updownleftand right--as illustrated in figure up left right down figure the legal moves allowed from given cell in the maze during our search for the exitwe need to remember which cells have been visited some will be part of the final path to the exit while others will have led us to dead ends at the endwe need to know which cells form the path from the start to the exit but during the search for the exitwe also need to avoid cells that previously led to dead end to assist in remembering the cellswe can place token in each cell visited and distinguish between the two in our examplewe will use an to represent cells along the path and an to represent those that led to dead end describing the algorithm we begin at the starting position and attempt to move from cell to cell until we find the exit as we move between cellswe must consider what actions are available at each cell consider the smaller maze in figure in which the rows and columns have been numbered to aide in identifying the cells figure small maze with the rows and columns labeled for easy reference