How does Labyrinth represent the maze as a graph?
Note that you do not need to know how Labyrinth represents a maze as a graph in order to do the project. However, if you are curious, read on. Labyrinth designs a maze on a NN grid, an NN 2-d array. Each cell of the 2-d array is considered as a small room with up to four walls: north, east, south, and west. Initially, each cell has all four walls, and is not connected to any neighbouring cell. Actually for convenience, Labyrinth uses internally an (N+2)(N+2) 2-d array. This was to make checking boundary conditions less painful during programming. The outermost cells are not part of the maze, except for two of them: Labyrinth chooses one randomly in row zero between columns 1 and N to be the maze’s entrance; and one in row N+1 to be the maze’s exit. The following is a 55 grid that Labyrinth would use to make a 33 maze. It labels each cell by an Integer for convenience.