Learn how to arrange subsets

I have the following problem and I'm looking for a way to solve it with an machine learning algorithm or something like that.

I got a huge dataset and the data looks like that:

Row 1 = {{0},{4,4,4,4,4}}

Row 2 = {{1}, {0,4,5}, {5,5}}

Each set has the same number of values, but they can be "bundled" differently. With that I mean that the subset can be structured differently like in the example above.

I can move the subsets inside the set but can not move single values inside a subset. For example: I can move the second subset from the row 1 set like that "{{4,4,4,4,4}, {0}}". Thats all I can do.

After that I have to build a summation through the columns (vertically summation). I displayed that in the table below.

$$\begin{array}{c|lcr} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{}\\ R1 & 0 & 4 & 4 & 4 & 4 & 4 \\ R2 & 1 & 0 & 4 & 5 & 5 & 5 \\ \hline SUM & 1 & 4 & 8 & 9 & 9 & 9 \\ \end{array}$$

The standard deviation of the summation values should be as low as possible. I don't want to have outliers.

I solved that problem using an evolutionary algorithm. But the problem is that the algorithm needs several hours and I have to do it every day. And because I have to do it every day I got a lot of training data. And now I'm looking for an machine learning algorithm which can maybe detect a structure and give me the result faster. The result would be the arrangement of the subsets. The result does not have to be perfect.It should be good and fast.

• How many rows and how many values per row? Also welcome to CV! – jlimahaverford Oct 3 '15 at 19:43
• Hey :) I can not mention any exact figures because the number of rows and values can change. It can not be more than 1440 values but the number of rows are not limited. – Stev Oct 3 '15 at 20:30
• *1440 values for each row – Stev Oct 3 '15 at 21:25