This is percolation 1 simulation in rust.
Will create output.png
file in folder it was executed
Basic percolation is achieved like this:
- take grid graph of sides NxM
- remove edges of graph with some probability p
- find connected-components of leftover graph 2
This code supposed to output image of colored connected-components similar to that found in the video3.
first one is modulo times some primes in rgb and second one is grayscale in order of occurrence
Footnotes
-
Wikipedia article about percolation: Percolation theory ↩
-
Algorithm for labeling connected-components: Connected-component labeling Two-pass ↩
-
Inspired by Percolation a Mathematical Phase Transition ↩