Prim’s Algorithm V
This visualization shows a spanning tree generated by Prim’s algorithm, with the color of each cell based on its distance from the root. The color scale periodicity varies over time, alternating between emphasizing local branch structure and the overall tree shape. The maze and tree are computed asynchronously in a JavaScript worker, then rendered as pixels on a Canvas. The animation uses `d3.timer` to cycle through a cubehelix color scale, which is applied to each cell’s distance value, and the periodic scaling factor changes smoothly over 20 seconds.
AI-generated descriptionAnother variation of color-cycling a spanning tree generated by Prim’s algorithm. Here the periodicity of the color scale by tree depth is varied over time, alternating between emphasis of micro and macro structure. This idea was suggested in a Hacker News comment.
forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/aa7edeac67253ea5de7f'>Prim’s Algorithm V</a>