I have a data like this
row1: x1 x2 x3... xn, y1,y2,...yn
row2: x2,x3,....xj, y4,y5,...ym
.....
row 1 million, x6,x2,x7...xk, y2,y3,...yl
每一行各有100万甚至100万。
每一行中,一定数量的x或 y能够具有同样的价值。 如同第1行和第2行一样,共有x2。
my goal is to find which row give me the smallest sum of x 以及 y. for example the sum of row 1 is sum(x1+x2,..+xn+y1+y2+...yn).
The exhaustive way can work but will be very slow since there will be one million * one million operations, I believe there are some clever ways to work.
Thanks
最新情况:
事实上,上述问题源自一个矩阵分部分:提供低于5x5的矩阵
1 2 3 4 5
2 3 4 5 6
2 3 4 5 8
9 1 2 3 5
1 5 2 5 6
there are at least five ways to partition this matrix into two submatrix , for example,
1 2 | 3 4 5
2 3 | 4 5 6
----+------
2 3 | 4 5 8
9 1 | 2 3 5
1 5 | 2 5 6
我有两个子矩阵
1 2
2 3
以及
4 5 8
2 3 5
2 5 6
so actually 1 2 2 3 is the x I refer, 以及 4 5 8 2 3 5 2 5 6 are the y I mention. so each row is a kind of splitting in the matrix. I am not sure I am clear or not? please add comments.