views:

66

answers:

2

I have a flat area with nodes randomly placed on this flat surface. I need techniques which are able to take a starting point, move in a certain way (the algorithm), find nodes and continue searching. I do not have an overall view of the surface (i.e. I cannot see everything), only a limited view (i.e. 4 cells in any direction). Ideally, these methods would be efficient in the way that they work.

Any points in the right direction would be greatly appreciated.

A: 

Is the map size infinite, or do you know the dimensions, even if you ignore your starting position? Is it better to explore your starting position, or is the goal to explore greatest number of cells in minimal time?

If you want to explore your neighborhood with an infinite 8-connected map and 4-cell visibility in all directions, just do diagonal spirals. If the grid is finite, and you know the dimensions, it may be better to go in the same direction until you hit a wall (which will reveal your position), so you can plan your movements better from then on.

tucuxi
A: 

Use a variant of flood fill - just add checking for a node after each pixel is filled.

AVB