Filter löschen
Filter löschen

Creating max diversity of numbers while maximizing another value assigned to numbers

1 Ansicht (letzte 30 Tage)
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!

Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by