There are a number of ways to solve a simple maze like the one above, by following a wall, for instance, or counting turns. But these don’t always work in high-dimensional mazes, and some require a compass or other orienteering knowledge. Suppose you find yourself in the nine-dimensional Arcturan Insanity Labyrinth, haunted by the six-souled Fury Demon of Ragnab Zeta? What then?
Your best hope is Tremaux’s algorithm, which works in all mazes with well-defined passages. Draw a line on the floor. When you reach a junction, turn around if you’ve been there before; otherwise pick any direction. If you revisit a passage that’s already marked, draw a second line (you’ll never need to take a passage more than twice) and at the next junction take an unmarked passage if you can.
That’s it. If there’s an exit, you’ll find it. If there isn’t, you’ll find yourself back at the start. Good luck with that demon.