Published
Edited
May 31, 2019
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
N = 1 << 0
Insert cell
S = 1 << 1
Insert cell
W = 1 << 2
Insert cell
E = 1 << 3
Insert cell
function sinebow(t) {
return "#" + [0, 1, 2].map(i => {
const v = 255 * Math.sin(Math.PI * (t + i / 3)) ** 2;
return Math.round(v).toString(16).padStart(2, "0");
}).join("");
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md`## Notes
A minimum spanning tree is a subset of the edges in a graph such that there are no cycles and the sum of weights of the edges is at a minimum. A maze can be [interpreted](https://en.wikipedia.org/wiki/Maze_generation_algorithm) as a minimum spanning tree where the nodes of the graph are points in the grid and there are potential edges between adjacent nodes.
[@andreaskdk:kruskals-algorithm](https://observablehq.com/@andreaskdk/kruskals-algorithm-for-maze-generation)
`
Insert cell
md`## References
- [@mbostock/prims-algorithm-flood](https://observablehq.com/@mbostock/prims-algorithm-flood)
- [wiki/Maze](https://en.wikipedia.org/wiki/Maze)
- [SE How Many mazes](https://math.stackexchange.com/questions/2679666/how-many-valid-mazes-of-some-size-are-there)
- [wiki/Prim's_algorithm](https://en.wikipedia.org/wiki/Prim%27s_algorithm)
- [classify](http://www.math.stonybrook.edu/~tony/mazes/classify.html)
- [bl.ocks d3.each](https://bl.ocks.org/mbostock/4c5fad723c87d2fd8273)
- [SO](https://stackoverflow.com/questions/14218016/each-with-a-filter)
- [@jrus/roses](https://observablehq.com/@jrus/roses) multiplot
- [jamisbuck](http://weblog.jamisbuck.org/2011/1/27/maze-generation-growing-tree-algorithm) :: [book](https://www.amazon.com/Mazes-Programmers-Twisty-Little-Passages/dp/1680500554)

### Other Maze Notebooks
- [@andreaskdk/kruskals-algorithm-for-maze-generation](https://observablehq.com/@andreaskdk/kruskals-algorithm-for-maze-generation) :: [circular](https://observablehq.com/@andreaskdk/kruskals-algorithm-for-circular-maze)
- [@jaywunder/maze-generator](https://observablehq.com/@jaywunder/maze-generator)
- [@cadeo111/depth-first-maze-generator-algorithm](https://observablehq.com/@cadeo111/depth-first-maze-generator-algorithm)
- [@matharumanpreet00](https://observablehq.com/@matharumanpreet00/maze-generation-with-randomized-dfs)
- [@markmeyerphoto/mst-maze](https://observablehq.com/@markmeyerphoto/mst-maze) nodes and links
- [@tbd/maze-generator-2](https://observablehq.com/@tbd/maze-generator-2) maze grid :: [@tbd/maze-generator](https://observablehq.com/@tbd/maze-generator)
- [@jgrunik/growing-tree-algorithm](https://observablehq.com/@jgrunik/growing-tree-algorithm)
`
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more