Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 1.13 KB

README.md

File metadata and controls

22 lines (16 loc) · 1.13 KB

Percolation simulator

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.

Examples of different visualizations.

first one is modulo times some primes in rgb and second one is grayscale in order of occurrence

colored

output

Sources

Footnotes

  1. Wikipedia article about percolation: Percolation theory

  2. Algorithm for labeling connected-components: Connected-component labeling Two-pass

  3. Inspired by Percolation a Mathematical Phase Transition