What is the correct algorithm name for this “Shortest Path Maze Solver”?

What is the correct algorithm name for this Shortest Path Maze Solver?

The algorithm works by completing the maze and at each turn storing each of the turns in an array until the maze once the maze is completed you would have an array of moves [LEFT,RIGHT,LEFT,LEFT,LEFT,RIGHT] then running it again and replacing the dead ends with STRAIGHT So now the shortest path would be [LEFT, STRAIGHT, LEFT, STRAIGHT] then the robot would execute this path.

Is there a name for this algorithm?

• note: replacing a dead end with straight will work only sometimes – jsotola Apr 14 at 20:20
• Sounds a bit like en.wikipedia.org/wiki/Backtracking – FooBar Apr 16 at 7:51