简体   繁体   English

找到所有给定圆圈覆盖的点

[英]Find point covered by all given circles

Given is n (n <= 1000) circles ((x;y), r) where (x;y) = coordinates of circle center, r = radius.给定 n (n <= 1000) 个圆 ((x;y), r) 其中 (x;y) = 圆心坐标,r = 半径。 x, y, r <= 10^6. x,y,r <= 10^6。 x, y, r, can be real numbers. x、y、r,可以是实数。

The problem is to find point(x;y) covered by all circles, or determine that there are no such points.问题是找到所有圆圈覆盖的点(x;y),或者确定没有这样的点。 Coordinates of point can be real numbers too.点坐标也可以是实数。

No ideas how to do it, could anyone help, please?不知道怎么做,有人可以帮忙吗?

Assuming that by circle you mean what mathematicians would call a closed disk, there's an O(n²)-time algorithm with simple data structures.假设你所说的圆圈是数学家所说的封闭圆盘,那么就有一个具有简单数据结构的 O(n²) 时间算法。

For k from 1 to n, the algorithm finds a point in the intersection of the first k disks, assuming that such a point exists.对于从 1 到 n 的 k,算法在前 k 个磁盘的交点中找到一个点,假设存在这样的点。 Start with the center of the first disk.从第一个磁盘的中心开始。 For each disk after the first, check whether the current point belongs to that disk.对于第一个之后的每个磁盘,检查当前点是否属于该磁盘。 If so, great.如果是这样,那就太好了。 If not, then either the intersection is empty or the intersection contains a point on the boundary of the current disk (the line segment from the current point to any point in the intersection of all of the disks must cross the boundary).如果不是,则交点为空,或者交点包含当前圆盘边界上的一个点(从当前点到所有圆盘交点中任意点的线段必须穿过边界)。 In this case, find a new point by intersecting the boundary (a circle) with each of the previous disks, an easier 1D problem.在这种情况下,通过将边界(一个圆)与之前的每个圆盘相交来找到一个新点,这是一个更简单的一维问题。

This might go even faster in expectation if we randomize the order of the disks, but I haven't worked out a proof.如果我们随机化磁盘的顺序,这可能会更快 go ,但我还没有找到证据。 With n ≤ 1000, hopefully O(n²) is fast enough.当 n ≤ 1000 时,希望 O(n²) 足够快。

Sharir ("Intersection and Closest-Pair Problems for a Set of Planar Discs", 1985) may have given an O(n log² n)-time algorithm, but I can't tell from the abstract. Sharir ("Intersection and Closest-Pair Problems for a Set of Planar Discs", 1985) 可能给出了 O(n log² n) 时间算法,但我无法从摘要中看出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM