首页 > 解决方案 > 最近的点对算法总是准确的吗?

问题描述

使用分而治之,最近的点对算法总是准确的吗?如果不是,那么什么时候它不
准确或者我什么时候不能应用它?例如,我有这个算法:

CLOSEST-PAIR (p1, p2, …, pn)

Compute separation line L such that  half the points are on each side of the line.
 δ1 ← CLOSEST-PAIR (points in left half).
 δ2 ← CLOSEST-PAIR (points in right half).
 δ ← min { δ1 , δ2 }.
 Delete all points further than δ from line L.
 Sort remaining points by y-coordinate.
 Scan points in y-order 
 and compare  distance between each point
 and next 11 neighbors. 
 If any of these distances is less than δ,      update δ.
  RETURN δ

我找不到不准确的场景。

标签: algorithmdata-structuresdivide-and-conquer

解决方案


推荐阅读