Prim’s Algorithm IV
✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on May 12, 2014
This example visualizes a random maze as a tree, generated using Prim’s algorithm with a randomized priority queue. The path from the root (bottom-right cell) to every other cell branches into a tidy, non-crossing layout produced by the D3 tree layout (`d3.layout.tree`). Links are drawn as straight SVG paths from each parent to its child. The maze itself is built by a custom `minHeap` implementation that selects edges with random weights, ensuring a uniformly random spanning tree.
AI-generated descriptionApplying a tree layout on Prim’s algorithm.
gpl-3.0 Licensed