My apologies if question is not in correct format. I don't post here often. I don't know what tags would be appropriate for this question, or even if this is an appropriate question.
Looking for algorithm for closest available resource.
n people P1-Pn, n taxis T1-Tn, are in a 2 dimensional coordinate system eg x,y
Determine Person Taxi pairs if each person walks to the closest taxi that will be available to them, and not taken by another person. Ties of two (or more) people to same taxi can go to the person of lower index. Ties of two (or more) taxis as closest taxi can go to taxi of lowest index.
Does this go by a common problem name? What algorithms exist?
As for what algorithms exist, I can think of 2 right off but I doubt they be considered efficient.
1. use recursion, eg find closest person taxi pair, remove both from available list, and run again.
2. enumerate (n squared) all possible P-T pairs into binary tree sorted by distance value, and then traverse binary tree starting with lowest value until each P has unique T.
3. or can someone offer better algorithms?
Thank you