TITLE: How to create mazes on the hyperbolic plane?
QUESTION [27 upvotes]: I'm interested in building maze-like structures on the [5, 4] tiling of the hyperbolic plane, where by maze-like I mean something akin to a spanning tree of the underlying lattice: a subgraph of the lattice that's still connected (every cell can reach every other cell) but with a sort of 'distance multiplier' effect where from any given cell in the lattice, there are likely to be cells that are nearby in the original tiling with a long 'shortest path' through the subgraph to reach that point.  (This is an admittedly imprecise notion, but I doubt there are explicit results on this sort of thing anyway).  I could use any of the standard maze-generation algorithms, but they involve a 'prepass' that holds the entire lattice graph in memory and so aren't really practical for infinite (or functionally infinite) lattices; I'm looking for something that can generate walls (or equivalently, cut edges from the underlying graph) in a 'local' fashion without needing to look explicitly at the global structure.
If I were on the plane, then there are relatively straightforward ways of doing this: for instance, for each cell, place a wall randomly on either that cell's south or east edge.  With probability 1 this will create a spanning tree of the plane - it's not a 'random' spanning tree (in particular, of course, it's impossible for any cell to have both its south and east sides 'walled', which I imagine happens with probability 0 for a random spanning tree of the plane) but it's a tree, even so.  For instance, here are two $5\times 5$ grids of cells with their east or south sides randomly walled:
 
Similarly, if the generation process uses a 3-sided coin with equal probabilities of drawing a south wall, east wall or no wall, then the resulting grids aren't spanning trees (there can exist multiple disjoint paths between nodes), but they still clearly have the sort of distance multiplication I'm looking for:
 
Unfortunately, these techniques don't work as well for the hyperbolic grid I'm interested in; getting a canonical notion of outward edges is a bit more challenging, and the 'maziness' of the result is much harder to control.  Does anyone know of a scheme similar to the coin-flipping techniques with only local information generated/used that can be applied to arbitrary regular tilings?

REPLY [4 votes]: Mazes can be created in the hyperbolic plane very easily: you only need to ensure that the starting and goal points are both reachable from infinite regions, and connect the cells randomly with high enough probability, and it is guaranteed that the maze is solvable. I am not sure whether this is exactly what Steven Stadnicki wants, but it does generate interesting mazes. I am using this in HyperRogue -- the idea is the easiest to explain with the Princess Quest maze.

This is the periodic pattern used, consisting of heptagonal rooms (which have seven gates) and infinite tree-like corridors. Gates are randomly opened or closed; if they are closed, they can be opened by stepping on nearby green plates (which may not exist, or may exist on the other side). You typically start 100 steps away in the 12 o'clock direction, and your goal is to free the Princess by stepping on the green plate (at 7 o'clock on the picture).
It is guaranteed that it is possible to free the Princess:

the opening plate always appears in a corridor, so its connected component is infinite (and similarly for the starting point),
if you consider the obstacle (i.e., the Princess's prison and all the other heptagonal rooms which you have to circumvent while trying to reach her), it has a tree structure: to circumvent the given heptagonal room $H$, you may need to also circumvent each of the 6 heptagonal rooms adjacent to $H$ (6 because we are not including the parent). The probability that a given room has child rooms depends on the probabilities of open/closed gates and opening plates occuring. This probability is high enough to make the maze interesting, but low enough to ensure that the obtained branching process generates a finite tree with probability 1. (Hyperbolic geometry is important in this argument -- otherwise there would be cycles in the obstacle graph; well, I guess it could be adjusted to Euclidean geometry, but the situation is much more complicated, and the generated mazes are less interesting IMO.)


This is the Yendor Quest in Hell: you have to reach a cell 100 steps away, to find the key to unlock the purple Orb of Yendor. This construction of obstacles is very simple (just pick some tiles randomly as the centers of "big stars", and all the tiles adjacent to them are impassable), but a similar reasoning guarantees that it generates a solvable maze. (HyperRogue does not guarantee that the starting/key regions are infinite, because it is extremely unlikely anyway that they are finite, but it would be easy to guarantee this.)