Clear Filters
Clear Filters

Minimizing Redundancy and Maximizing relevance from nchoosek

1 view (last 30 days)
I have a line of code in my program that is
nchoosek(1:22, 6);
I use the numbers in rows of this array as indices to select strings from a string array. So if one row it outputs is
1 2 3 4 5 6
then it calls on the 1 2 3 4 5 6 names of the string array. in essence each number represents a name. The names are inputted at the beginning and outputted at the end but for everything in between, a number is used to represent them.
Anyways, these numbers are also used as indices for other arrays that correspond to the people. One of them is that each name has a score associate with it. So, there is a name array and a score array with the indices of each array matching up. In example the 1 2 3 4 5 6 above have names associated with them in one array as well as the scores of those same names associated with them in another array.
The goal of the code is to run through all of the combinations of people (hence the nchoosek) and find which combination has the greatest summed score. I have worked this out, but I also made it so you could output as many of the top combinations as the user wants. The only issue with this is that the top combinations all use the same top score people except for the last person. It only changes the last person so that it is different but the score remains similar due to using many of the best scores still.
Finally, what I need help with is I am trying to have the least redundancy of people (repeat the same names the least amount of times), but have greatest relevance in terms of highest score (top combinations). I do not really understand the math on how to do this and was hoping there would be someone out there who did know how to do this! It's essentially an optimization problem giving up higher scores for less redundancy. I understand that there is probably some threshold constant that the user would have to pick to determine how much score they are willing to give up for less redundancy, but I don't really know where to go after that. Thank you so much for any help or guidance!

Answers (0)

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!