Function for nearest neighbor placement of cells

I tested a couple of algorithms for placing cells, but the one that was
the fastest was the one in which I randomly generate points until valid
locations are found.