background preloader

The Stony Brook Algorithm Repository

The Stony Brook Algorithm Repository
This WWW page is intended to serve as a comprehensive collection of algorithm implementations for over seventy of the most fundamental problems in combinatorial algorithms. The problem taxonomy, implementations, and supporting material are all drawn from my book The Algorithm Design Manual. Since the practical person is more often looking for a program than an algorithm, we provide pointers to solid implementations of useful algorithms, when they are available. Because of the volatility of the WWW, we provide local copies for many of the implementations. We encourage you to get them from the original sites instead of Stony Brook, because the version on the original site is more likely to be maintained. Further, there are often supporting files and documentation which we did not copy, and which may be of interest to you. Many of these codes have been made available for research or educational use, although commercial use requires a licensing arrangement with the author.

An Intuitive Explanation of Fourier Theory Steven Lehar slehar@cns.bu.edu Fourier theory is pretty complicated mathematically. But there are some beautifully simple holistic concepts behind Fourier theory which are relatively easy to explain intuitively. There are other sites on the web that can give you the mathematical formulation of the Fourier transform. Basic Principles: How space is represented by frequency Higher Harmonics: "Ringing" effects An Analog Analogy: The Optical Fourier Transform Fourier Filtering: Image Processing using Fourier Transforms Basic Principles Fourier theory states that any signal, in our case visual images, can be expressed as a sum of a series of sinusoids. These three values capture all of the information in the sinusoidal image. The magnitude of the sinusoid corresponds to its contrast, or the difference between the darkest and brightest peaks of the image. There is also a "DC term" corresponding to zero frequency, that represents the average brightness across the whole image. Back to top

Introduction to Programming in Java: An Interdisciplinary Approach Hungarian algorithm Combinatorial optimization algorithm that solves the assignment problem in polynomial time James Munkres reviewed the algorithm in 1957 and observed that it is (strongly) polynomial.[3] Since then the algorithm has been known also as the Kuhn–Munkres algorithm or Munkres assignment algorithm. The time complexity of the original algorithm was , however Edmonds and Karp, and independently Tomizawa noticed that it can be modified to achieve an running time.[4][5][how?] variants is the Jonker–Volgenant algorithm.[6] Ford and Fulkerson extended the method to general maximum flow problems in form of the Ford–Fulkerson algorithm. The problem[edit] Example[edit] The Hungarian method, when applied to the above table, would give the minimum cost: this is $6, achieved by having Paul clean the bathroom, Dave sweep the floors, and Chris wash the windows. Matrix formulation[edit] where L and R are permutation matrices. Bipartite graph formulation[edit] . The algorithm in terms of bipartite graphs[edit] . . .

Spatial references, coordinate systems, projections, datums, ell People are often mixing the above as if they were one and the same, so here’s a recap of them. One of the things you often find people saying is that “my data is in the WGS84 coordinate system”. This doesn’t really make sense, but I will get back to this later. This is a very confusing subject, and I might have gotten a few things wrong myself, so please add a comment and I’ll update it ASAP. Coordinate systems A coordinate system is simply put a way of describing a spatial property relative to a center. The Geocentric coordinate system is based on a normal (X,Y,Z) coordinate system with the origin at the center of Earth. Sidenote: The geocentric coordinate system is strictly speaking a cartesian coordinate system too, but this is the general terms I've seen used the most when talking about world coordinate systems. Datums and ellipsoids This poses two immediate problems: Where is the center of the earth What is the shape of the earth? Read more on Datums and Spheroids. Projections

Effective Java Second Edition Oracle Technology Network > Java Software Downloads View All Downloads Top Downloads New Downloads What's New Java in the Cloud: Rapidly develop and deploy Java business applications in the cloud. Essential Links Developer Spotlight Java EE—the Most Lightweight Enterprise Framework? Blogs Technologies Contact Us About Oracle Cloud Events Top Actions News Key Topics Oracle Integrated Cloud Applications & Platform Services Video Lectures | Introduction to Algorithms (SMA 5503) | Electrical Engineering and Computer Science Magical Square Root Implementation In Quake III Any 3D engine draws it’s power and speed from the mathematical models and implementations within, and trust John Carmack of ID software for using really good hacks. As it turns out, a very interesting hack is used in Quake III to calculate an inverse square root. Preface ID software has recently released the source code of Quake III engine with a GPL license. Carmack’s Unusual Inverse Square Root A fast glance at the file game/code/q_math.c reveals many interesting performance hacks. Observe the original function from q_math.c: float Q_rsqrt( float number ) { long i; float x2, y; const float threehalfs = 1.5F; x2 = number * 0.5F; y = number; i = * ( long * ) &y; // evil floating point bit level hacking i = 0x5f3759df - ( i >> 1 ); // what the fuck? Not only does it work, on some CPU’s Carmack’s Q_rsqrt runs up to 4 times faster than (float)(1.0/sqrt(x), eventhough sqrt() is usually implemented using the FSQRT assembley instruction! Newton’s Approximation of Roots A Witchcraft Number

