Lloyd’s algorithm is a method of finding evenly spaced points. It’s useful if you need a to divide something into a bunch of smaller cells, but want the cells to be evenly spaced and about the same size.

The way it works is to start with a random placement of points and then smooth them by gradually moving them towards the centroid of its Voronoi cell.

It’s obvious how this can be useful for map generation or mesh smoothing, but its uses go far beyond that: consider an image that you want to process so that it’s stippled or dithered. You want to distribute the dots evenly, but in a way that corresponds to the light and dark regions of your source image. Using a weighted Lloyd’s algorithm, you can produce the set of points that is spread out evenly while not being in a regular grid.

Now take it one step further: the position of trees in a forest is a set of points. Given a source image converted to a set of weighted points, you can generate the forest that matches the picture while still appearing natural and irregular.

http://en.wikipedia.org/wiki/Lloyd’s_algorithm