algorithm - 最近的点对算法总是准确的吗?
问题描述
使用分而治之,最近的点对算法总是准确的吗?如果不是,那么什么时候它不
准确或者我什么时候不能应用它?例如,我有这个算法:
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 δ
我找不到不准确的场景。
解决方案
推荐阅读
- elasticsearch - Elasticsearch:意大利分析仪的问题
- javascript - 在 Livewire 弹出表单中添加名称不起作用
- php - 方法...应该返回数组但返回数组('key1'=>SomeObject|null,'key2'=>SomeObject2|null)
- react-native - 错误任务:expo:compileDebugKotlin FAILED
- git - 合并过去拆分的两个 git 仓库
- python - 如果子类在python中覆盖父类的方法,如何引发错误?
- angular - 如何一次更新所有实体 - NGRX?
- fluent-ui - 如何更改流利的 ui 主要或次要文本颜色?
- php - curl中的-u参数是什么意思?
- python - Pysolar get_azimuth 函数应用于 pandas DataFrame