Creating max diversity of numbers while maximizing another value assigned to numbers
1 次查看(过去 30 天)
显示 更早的评论
I am trying to create an array that contains the most variety of numbers but maximizing a "score" assigned to them. So, I am doing an n choose k of 22 and 6 respectively. so I have around 72,000 different combinations of 6 numbers from 1-22. My problem is that when I am selecting these combinations I want to select the combinations that use the same numbers the least. For example, if I ask for 4 combinations I don't want it to give me
1 2 3 4 5 6
1 2 3 4 5 7
1 2 3 4 5 8
1 2 3 4 5 9
as the combinations. I would more so like something that uses the most of the 22 numbers available and also when it does use a same number in multiple combinations, it puts the number with different numbers than it was placed with the first time so there is more variety. For example this would be different numbers but not much different combos when used multiple times:
1 2 3 4 5 6
7 8 9 10 11 12
1 2 3 4 5 7
13 14 15 16 17 18
19 20 21 22 13 12
So this uses all the different numbers, but when it uses 1 again it puts it with the same numbers as before.
This would be more desirable because it puts 1 with different numbers than before:
1 2 3 4 5 6
7 8 9 10 11 12
1 9 7 14 17 18
13 14 15 16 17 18
19 20 21 22 13 12
Now again, I already have it generating all the combinations and I'm just figuring how to select them. I am currently maximizing "score" and outputting the best combinations with the greatest summed score. The first and second and third etc look very similar only changing one number because the rest are still the best to allow it to reach the best score possible. I would like to sacrifice a overall higher score for more variety of combinations if that makes sense. It is basically optimizing maximizing score while also maximizing diversity. If anyone has any answers I would appreciate it so much!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!