如何查找有效元组的序列
我有n
元组(x_i,y_i,z_i)
。我想找到最小数量的序列,以便序列(x_i,y_i,z_i)中的每个元组> x_i> = x_j
,y_i> = y_j
和z_i> = z_jj
。所有n
元组必须分配给一个且仅一个序列。
例如,如果我有三个具有值(1、2、3),(2、2、3)和(1、1、7)
的元素,则有效序列的最小数量为2 ,是(2,2,3)和(1,2,3)
和(1,1,7)
本身。
我想找到一种算法,可以在o(n^3)
时间中返回此最小数字。我正在考虑检查每个元组相互对面的元组,但是必须有一种更有效的方法来解决此问题。任何指针都将不胜感激!
I have n
tuples (x_i, y_i, z_i)
. I want to find the minimum number of sequences such that each tuple in the sequence (x_i, y_i, z_i)
and (x_j, y_j, z_j)
is such that x_i >= x_j
, y_i >= y_j
, and z_i >= z_j
. All n
tuples must be assigned to one and only one sequence.
For example, if I had three tuples with values (1, 2, 3), (2, 2, 3), and (1, 1, 7)
, the minimum number of valid sequences is 2, which are (2, 2, 3) and (1, 2, 3)
and (1, 1, 7)
by itself.
I want to find an algorithm that can return this minimum number in O(n^3)
time. I was considering checking each tuple against each other tuple but there must be a more efficient way to solve this. Any pointers would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论