Understanding the True Version of Prim's Algorithm
Explore how the true version of Prim's algorithm assigns weights to cells instead of passages to generate mazes. Understand the minor algorithm modifications and their effects on maze patterns compared to simplified Prim's or Kruskal’s algorithms. This lesson guides you in implementing and running the TruePrims class to create distinct maze textures.
We'll cover the following...
True Prim’s algorithm
Although the algorithm we are about to implement is called a “true” Prim’s algorithm, it’s still slightly modified. Rather than assigning weights to passages, it assigns weights to cells and then chooses cells based on those costs. This gives us mazes very similar to those from a fully passage-weighted Prim’s algorithm and for significantly less effort. We'll make some changes to the same Prims class we created earlier by adding a new TruePrims class ...