【发布时间】:2020-12-22 11:45:08
【问题描述】:
给定平面上的两组点P1, P2。
解决方案:如果有一条线将P1 和P2 的点分开,则这条线表示P1 中的所有点都在一侧,P2 中的所有点都在另一侧,返回'有这样的行',否则返回'没有这样的行'。
示例:考虑以下几点:????5 = (−2,1) ,????4 = (6,2) ,????3 = (2, -2) ,??? ?2 = (1,5) ,??????1 = (-2, -1)。
P1 = {????1,????2} and P1 = {????3,????4} ---> 例如返回 'There is such line' y = 2x-3。
而P1 = {????1,????2} and P1 = {????3,????4,????5} ---> return 'There is no such line'。
是否存在不使用凸包来解决此问题的基于线性设计的算法?我很乐意提出建议!
【问题讨论】:
-
凸包有什么问题?
标签: algorithm linear-programming