Git Product home page Git Product logo

percolation's Introduction

Percolation

====Abstract====

The program simulates the process of percolation, the movement and filtering of fluids through porous materials. The program utilizes Monte Carlo method to increase the number of pores overtime, and finally creates a path that connects top and bottom rows. After the path appears, the fluid will percolate. http://introcs.cs.princeton.edu/java/24percolation/

After doing the simulation numerous times, we would find an average percentage of pores needed for percolation. This program does not try to show the result of that percentage, but to visually show the whole process of one simulation.

====Algorithms====

The program implements Union-Find data type, the material covered in the first week of Algorithm PartI by Princeton University in Cousera.org.

The program adapts Quick-Union algorithm with improvement of Path Compression to implement Union-Find. However, it is difficult to apply this algorithm to two-dimensional field, as it is hard to determine the root of each points when there is no connection to the top row. As a compromization, the program calls the union method for every spot everytime it opens any new spots. This iteration dramatically increases the runtime from O(nlogn) to O(n^2). When the number of spots is very large(>10000), the simulation would take a long time. Upon estimation, simulation of 62500 spots would take half an hour.

====Summary====

The Quick-Union algorithm is easy and clear in theory, but when put into application, it requires many modifications.

percolation's People

Contributors

zcnrex avatar

Stargazers

Angus H. avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.