Edit: Sithis posted the exact problem in the comments below.
The idea is you have a grid with people (upper case) and cars (lower case), there are exactly the same amount of people as cars. You must assign a person to the closest car.
Criterias:
- Closest person to the car, get the car at the first priority.
- Single car can't be assigned to 2 individuals
- Distance of a car from one individual will never be equal to distance of the same car from a different individual.
- Distances can be equal, but 2 different bikes and 2 different individuals
Note that this doesn't mean you'll assign the closest person to the closest car because someone else might be closer to that car.