Mathematically, aA maze is mathematically a graph; the nodes are where interesting things can happen and the edges are paths between the nodes.
Something interesting means:
- A decision between edges (paths)
- A monster
- A trap
- A trick
- A treasure
- A combination of the above.
Nodes can be small or large. A 4 way intersection of 5 foot corridors is a small node, a 500 x 500 foot city square with 15 roads leading from it is a large node; they are both nodes because they are a point where the players must make a decision on where to go next.
Edges are simply a transition and can be described simply by the time it takes to move from one node to the other. Players have no choice on an edge except to go forward or back. They do not have to be boring, for example an edge can be:
- submerged in water
- hidden by secret doors
- vertical (easy to go down, hard to go up)
- only accessible to Dimension Door or Passwall etc.
Here is an example of a well known graph: