简体   繁体   English

给定一组点 S,一个点 p 确定是否存在一个半平面 L 使得 L 包含 p 但不包含 S 中的任何其他点

[英]Given a set of points S, and a point p determine whether there exist a half-plane L such that L contains p but does not contain any other point from S

Given a set of points S, and a point p, determine whether there exist a half-plane L such that L contains p, but does not contain any other point from S.给定一组点 S 和一个点 p,确定是否存在一个半平面 L,使得 L 包含 p,但不包含 S 中的任何其他点。

My solution:我的解决方案:

find the CH(S) - o(nlogn).找到 CH(S) - o(nlogn)。

check if p is inside CH(S) - o(n).检查 p 是否在 CH(S) - o(n) 内。

return true iff p is inside CH(S).如果 p 在 CH(S) 内,则返回 true。

Total time complexity - o(nlogn).总时间复杂度 - o(nlogn)。

Is there a more efficient algorithm?有没有更高效的算法?

Assuming from your proposed algorithm that we're considering a Euclidean space with three dimensions (or even a fixed number of dimensions), yes, there's a linear-time algorithm by formulating the problem as a linear program and solving it with Megiddo's algorithm.假设从您提出的算法中我们正在考虑具有三个维度(甚至是固定数量的维度)的欧几里得空间,是的,通过将问题表述为线性程序并使用 Megiddo 算法解决它,有一个线性时间算法。

暂无
暂无

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

相关问题 给定一个由 n 个顶点组成的简单多边形 P,以及由 k 个点组成的集合 S,确定每个多边形顶点是否被 S 中的某个点覆盖 - Given a simple polygon P, consisting of n vertices, and Set S Of k points, determine if each of the polygon vertices are covered by some point from S 给定空间中的一组点,请从集合中确定与空间中另一个点最接近的点(不在集合中) - Given a set of points in space, determine that point from the set that is the closest to another point in space (that's not in the set) 找到一个点,使得到一组点P中的任何点的最大距离最小化 - find a point such that the maximum distance to any point in a set of points P is minimized 在二维平面中找到距离 P 点最近的 K 个点 - Find K nearest Points to Point P in 2-dimensional plane 从平面上的一组点找到最近的点 - Finding the closest point from a set of points on plane 如何找到四个点是否包含通用P点 - How found if four points contain a generic P point 给定一组整数L和整数K,请选择L的最小子集S,以使SUM(S)> = K - Given a set of integers L and an integer K, select a minimal subset S of L such that SUM(S) >= K 如何从包含给定点的一组点中找到最小的N维单形? - How to find the smallest N dimensional simplex from a set of points that contains a given point? 表明,给定一个查询点q,可以在时间O(log n)中检验q是否位于P内 - Show that, given a query point q, it can be tested in time O(log n) whether q lies inside P 有什么聪明的方法可以确定一个点是否在矩形中? - Is there any clever way to determine whether a point is in a rectangle?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM