Perfectly random sampling (2): Wilson's uniform spanning tree algorithm


Requiremens: python>=2.7 and tqdm for showing process bar.


Run any of the example*.py scripts and wait for a few seconds, you will see a .gif file generated in current directory, enjoy it!

This program is written in pure python: no third-party modules nor softwares are needed, just built-in modules like struct, random, colorsys and some built-in functions (if you want to embed the animation into a background image then PIL is required). It can make animations of all kinds of maze generation and maze solving algorithms on the 2D grid. It runs very fast and generates optimized GIF files in only a few seconds. I could write it faster by using numpy arrays but I prefer to keep the code being "pure blooded".

Update: I have added the process bar feature in the latest version for which the tqdm lib is required.