# How can matlab solve combinatorial optimization problems between data?

11 views (last 30 days)
cui on 7 May 2021
Edited: cui on 7 May 2021
How can matlab solve combinatorial optimization problems between data?
For example, I have a set of data t = [6,2,5,7,1,2,3,6,5,5,4], divided into 5 groups. The question is: How do I group the data so that the sum of the values in the group is minimized? (This is actually a production line balancing problem). It seems that the optimization functions in matlab do not define this problem well, e.g. ga, particleswarm and other global optimization functions need to specify the optimization objective function 'fun' and the number of variables 'nvars', but this problem is not well specified? It would be nice to have actual code to solve the above specific problem, thanks!
----------------------------------------------------------chinese----------------------------------------------------------------
matlab 如何解决数据之间的组合优化问题? than such an image is a representation of the optimal solution. Here we artificially specify that the 't' data set is set in 5 groups, {6, 2, 1}, {2, 6}, {5, 5}, {7, 3}, {5, 4}, where the sum of all elements of group 3 {5,5} is 10 (or group 4), which is the largest value of all groups.
Source of the problem: The problem of balanced distribution of production lines
##### 2 CommentsShowHide 1 older comment
cui on 7 May 2021
It is the division into k groups and how to group them in such a way that the maximum value of the sum of the elements in all groups is minimized!

R2021a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!