The actual question is we are given 'm' areas and 'n' atm where n<=m. We have to station these 'n' atms in these 'm' areas so that the sum of distances between the areas and their nearest atm is minimum. eg: let there be 10 areas at x-axis at points {1,2,3,6,7,9,11,22,44,50}.So, the 5 atms should be stationed at {2,7,22,44,50} to get minimum sum of distances which is 9 since 1st area is at x=1 and its nearest atm is at x=2 ,so distance1=1 and similarly distance2=0, distance3=1, distance4=1, distance5=0, distance6=2, distance7=4, distance8=0, distance9=0, distance10=0
Asked
Active
Viewed 152 times
0
-
1I may have not understood what you are trying to select, but why aren't the 5 points {1,2,3,6,7}? – michalis vazaios Jul 14 '19 at 15:48
-
How do you get that the minimum distance is $9$/ The distance from $2$ to $7$ is only $5$. Where did you take a sum? – saulspatz Jul 14 '19 at 15:59
-
There is likely the germ of an interesting problem here, but the body of the Question would stand some improvement. The problem statement should be reasonably self-contained in the body (not relying only on the title to express the setup and goal). Also it is useful to Readers to know more about why the problem is interesting to you, so that responses can be shaped accordingly. – hardmath Jul 14 '19 at 16:28
-
@saulspatz I have edited my question for better understanding and also realized that it can be solved using k-medoids clustering – Karan Singh Jul 15 '19 at 22:51