Click the grid to increase the number of sites!
This is a visualization of the so called dynamic connectivity problem. It visualizes the random creation of a connected pathway between individual nodes. Variations of it can be used in simulating computer networks, the spreading of an idea or in circuit design. It uses a union find algorithm to determine connectedness. It is built with an open source canvas rendering library that I am developing called Spectrum.
The rectangles, called “sites”, are randomly opened (filled). Once a series of open sites creates a connection between the top row and the bottom row, the simulation is complete. At which point, white cells represent “connectedness”, and green cells are either closed or not disconnected.
I should also mention that some of this is based on assignments from Princeton’s Algorithms I, offered through Coursera. The course is taught using Java, however this is all written in CoffeeScript.