Lets say I have n lists from different sources, each contains m possible location of the user. I need to choose the most probable prediction of the user location. My idea was to pick one location from each source that so that those n locations are closest to each other. The average of those n locations will be my estimated user location.
My approach so far was to find every combination of n locations of those lists, and choose the smallest cluster. This works however for each prediction I have to iterate m^n times for all the possible combinations. The time complexity becomes too high if i have many sources with many possible locations. Is there a way to achieve what I wanted without iterating through every single combination or is there any other algorithms that does the similar thing even at the cost of reduced accuracy? Any help would be appreciated.