[algogeeks] Re: Find nearest point

2009-11-23 Thread Tiago Reul
Thanks, everybody. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit

[algogeeks] Re: Find nearest point

2009-11-18 Thread Gene
On Nov 17, 9:09 am, Tiago Reul wrote: > Suppose that you have the position of each person in the world. > Position is the pair (latitude, longitude). > > How to represent the data so that I can find the nearest person > from a point (φ,λ) without comparing to every pair in the collection? This is

[algogeeks] Re: Find nearest point

2009-11-18 Thread Ralph Boland
On Nov 17, 7:09 am, Tiago Reul wrote: > Suppose that you have the position of each person in the world. > Position is the pair (latitude, longitude). > > How to represent the data so that I can find the nearest person > from a point (φ,λ) without comparing to every pair in the collection? The s

[algogeeks] Re: Find nearest point

2009-11-18 Thread jbe
This is quite closely related to boids: http://www.red3d.com/cwr/ Simply put, each boid is aware of its near neighbours: not just the nearest one, but all that are nearer than some chosen distance. For that, the space is divided into partitions that keep track of the boids that are are within it, a

[algogeeks] Re: Find nearest point

2009-11-17 Thread Paksas
At it simplest, you could use a spatial partitioning structure of some sort - I'm guessing a quadtree would be more than perfect in this case. It would cut down your search time to O(lg(n)). The problem becomes a bit more complicated if you assume the people can move (well - that's obvious, but ma