We are given a huge set of points in 2D plane. We need to find, for each point the closest point within the set. For instance suppose the initial set is as follows:
Use the package spatstat . It's got builtin functions to do this sort of stuff.
spatstat