k-means clustering is a method of vector quantization, originally from signal processing, that aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean (cluster centers or cluster centroid), serving as a prototype of the cluster. This results in a partitioning of the data space into Voronoi cells.
Read MoreThe Buddhabrot fractal is a type of fractal that is generated by plotting the paths of points that escape from the Mandelbrot set. The resulting image resembles a series of intertwined spirals and branches, and is named after the shape it resembles, which is said to resemble the seated figure of Buddha. The Buddhabrot fractal is created by assigning each point in the complex plane a "color" based on how many times it takes for that point to escape from the Mandelbrot set, and then plotting the paths of the points that do escape. This process is repeated millions of times, resulting in a highly detailed and intricate fractal image.
Read MoreThis Processing sketch loads two images and creates an image mask that blends them together. The transparency of the image mask is determined by 4D Open Simplex Noise, which loops perfectly.
Read MoreIn this sketch I turned every pixel of an image into a Lorenz System. I mapped the velocity of that system to the brightness value of the pixel. This was the result. Sadly, the Processing sketch I made this with is gone forever.
Read MoreThe Barnsley Fern is a fractal pattern named after British mathematician Michael Barnsley. It is generated by an iterative process that involves repeatedly applying a set of geometric transformations to a simple initial shape. The resulting fern-like pattern displays self-similarity at different scales, and has applications in computer graphics, image compression, and chaos theory.
Read More- Distance formula 1 execution time: 2224ms
- Distance formula 2 execution time: 4ms
- Distance formula 3 execution time: 3ms
Read MoreThis is a maximum flow problem on a bipartite graph. I created the flow chart above to visualize the 3 test cases. The virtual judge run time was 0.18s.
Read MoreUVa Online Judge Challenge "10305"
Apr 26, 2018 · 2 min read · uva dag directed acyclic graph topological sort bitset coding challenge ·This problem presents a DAG and the solution requires implementing a topological sort. I noticed that a topological sort can be implemented using only boolean arrays so I used this as an opportunity to finally get around to using Java's BitSet class. The virtual judge run time was 0.050s.
Read MoreAlthough BFS and DFS were recommended solutions to the problem, I saw an opportunity to solve this problem using Disjoint Sets. The virtual judge run time was 0.050s.
Read More- TurboReader is my solution to the poor input performance of Scanner. All I need from a Reader in most programming contest problems is the ability to read ints and Double, and to read them quickly. That is all this class does, and it also tokenizes those values so that I never have to address empty lines in the text …
Read More Kruskal's algorithm is a greedy algorithm used to find the minimum spanning tree of a connected, weighted graph. The algorithm works by sorting the edges of the graph by weight, and then adding the edges to the minimum spanning tree one by one, making sure to avoid creating cycles. Kruskal's algorithm has a time complexity of O(E log E) where E is the number of edges in the graph, and is widely used in network design and optimization problems.
Read MoreI created my own Collatz Conjecture visualization, experimenting with a unit circle design that resulted in 360 distinct "branches". While it may not offer groundbreaking insights, the process was enjoyable and yielded interesting results, particularly for the number 327.
Read More- This problem involves a relatively small graph, so I opted to implement the Floyd-Warshall Algorithm instead of Dijkstra's Algorithm for the sake of simplicity. This algorithm finds the shortest path between every pair of vertices in a graph, running in O(n^3) time. Although this might sound inefficient, the UVA judge …
Read More - I'm working on a few programs that I will be using using to visualize algorithms on procedurally generated terrain. This particular program visualizes a minimum spanning tree using Prim's Algorithm on random walkers. The terrain is 128x128 tiles, each containing 4 vertices on the negative y-axis that I applied a Perlin …
Read More