Posted 22 February 2007 - 04:38 PM
I've posted on BleepingComputer forums before and had great help. This is a little different,
but I thought I would give it a shot. I'm an ecologist modeling the movements of animals on
a landscape represented by pixels in a raster map. The animals need to select their favorite
pixel within a neighborhood of n x n pixels based on the values they store. I have no clever
algorithm for this, and don't know if one exists. Right now, an brute-force n x n search is used
to find the maximum value within the neighborhood of the animal.
One thought is to just use the brute-force approach in a pre-pass on the landscape, and store
the "destination" pixel for every pixel the animal may occupy. Then modeling would indeed be
fast, as distinations would be predetermined. But I include a random component in this modeling,
so that the animals movements aren't 100% predictable. In the search I describe above, that
just means assigning a random value to pixel values before doing the n x n search, which is
easy enough. But wanting to include some random component in the movements makes a
So, does anyone know of an algorithm to identify the maximum pixel in an n x n block of
pixels that is faster than n^2?
Thanks for any help,