# Estimating Pi

Here, I am sharing three animations for estimating the Pi number. The first one is using the Monte Carlo method where the needles inside the circles and the whole squares are utilized to find the ratio of the areas, hence eventually the . Here, we increase the number of needles in a given trial and… Continue reading Estimating Pi

Algorithms

# Generate Uniform Random Points within a Circle

Let’s say we have only access to uniform random number generator which generates random points between 0 and 1 (let’s denote it rand()), and we are asked to generate uniformly random points within a given circle with specified radius (let’s say for now). The first idea that comes to mind is to utilize the random… Continue reading Generate Uniform Random Points within a Circle

# Dijkstra vs bi-directional Dijkstra comparison on sample US Road Network

.. under construction .. Here, we compare the progression of classical and bi-directional Dijkstra Algorithms as applied to simple 2D rectangular and hexagonal grids as well as more destructured US road network. The road network is intentionally sampled and reduced to a minimum spanning tree for easier visualization. The real connections between nodes can be… Continue reading Dijkstra vs bi-directional Dijkstra comparison on sample US Road Network

# How to make time-lapse animation of earthquakes with Python?

Use Python Basemap to get a time-lapse of earthquakes for the last 100 years in the Eastern Mediterranean

# How does Kruskal’s Algorithm progress?

Kruskal’s algorithm animation using randomly distributed points

# Prim’s Algorithm Progression Animation for randomly distributed points

For a given set of randomly distributed points in 2-dimensional space, Prim’s algorithm is utilized to find the minimum total distance from a randomly selected origin point (P_origin). Here, the progress of how the distances are selected by the algorithm at the first instant along the way to reach the minimum spanning tree (MST) is… Continue reading Prim’s Algorithm Progression Animation for randomly distributed points

Algorithms

# Fast C++ Solution to Huge Fibonacci number modulo m

This is a fast solution in C++ to Huge Fibonacci number modulo m question asked in the Algorithms course in UC San Diego Coursera course on Algorithms. It first calculates the Pisano period, then utilizes it to reduce the problem to a smaller size. The code also contains iterative solver to calculate Fibonacci number modulo… Continue reading Fast C++ Solution to Huge Fibonacci number modulo m