I have two sets of coordinates:
I'm only interested in the coordinates that have a very close (overlapping in the plot below) different coloured neighbour. The threshold distance isn't precise, just small relative to the spread of the other points. I need to be able to do this for about a million other similar sets of coordinates so efficiency is reasonably important.
The solution should provide a list of red points and a list of green points. Every one of which must have a exactly one neighbour in the other list. It's not necessary to know exactly which points pair together.