How Game Theory Solved a Religious Mystery The Bankruptcy Problem A man owes debts of 100, 200, and 300, but dies with insufficient funds to pay everyone. How should his estate be divided? As we all know, there might not be one correct answer. Fair division is a concept that depends as much on logic as it does on social custom. To see why, consider the following three situations that afford very different solutions: A parent promises gifts to his children, but has to back off when a bonus is smaller than expectedA publicly traded company issues stock and bonds, but soon goes bankrupt in an accounting scandalPartygoers order items at a restaurant, with promises to pay, and then end up arguing over the best way to split the bill There isn’t a single right way to approach any of these problems. Some people prefer proportional division that depends on debt size. Others prefer splitting things up equally. What gets accepted depends on social custom. The Talmud answer The Talmud offers answers through three examples. Why stop there?

Archimedean Solid The 13 Archimedean solids are the convex polyhedra that have a similar arrangement of nonintersecting regular convex polygons of two or more different types arranged in the same way about each vertex with all sides the same length (Cromwell 1997, pp. 91-92). The Archimedean solids are distinguished by having very high symmetry, thus excluding solids belonging to a dihedral group of symmetries (e.g., the two infinite families of regular prisms and antiprisms), as well as the elongated square gyrobicupola (because that surface's symmetry-breaking twist allows vertices "near the equator" and those "in the polar regions" to be distinguished; Cromwell 1997, p. 92). The Archimedean solids are sometimes also referred to as the semiregular polyhedra. The Archimedean solids are illustrated above. Nets of the Archimedean solids are illustrated above. The following table lists the uniform, Schläfli, Wythoff, and Cundy and Rollett symbols for the Archimedean solids (Wenninger 1989, p. 9). , edges where

Learn Algorithms Evil Mad Scientist Laboratories - Iterative Algorithmic Plastic One of our favorite shapes is the Sierpinski triangle. In one sense, a mere mathematical abstraction, on the other, a pattern that naturally emerges in real life from several different simple algorithms. On paper, one can play the Chaos Game to generate the shape (or cheat and just use the java applet). You can also generate a Sierpinski triangle in what is perhaps a more obvious way: by exploiting its fractal self-similarity. We begin with a few packages of polymer clay– two colors of Fimo Soft, in this case. Form the two clay colors into long triangular shapes. Press the stack of triangles together to make sure that the edges fuse well. Cut the stretched “first iteration” piece into four pieces of equal length. Again stretch the result from the previous iteration, cut into four pieces of equal length and set one aside. By now, you should have the hang of the iterative algorithm for making the fractal. The fifth iteration has 243 dark triangles.

Quantum Random Bit Generator Service The trouble with five December 2007 We are all familiar with the simple ways of tiling the plane by equilateral triangles, squares, or hexagons. These are the three regular tilings: each is made up of identical copies of a regular polygon — a shape whose sides all have the same length and angles between them — and adjacent tiles share whole edges, that is, we never have part of a tile's edge overlapping part of another tile's edge. Figure 1: The three regular tilings. In this collection of tilings by regular polygons the number five is conspicuously absent. Figure 2: Three pentagons arranged around a point leave a gap, and four overlap. But there is no reason to give up yet: we can try to find other interesting tilings of the plane involving the number five by relaxing some of the constraints on regular tilings. Is it now possible to find a set of shapes with five-fold symmetry that together will tile the plane? Going for simple shapes Figure 3: Constructing a tiling piece by piece. Dividing monsters forever

"This WWW page is intended to serve as a comprehensive collection of algorithm implementations for over seventy of the most fundamental problems in combinatorial algorithms" by macopa Apr 25

Related: