
Wilson’s Algorithm - bemmu
https://bl.ocks.org/mbostock/11357811
======
TwoFx
This is part of a very nice larger article by the same author on visualizing
algorithms [0]. It covers sampling, shuffling, sorting, and maze generation.

[0]:
[https://bost.ocks.org/mike/algorithms/](https://bost.ocks.org/mike/algorithms/)

------
LoSboccacc
> an unbiased sample of all possible spanning trees

this also makes the mazes generated by the algorithm the most annoying to
solve without a computer, but they are the most resistant to be searched in
reverse of all the forward building algorithms (without explicit honeypots for
trapping reversers)

~~~
phkahler
>> this also makes the mazes generated by the algorithm the most annoying to
solve without a computer

Came to say that. I see a lot of what looks like the letter E in there. Many
tiny dead ends. Really hard to visually follow a path through, and I can only
imagine how not-fun it would be to play a first person game in there.

~~~
LoSboccacc
given the complexity I an see them being useful for decorative garden mazes
(as in, very very tiny) - lot of complexity but actually small could give an
interesting run without being overwhelming.

------
catpolice
Ah, this is very similar to some old maze generation toys I was working on a
few years back. I was experimenting with adding a little extra stochasticity
to the mix. E.g. selecting from the last ~30 neighbors added creates
interesting mazes with "multiple growth fronts" rather than one tendril or a
uniform expansion at the edge. You can see a GIF example here:
[https://raw.githubusercontent.com/j-s-n/mazes/master/example...](https://raw.githubusercontent.com/j-s-n/mazes/master/examples/algorithm3-thickness4-128x128.gif)

(My code uses toroidal topology, which is why you can see things going off the
edge and coming back on the other side.)

And things like varying whether new neighbors are added to the head or tail of
the list adds a little perceptible chaos. It's too bad it looks like my demo
site is down right now.

There's a (old, badly documented) JS demo here with about 6 variant
algorithms: [https://github.com/j-s-n/mazes-
js](https://github.com/j-s-n/mazes-js)

And a better documented but still out of date Python example (that hand-
encodes an animated gif here):
[https://github.com/j-s-n/mazes](https://github.com/j-s-n/mazes)

------
WoodenChair
Even Richard Stallman doesn't agree with releasing such small snippets of code
under the GPL. See his essays in "Free Software, Free Society."

------
jimktrains2
Aside: The text doesn't show up without JavaScript. I wouldn't expect to see
the animation, but why can't I read the text?

~~~
jjaredsimpson
It's being pulled as a gist from github

------
d--b
Ah, it's been a long time since we heard from Mike. I wonder how d3.express is
coming along...

------
logicallee
Very nice. I see the "entrance" but where is the "exit" to the maze? Doesn't
it need one?

~~~
jerrygoyal
wondering the same

~~~
yitchelle
Perhaps exit == entrance.

