两组点之间的最佳匹配 [英] Best match between two sets of points

查看:117
本文介绍了两组点之间的最佳匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个点列表,我们称它们为L 1 (P 1 (x 1 ,y 1),... P n (x n ,y n ))和L 2 (P' 1 (x' 1 ,y' 1 ),... P' n (x' n ,y' n )).

I've got two lists of points, let's call them L1( P1(x1, y1), ... Pn(xn, yn)) and L2(P'1(x'1, y'1), ... P'n(x'n, y'n)).

我的任务是找到两点之间的最佳匹配,以最小化它们的距离之和.

My task is to find the best match between their points for minimizing the sum of their distances.

关于某种算法的任何线索吗?这两个列表包含大约.200-300点.

Any clue on some algorithm? The two lists contain approx. 200-300 points.

感谢和最好.

推荐答案

如果问题的用例涉及将列表L 1 中存在的所有点与列表L 2中的点进行匹配,那么匈牙利算法将是一个完美的选择.

If the use case of your problem involves matching ever point present in list L1 with a point in list L2, then the Hungarian Algorithm would serve as a perfect fit.

与您的匈牙利矩阵对应的权重将是为行注释的点与列注释的点之间的距离.优化的匈牙利算法的总体运行时间为O(n 3 ),可以轻松满足您给定的 n = 300

The weights corresponding to your Hungarian matrix would be the distance between the point annotated for the row vs the column. The overall runtime for the optimized Hungarian algorithm is O(n3) which will comfortably fit for your given constraint of n = 300

如果不是匈牙利算法,也可以将给定问题变成 max-flow-min-cost 问题-我现在将省略其详细信息,但可以根据需要进行讨论

If not for the Hungarian algorithm, you can also morph the given problem into a max-flow-min-cost problem - the details of which I'll omit for now but can discuss if required.

这篇关于两组点之间的最佳匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