Hi everyone!!
I recently started an experimental project to explore whether diffusion models can learn to solve mazes, and if these models are capable of learning structured patterns like paths from start to end, without using classic algorithms like A* or Dijkstra.
My Approach:
I trained a U-Net model conditioned on:
- The maze structure
- A start/end matrix
Data Representation (3-channel input):
- Maze matrix:
1
β valid path0
β wall
- Start/End matrix:
1
β start or end point0
β elsewhere
- Solution path matrix (target to denoise):
1
β part of the solution path0
β all other cells
During training, I apply a DDPM-style noise schedule to the solution path matrix and train the model to predict the added noise , conditioned on the maze and start/end inputs.
During inference, the model starts from random noise and generates the solution path step-by-step through denoising.
Try it live:
https://maze-diffusion.netlify.app/
Note: The server takes ~1.5 minutes to respondβ¦
Itβs running on a humble 1 CPU, no GPU, (be patient β itβs thinking hard )