Find shortest connections between two sets of points (identical number)

there was a very similar post from a few weeks ago, link it down here

the main point is, if for each point you want to find the closest destination point, the order in which you process the starting points matters a lot

for instance, in this stupid basic case, connecting start points 1, 2 with destination points A, B
if you process point 1 first, that point will connect to A generating line 1-A
but if you process point 2 first, it’s point 2 that will connect to A generating line 2-A

so, for any given set of start and destination points with same amount of elements, the order in which the starting points are processed makes the world of difference