Every good story needs a labyrinth. Ariadne and Theseus, The Shining, Harry Potter, … I have used Kruskal’s algorithm for minimum spanning tree to generate a maze in a simple and efficient way.