Jump flooding algorithm
The jump flooding algorithm (JFA) is a flooding algorithm used in the construction of Voronoi diagrams and distance transforms. The JFA was introduced at an ACM symposium in 2006. The JFA has desirable attributes in GPU computation, notably constant-time performance. However, it does not always compute the correct result for every pixel, although in practice errors are few and the magnitude of errors is generally small. Implementation. The JFA original formulation is simple to implement. Take an formula_1 grid of pixels (like an image or texture). All pixels will start with an "undefined" color unless it  is a uniquely-colored "seed" pixel. As the JFA progresses, each undefined pixel will be filled with a color corresponding to that of a seed pixel. For each step size formula_2, run one iteration of the JFA: Note that pixels may change color more than once in each step, and that the JFA does not specify a method for resolving cases where distances are equal, therefore the last-checked pixel's color is used above. The JFA finishes after evaluating the last pixel in the last step size. Regardless of the content of the initial data, the innermost loop runs  a total of formula_21 times over each pixel, for an overall computational complexity of formula_22. Variants. Some variants of JFA are presented in  and : Uses. The jump flooding algorithm and its variants may be used for calculating Voronoi maps and centroidal Voronoi tessellations (CVT), generating distance fields, point-cloud rendering, feature matching, the computation of power diagrams, and soft shadow rendering. The grand strategy game developer Paradox Interactive uses the JFA to render borders between countries and provinces. Further developments. The JFA has inspired the development of numerous similar algorithms. Some have well-defined error properties which make  them useful for scientific computing. In the computer vision domain, the JFA has inspired new belief propagation algorithms to accelerate the solution of a variety of problems.