Spiral Backtracker maze algorithm

The Spiral Backtracker is a recursive backtracker that prefers to keep turning the same way, so its corridors coil into spirals.

How it works

It works like the recursive backtracker (walk to an unvisited neighbour, back up when stuck), but instead of choosing a neighbour at random it prefers the one that turns clockwise from the way it was heading, then straight on, with a little noise to break ties.

That bias makes the walk curl round on itself, laying down nested spirals and long concentric corridors. It still visits every cell once, so the maze is perfect.

What to watch for

Watch the head wind round in tight coils, back out, and start a new spiral somewhere else.

Properties

Texture
Spirals and coils
Dead ends
Few
Uniform
No (strongly biased)
Speed
Fast
Memory
A stack

Try it

Open the studio to carve your own Spiral Backtracker maze at any size, solve it with up to four algorithms, and save the video.

FAQ

Is this a standard algorithm?

It's a variation on the recursive backtracker made for MazeSim: the same algorithm with a turning preference instead of a random choice.

All maze algorithms

Pro

and undefined are part of Pro

  • All 12 generators and 12 solvers
  • Hexagon, triangle and circle grids; heart, star and 6 more outlines
  • Giant mazes, up to 201×201, any width and height
  • Custom colours, 7 more themes, flood styles, clean no-label videos
  • Any speed from 0.25× to 4×, any amount of loops
  • 4 more scales and 3 more instruments
  • Titles on your videos, custom timing, any start and goal
  • Race and gauntlet videos, with or without the watermark