Skip to content

lexeyOK/percolator-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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