Better Weaving with Kruskal
Explore how to use Kruskal's algorithm to create weave mazes with consistent and predictable crossing densities. Understand how to strategically place crossing passages on a grid and merge disjoint sections into a coherent maze. This lesson helps you master controlled maze generation while avoiding cycles and maintaining grid consistency.
We'll cover the following...
Generating consistent mazes
We've seen randomized Kruskal’s algorithm, and now you might be wondering what this has to do with weave mazes. Recall how weave mazes were presented earlier, where the algorithm randomly attempts to move over or under passages. This certainly works, but it’s not very consistent. Sometimes, we may get a maze with a dozen crossing passages, and other times, we might only get one or two (or none at all!). That’s the nature—and consequence—of random. ...