...

/

Closest Meeting Point

Closest Meeting Point

Given N people on an MxM grid, find the point that requires the minimum total distance travelled by all N people to meet at that point.

Statement

There is an MxM grid where N people live. These N people want to meet such that the total travel distance is minimized. The travel distance is to be calculated using the Euclidean distance metric. For two points on this grid, (x​1,y​1) and (x​2, y2), the Euclidean distance between them is given by:

d=(x2x1)2+(y2y1)2d=\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} ...

Access this course and 1400+ top-rated courses and projects.