← Latest papers
🤖 AI

From Patterns to Maze Structures: SMT-Based Path Synthesis and 2D/3D Construction

This paper presents an SMT-based pipeline that synthesizes self-avoiding or layered paths from input patterns to serve as scaffolds for constructing both planar mazes and three-dimensional woven structures.

Original authors: Shengyi Wang

Published 2026-07-14
📖 5 min read🧠 Deep dive

Original authors: Shengyi Wang

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a secret message written in a blocky, pixelated font, like an old video game. You want to turn that message into a giant, walkable maze where the solution path traces the shape of the letters. But here's the twist: you don't just want a flat maze; you want one where the path can cross over itself like a woven basket, creating a 3D structure where one part of the path goes over another.

That's exactly what Shengyi Wang's paper does. It acts like a super-smart architect that takes a picture or text, figures out the perfect route through the pixels, and then builds a physical 3D model of a maze based on that route.

The Puzzle: Finding the Perfect Line

First, the computer has to find a single, continuous line that visits as many "on" pixels as possible without getting lost in loops or dead ends. You might think, "Hey, isn't this like the Traveling Salesman Problem, where a salesman tries to visit every city in the shortest way?"

The paper says no, that's a trap. While the Traveling Salesman Problem tries to find the shortest distance, this maze problem is more like trying to draw a single, unbroken line that visits every pixel exactly once (or twice, if it's a weaving path) without lifting your pen. If you try to use standard "shortest path" math, you might end up with diagonal shortcuts that break the grid rules, or you might get stuck in a loop that doesn't connect to the exit.

Instead, the author uses a method called SMT (Satisfiability Modulo Theories). Think of this as a very strict puzzle master. You give it a set of rules:

  1. The Tiles: Imagine every pixel is a tile with little doors on its sides (top, bottom, left, right).
  2. The Rules: If a tile has a door open to the right, the tile next to it must have a door open to the left.
  3. The Goal: Connect the start door to the end door, visiting as many tiles as possible, without creating any closed loops.

The computer asks the SMT solver: "Is there any way to arrange these tiles so all the rules are happy?" If the answer is "Yes," it gives you the blueprint. If the answer is "No," it tells you to try a slightly smaller goal.

The Weaving Trick: Going Over and Under

Here is where it gets cool. In a normal flat maze, paths can't cross; they have to go around each other. But in a "woven" maze, the path can cross itself. How? By pretending the path is a rope. Sometimes the rope goes over another part of the rope, and sometimes it goes under.

To make this work mathematically, the computer splits every crossing point into two invisible layers: a "horizontal" layer and a "vertical" layer. It's like having two ghost paths running through the same spot, but they never actually touch. The computer makes sure the "over" path is always higher than the "under" path.

The paper notes that allowing these crossings actually makes the puzzle easier for the computer to solve. For example, with a small "infinity" symbol pattern, the computer found a perfect solution in just 1.1 seconds. But when they tried to force the path to be flat (no crossings), it sometimes couldn't find a solution at all, or it took much longer to find a path that missed a few pixels.

Building the 3D World

Once the computer has the perfect line, it's time to build the maze.

  1. The Skeleton: First, it fills in the rest of the maze. Imagine the solution path is a golden thread. The computer uses a random-walk method (like a drunk person stumbling around but never crossing their own path) to fill in the empty spaces with walls and corridors, ensuring the golden thread remains the only way from start to finish.
  2. The Height Map: For the 3D version, the computer has to decide how high to build the "over" bridges and how low to dig the "under" tunnels. It uses a clever trick: it assigns the "under" paths a height of 0 and the "over" paths a height of 2.
    • Why 2? The paper proves that if you keep the crossing points far enough apart (no two crossings right next to each other), you can always build a staircase that goes up one step, then another, to get from the ground to the bridge without breaking the rules. It's like a game of "keep your feet on the ground" where you can only step up one block at a time.
  3. The Construction: Finally, it turns these numbers into 3D shapes. The "under" paths become flat platforms. The "over" paths become bridges suspended above them. Stairs connect the different levels. The result is a physical-looking maze where you can see the path weaving through itself.

The Results

The author tested this on a few patterns.

  • For a small "infinity" symbol with 202 pixels, it took 1.1 seconds to find the path.
  • For a larger "A" pattern with 447 pixels, it took about 4.8 minutes.
  • For an "rt" pattern with 421 pixels, it took 19.1 minutes.

In these tests, the computer successfully built mazes where the solution path traced the letters perfectly. The 3D models show a red ribbon highlighting the solution, winding through the structure, going over and under itself, just like a woven basket.

So, what's the big takeaway? The paper shows that by treating maze creation as a logic puzzle rather than a geometry problem, we can automatically turn any shape into a complex, 3D woven maze. It's not magic; it's just a very strict set of rules that a computer can follow to build something that looks like it was hand-crafted by a master weaver.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →