The graph is another structure that can be used to solve the maze problem (see Project 24 in Chapter 3). Every start point, dead end, goal, and decision point can be represented by a node. The arcs between the nodes represent one possible path through the maze. A graph maze is shown in Figure.
Figure: Graph maze for project
Write a program that simulates a mouse's movement through the maze, using a graph and a depth-first traversal. When the program is complete, print the path through the maze.