Locating Nearest Neighbors in space (fast)
- From: "KRK" <karlk@xxxxxxxxxxx>
- Date: Thu, 8 Sep 2005 13:24:36 -0400
Hi,
I'm programming in C and have two separate structure arrays holding
coordinates for points in space
typedef struct{
double x;
double y;
double z;
} Position;
Position *array1; /*Approx. 50,000 Entries*/
Position *array2; /*Approx 50,000 Entries*/
My problem is this, I want to take each point in array 1, and find its
'nearest spatial neighbor' in array 2. This can be done by brute force, but
is rather slow, since to do this requires on the order of 10^10 multiplies.
Further, I want to do this operation abot 180 times!
Does anyone know a fast algorithm to do this, preferably one that doesn't
require fancy knowledge of data structures etc since I'm not a professional
programmer. Thanks.
Karl
.
- Follow-Ups:
- Re: Locating Nearest Neighbors in space (fast)
- From: James Dow Allen
- Re: Locating Nearest Neighbors in space (fast)
- From: Christer Ericson
- Re: Locating Nearest Neighbors in space (fast)
- From: Jon Harrop
- Re: Locating Nearest Neighbors in space (fast)
- From: William
- Re: Locating Nearest Neighbors in space (fast)
- From: Randy
- Re: Locating Nearest Neighbors in space (fast)
- From: Arthur J. O'Dwyer
- Re: Locating Nearest Neighbors in space (fast)
- Prev by Date: Re: programming and typing
- Next by Date: Re: how to generate a sequence?
- Previous by thread: Re: [OT] Jerry Rice (was: What's "lunch"?? (was: Personal connections))
- Next by thread: Re: Locating Nearest Neighbors in space (fast)
- Index(es):
Relevant Pages
|