The Complexity and Difficulty of a Maze
Year: 2001 Authors: Michael Scott McClendon
Core claim
Maze complexity and difficulty can be measured mathematically from hallway geometry and combined into overall maze measures.
Topics
maze theory, complexity measure, difficulty measure, continuum theory, graph models
Domains
topology, continuum theory, graph theory, metric/measure formulation, visual puzzle design, maze design, visualization
Methods
graph mapping, arclength parameterization, direction-change measure, log product formula
Media
maze diagrams, figures, hallways, graphs
Paper text
The text below is the locally extracted OCR/Markdown version of the paper. Raw PDF files remain local and are not published here.
BRIDGES Mathematical Connections in Art, Music, and Science
The Complexity and Difficulty of a Maze
Michael Scott McClendon University of Central Oklahoma Department of Mathematics and Statistics 100 North University Drive Edmond, Oklahoma 73034-5209, U.S.A. Email: mmcclendon@ucok.edu
Abstract
Some mazes are more difficult to solve than other mazes. For this reason, we develop a method by which the difficulty of a maze can be quantified. In the process we determine a way in which the complexity of the hallways in a maze, which is the degree to which a maze has short and quick twists and turns, can also be measured. We use the various complexity measures of the hallways in a maze in order to calculate the overall complexity and difficulty of the maze. We provide several examples in order to help establish some validity of the formulas developed in this paper. As the main tool used in developing our methods is continuum theory, we will use appropriate definitions throughout this paper.
1. Introduction
a.
b.
c.
Figure 1: Three mazes of varying difficulty.
Consider the mazes in figure 1. Of these three mazes, which one is the more challenging? If we can order these mazes according to this criterion, then the possibility of such an ordering of all mazes seems plausible. Given two mazes, we say the more “challenging” of the two has a higher measure of difficulty. In this paper we will develop a method by which the difficulty of a maze can be measured, and then
Michael Scott McClendon
provide some interesting examples. For this paper we will assume that all mazes can be embedded in the plane.
2. The Graph of a Maze
A graph is a continuum that can be written as the union of finitely many arcs any two of which are either disjoint or intersect only in one or both of their endpoints [2]. Let be a maze. We want to define a function that maps the maze onto a graph. Every hallway of the maze has two walls with a pathway between them. Let be any point on one wall of a hallway and let be the point on the other wall nearest to . The line segment connecting and is called a pathway perpendicular of the maze. A graph of a maze is any graph that lies in the interior of the maze that satisfies the following:
- The graph intersects each pathway perpendicular of the maze in the middle half of the pathway perpendicular.
- No pathway perpendicular of the maze intersects the graph in more than one point.
Note that more than one graph can be derived from any given maze. Unless otherwise specified, we will refer to a graph of a maze simply as a maze. For example, we derive in figure 2 the graph of the maze from figure 1b.
Figure 2: Constructing the graph of a maze.
We will also assume that every maze contains two points, called the gates, which are distinguished from all other points in the graph. Let and be the gates of a maze . Though it may not be necessary, it is customary to consider and as an ordered pair . In this case we call the gate the entrance or the start of and we call the gate the exit or the finish of .
We denote the order of a point in a maze by . If is a point in a maze such that then is called a dead-end of . Now consider the subset of defined by . The components of are called hallways. Every point in is called an intersection. We say two hallways and are adjacent if and only if there is a point such that is a connected set. If and are intersections or dead-ends such that is a connected set then we call and the endpoints of . In this case, the set is called a
The Complexity and Difficulty of a Maze 215
closed hallway, and is denoted . A sequence of closed hallways is called a trail if and only if is adjacent to whenever . A loop is defined to be any trail that satisfies either of the following two conditions:
- The trail consists of one hallway and the two endpoints of the hallway are the same point.
- The trail consists of more than one hallway and each endpoint of each hallway in the trail is also an endpoint of exactly one other hallway in the trail.
We will assume throughout the rest of this paper that no maze contains a loop.
A simple trail is a trail in which no hallway is repeated. A reduced trail is a simple trail in which no intersection is repeated. Since we are not allowing mazes to have loops, then a trail is simple if and only if it is reduced (try proving this). A solution of a maze is any reduced trail whose endpoints are the gates of the maze. A maze is said to be well-constructed if it has exactly one solution. Again, since we are not allowing loops, then throughout the rest of this paper all mazes will be well-constructed. Note that solving a maze requires selecting the correct direction to travel at each intersection. However, if a maze has no loops, as the mazes that we are considering, then taking the “immediate left” direction at each intersection and reversing direction at each dead-end will always provide a trail (not necessarily a simple trail) from the start to the finish. Clearly, this trail will contain the solution of the maze.
Let be a maze and suppose that the trail is the solution of the maze. Let be the set of intersections located on . Then any component of is called a branch of the maze. Each branch in is connected to by a point in .
3. The Complexity Measure of a Hallway
a.
b.
c.
Figure 3: Three hallways of varying complexity.
Consider the three hallways in figure 3. As it is possible to order these hallways by how “complicated” or “confusing” each of these hallways are we want to develop a method by which we could order all hallways accordingly. Given two mazes, we say the more “complicated” of the two has a higher measure of complexity. It appears that the more quickly a hallway alters its direction the higher the measure of its complexity, or the more complex the hallway becomes. Therefore, the measure of the complexity of a hallway will depend on the magnitude of its direction changes and on how “quickly” it changes direction.
Michael Scott McClendon
Let be a hallway with endpoints and . Since is connected and every point in is of order 2 then is homeomorphic to an arc. So let have arclength and let be a continuous function from the unit interval onto such that , and such that is the point on where the arclength of the subarc of with endpoints and has length . Note that on [0,1]. Now, the derivative evaluated at is the velocity vector of at . If we view the hallway as the path of a particle moving from to , then the velocity vector at points in the direction that the particle is moving at time . For all define to equal the one-sided derivative of from the right of and to equal the one-sided derivative of from the left of . For all values of for which it exists, define .
Figure 4: A hallway and various direction vectors
We will construct a subset of points belonging to . If it exists, let be the smallest value of such that the direction of differs from the direction of by at least . Let . We call the direction of the previous direction relative to . Define to be equal to the absolute value of the difference in the radian measures between the directions of and . That is, . If \beta(w_{1}) < \frac{\pi}{4} , then we say that the current direction at is the direction of . Otherwise, we say that the current direction at is the direction of . If it exists, let be the smallest value of such that the direction of differs from the current direction at by at least . Let . We call the current direction at the previous direction relative to . Define to be equal to the absolute value of the difference in the radian measures between the directions of and . If \beta(w_{2}) < \frac{\pi}{4} , then we say that the current direction at is the direction of . Otherwise, we say that the current direction at is the direction of . Inductively, once have been selected, let be the point on between and where is the smallest value in such that the direction of differs from the current direction at by at least .
Define to be equal to the absolute value of the difference in the radian measures between the directions of and . That is, . Roughly, is a function that measures the overall change in direction of as crosses each point in
The Complexity and Difficulty of a Maze 217
. Denote the arc length of between and in by . We denote the arc length of by .
Suppose is a hallway and that . The more extreme each turn is at each point , the more complex is. That is, the larger the value of each , the more complex is. Therefore, the complexity of increases as each value of increases. Also, the shorter each subset of is between points in , the more complex is. That is, the smaller the value of each , the more complex is. Therefore, the complexity of increases as each value of increases. What makes a hallway most complex is when both and are simultaneously large. Finally, the longer the entire hallway, the more complex it is, so that the complexity of increases as increases. For these reasons, we define the complexity of from endpoint to endpoint by
We divide by to simplify the value. Also note that since the units of distance appear in both the numerator and the denominator, then is independent of the unit measurement of length. The hallways in figures 3a, 3b and 3c have complexities of 0, 138 and 2432, respectively.
4. The Complexity and Difficulty Measures of a Maze
Let be a maze. Let be the solution of the maze and suppose is the set of all hallways in some branch of . We define the complexity of by
where is the complexity of from to where lies between and .
Suppose is the set of branches in a maze with solution . We define the complexity of by
where is the complexity of from start to finish and is the complexity of branch . The mazes in figures 1a, 1b and 1c have complexities of 3.3, 3.1 and 3.4, respectively.
Note that the complexity measure of a maze is an intrinsic measure. That is, in order to calculate , we need to know the solution so that we can calculate the value of . It is possible to approximate very well by an extrinsic form of (3) that does not require knowing . Suppose that is the set of all hallways in a maze . Then
where is the complexity of from one endpoint to the other endpoint.
Let the maze have a solution . If has a small complexity, but also has many branches of large complexity, then would be large, but the maze would be easy to solve. If instead of adding the
218 Michael Scott McClendon
terms in (3) above, we were to multiply them, then we would arrive at a measure that seems to better describe the difficulty of a maze than the complexity measure. We add 1 to the complexity measure of each branch so that a single branch of some complexity less than one will not lower the overall complexity of a maze. That is, we define the difficulty measure of by
The mazes in figures 1a, 1b and 1c have difficulty measures of 3.3, 12.5 and 14.7, respectively.
Note that we have defined the complexity and the difficulty of a maze while using the term “maze” to actually mean “graph of a maze”. Recall that an actual maze can be associated with more than one graph. Given an actual maze , suppose that is the collection of all graphs that can be associated with . Then we define and to equal the infimum of and the infimum of , respectively, as varies over every graph in . That is, and . Thus, we may not be able to practically calculate the complexity and difficulty of a maze, but we can calculate a reasonable upper bound for these measures.
Suppose that the points in are selected so that the current direction at each differs from the previous direction relative to by say instead of . It is an open question of determining precisely how the complexity measure of a maze will be altered. Another open problem would be to determine whether it is possible to construct a maze-generation algorithm that, given values and , yields a maze with complexity and difficulty . It is further unknown whether there is a maze that can be drawn in a finite space that has an infinite measure of complexity or an infinite measure of difficulty. Finally, for a maze , note that is an intrinsic measure, as is . We are unsure if there is any way to approximate extrinsically, as we can .
Now we will provide some examples of mazes along with upper bounds of their associated measures of complexity and measures of difficulty. It should be evident that these measures do a pretty good job of identifying the complexity of a maze as well as predicting the difficulty of the maze. It should also be fun testing the validity of the measure of difficulty as defined in this paper.
References
[1] J. Munkres, Topology, A First Course, Prentice Hall, New Jersey, 1975. [2] S. Nadler, Continuum Theory, An Introduction, Marcel Dekker, New York, 1992. [3] P. Anthony, “The Topology of Roman Mosaic Mazes”, in The Visual Mind: Art and Mathematics, edited by M. Emmer, MIT Press, 1994, pp. 65–73.
The Complexity and Difficulty of a Maze 219
Michael Scott McClendon
complexity 4.8 difficulty 69.2
The Complexity and Difficulty of a Maze 221
complexity 4.9 difficulty 92.7
222 Michael Scott McClendon
complexity 5.9 difficulty 131.6
Try to go from one of the tiger’s eyes to the other eye.