I have a maze setup by rows and columns.
0 1 2 3 4 5
6 7 8 9 10 11...
Given a starting point and an ending point of say start = 0 and goal = 8
Each cell has a list of its cells that it has access to, no walls between.
I begin solving the maze by starting at start and going to its next possible cell, the lowest numbered one. So if cell 3 has access to 4 and 9, it goes to 4. I then 'mark' this cell as being visited, with a variable = 1. With this being said, if I run into a dead end, the loop terminates and the solution given is partially correct up to the dead end.
My question is how can I backtrack to the first cell that had access to others?