Fortran: Nearest Neighbour Search


haris3384
12-17-2012, 03:57 AM
hi,

i have a set A with 5,000 (x,y,z) triples and set B with
1,000,000 (x,y,z) triples.

For each point in set A i want to find set of nearest point from set B.(closest 10 points)

kindly guide me how to proceede to solve this problem

haris3384
12-17-2012, 11:15 AM
any kind of help plz

Bill Press
12-29-2012, 11:09 PM
If I were doing this, I'd use the KD tree method in NR 3rd ed., section 21.2. The class KDtree has a fast method for finding the nearest (of your set B) to an arbitrary point, so you could loop over the points in set A.
Cheers,
Bill P.