算法找点从位置最小总距离算法、最小、距离、位置

2023-09-11 02:04:26 作者:不二青春

我要建围绕寻找方便的交汇点的应用程序给定一组的位置。

I'm building an application based around finding a "convenient meeting point" given a set of locations.

目前我定义方便为最小化总行驶距离。这是从寻找如由以下示例(使用笛卡尔坐标而非纬度和经度为方便起见)的质心一个不同的问题:

Currently I'm defining "convenient" as "minimising the total travel distance". This is a different problem from finding the centroid as illustrated by the following example (using cartesian coordinates rather than latitude and longitude for convenience):

A为(0,0) B是在(0,0) C在(0,12)

最小总行程为这些点的位置是(0,0)与12的总行程距离;质心是在(0,4),其总行程距离16(4 + 4 + 8)

The location of minimum total travel for these points is at (0,0) with total travel distance of 12; the centroid is at (0,4) with total travel distance of 16 (4 + 4 + 8).

如果位置被限制在处于所述点中的一个,这个问题似乎变得更简单,但是这不是一个限制,我打算有(不同的是,例如,这个,否则类似的问题)。

If the location were confined to being at one of the points, the problem appears to become simpler, but this isn't a constraint I intend to have (unlike, for example, this otherwise similar question).

似乎我不能做的是拿出任何一种算法来解决这个问题! - 建议表示欢迎,请

What I can't seem to do is come up with any sort of algorithm to solve this - suggestions welcomed please!

推荐答案

下面是一个解决方案,找到地理中点,然后反复探索附近的位置来调整向最小总距离点。

Here is a solution that finds the geographical midpoint and then iteratively explores nearby positions to adjust that towards the minimum total distance point.

http://www.geomidpoint.com/calculation.html

这问题也颇为相似,

的最低存款额全部旅游时报

下面是你正在试图解决的一般问题维基百科文章:

Here is a wikipedia article on the general problem you're trying to solve:

http://en.wikipedia.org/wiki/Geometric_median